Go to the source code of this file.
Functions | |
void | atomic_inc (atomic_t *counter) |
increment atomic counter without interruption. More... | |
__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\") | |
void | atomic_dec (atomic_t *counter) |
decrement atomic counter without interruption. More... | |
__asm__ ("\.text\.globl _atomic_dec\ _atomic_dec:\ stc ccr, r1h\ orc #0x80, ccr\ mov.b @r0, r1l\ dec r1l\ mov.b r1l, @r0\ ldc r1h, ccr\ rts\") | |
__asm__ | ( | "\ext\lobl _atomic_inc\atomic_inc:\tc | 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\" | |||
) |
Referenced by dbutton(), disable_irqs(), enable_irqs(), lcd_clear(), lcd_hide(), lcd_show(), power_init(), power_off(), sound_playing(), and sound_system().
__asm__ | ( | "\ext\lobl _atomic_dec\atomic_dec:\tc | ccr, |
r1h\ orc # | 0x80, | ||
ccr\ mov.b @ | r0, | ||
r1l\ dec r1l\ mov.b | r1l, | ||
@r0\ ldc | r1h, | ||
ccr\ rts\" | |||
) |
void atomic_dec | ( | atomic_t * | counter | ) |
decrement atomic counter without interruption.
locks interrupts except NMI, decrements count then restores interrupts.
counter | the counter resource to be decremented |
void atomic_inc | ( | atomic_t * | counter | ) |
increment atomic counter without interruption.
locks interrupts except NMI, increments count then restores interrupts.
counter | the counter resource to be incremented |
Referenced by sem_post().
brickOS is released under the
Mozilla Public License.
Original code copyright 1998-2005 by the authors. |