mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-17 15:27:36 +00:00
Add an ATOMIC_CLEAR_INT macro.
Submitted by: tmm
This commit is contained in:
parent
b8d4451640
commit
453e54056e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=92198
@ -59,7 +59,7 @@
|
||||
9: sub r2, 1, r3 ; \
|
||||
casa [r1] ASI_N, r2, r3 ; \
|
||||
cmp r2, r3 ; \
|
||||
bne,pn %xcc, 9b ; \
|
||||
bne,pn %icc, 9b ; \
|
||||
mov r3, r2
|
||||
|
||||
/*
|
||||
@ -70,7 +70,18 @@
|
||||
9: add r2, 1, r3 ; \
|
||||
casa [r1] ASI_N, r2, r3 ; \
|
||||
cmp r2, r3 ; \
|
||||
bne,pn %xcc, 9b ; \
|
||||
bne,pn %icc, 9b ; \
|
||||
mov r3, r2
|
||||
|
||||
/*
|
||||
* Atomically clear a number of bits of an integer in memory.
|
||||
*/
|
||||
#define ATOMIC_CLEAR_INT(r1, r2, r3, bits) \
|
||||
lduw [r1], r2 ; \
|
||||
9: andn r2, bits, r3 ; \
|
||||
casa [r1] ASI_N, r2, r3 ; \
|
||||
cmp r2, r3 ; \
|
||||
bne,pn %icc, 9b ; \
|
||||
mov r3, r2
|
||||
|
||||
#define PCPU(member) %g7 + PC_ ## member
|
||||
|
Loading…
Reference in New Issue
Block a user