Main Page
Related Pages
Modules
Classes
Files
File List
File Members
atomic.c
Go to the documentation of this file.
1
#include "
config.h
"
2
#include <
atomic.h
>
3
4
#ifdef CONF_ATOMIC
5
12
void
atomic_inc
(
atomic_t
* counter);
13
__asm__
(
"\n\
14
.text\n\
15
.globl _atomic_inc\n\
16
_atomic_inc:\n\
17
stc ccr, r1h ; save flags\n\
18
orc #0x80, ccr ; disable all but NMI\n\
19
mov.b @r0, r1l\n\
20
inc r1l\n\
21
mov.b r1l, @r0\n\
22
ldc r1h, ccr ; restore flags\n\
23
rts\n\
24
"
);
25
33
void
atomic_dec
(
atomic_t
* counter);
34
__asm__
(
"\n\
35
.text\n\
36
.globl _atomic_dec\n\
37
_atomic_dec:\n\
38
stc ccr, r1h\n\
39
orc #0x80, ccr\n\
40
mov.b @r0, r1l\n\
41
dec r1l\n\
42
mov.b r1l, @r0\n\
43
ldc r1h, ccr\n\
44
rts\n\
45
"
);
46
#endif
brickOS
is released under the
Mozilla Public License
.
Original code copyright 1998-2005 by the authors.
Generated on Sat Mar 15 2014 11:28:21 for brickOS Kernel Developer by
1.8.1.2