17 stc ccr, r1h ; save flags\n\ 18 orc #0x80, ccr ; disable all but NMI\n\ 22 ldc r1h, ccr ; restore flags\n\ kernel configuration file
volatile unsigned char atomic_t
The data type that allows for atomic count operations.
Interface: critical section management.
void atomic_inc(atomic_t *counter)
increment atomic counter without interruption.
__asm__("\n\
.text\n\
.globl _atomic_inc\n\
_atomic_inc:\n\
stc ccr, r1h ; save flags\n\
orc #0x80, ccr ; disable all but NMI\n\
mov.b @r0, r1l\n\
inc r1l\n\
mov.b r1l, @r0\n\
ldc r1h, ccr ; restore flags\n\
rts\n\
")
void atomic_dec(atomic_t *counter)
decrement atomic counter without interruption.