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.
__asm__("\.text\.globl _atomic_inc\ _atomic_inc:\ stc ccr, r1h ; save flags\ orc #0x80, ccr ; disable all but NMI\ mov.b @r0, r1l\ inc r1l\ mov.b r1l, @r0\ ldc r1h, ccr ; restore flags\ rts\")
Interface: critical section management.
void atomic_inc(atomic_t *counter)
increment atomic counter without interruption.
void atomic_dec(atomic_t *counter)
decrement atomic counter without interruption.