Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

kernel/atomic.c File Reference

#include "config.h"
#include <atomic.h>

Include dependency graph for atomic.c:

Include dependency graph

Go to the source code of this file.

Functions

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.

 __asm__ ("\n\.text\n\.globl _atomic_dec\n\_atomic_dec:\n\stc ccr, r1h\n\orc#0x80, ccr\n\mov.b @r0, r1l\n\dec r1l\n\mov.b r1l,@r0\n\ldc r1h, ccr\n\rts\n\")


Function Documentation

__asm__ "\n\.text\n\.globl _atomic_dec\n\_atomic_dec:\n\stc  ccr,
r1h\n\orc#  0x80,
ccr\n\mov.b @  r0,
r1l\n\dec r1l\n\mov.b  r1l,
@r0\n\ldc  r1h,
ccr\n\rts\n\" 
 

__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\" 
 

Referenced by dbutton(), disable_irqs(), enable_irqs(), lcd_clear(), lcd_hide(), lcd_show(), power_init(), power_off(), sound_playing(), and sound_system().

void atomic_dec atomic_t counter  ) 
 

decrement atomic counter without interruption.

locks interrupts except NMI, decrements count then restores interrupts.

Parameters:
counter the counter resource to be decremented
See also:
atomic_inc

void atomic_inc atomic_t counter  ) 
 

increment atomic counter without interruption.

locks interrupts except NMI, increments count then restores interrupts.

Parameters:
counter the counter resource to be incremented
See also:
atomic_dec


brickOS is released under the Mozilla Public License.
Original code copyright 1998-2002 by the authors.

Generated on Mon Feb 16 21:02:26 2004 for brickOS Kernel Developer by doxygen 1.3.5