]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/l4sys/lib/src/ARCH-arm/atomic_ops_s.S
update
[l4.git] / l4 / pkg / l4sys / lib / src / ARCH-arm / atomic_ops_s.S
1 /*
2  * (c) 2008-2010 Adam Lackorzynski <adam@os.inf.tu-dresden.de>,
3  *               Alexander Warg <warg@os.inf.tu-dresden.de>
4  *     economic rights: Technische Universität Dresden (Germany)
5  *
6  * This file is part of TUD:OS and distributed under the terms of the
7  * GNU General Public License 2.
8  * Please see the COPYING-GPL-2 file for details.
9  *
10  * As a special exception, you may use this file as part of a free software
11  * library without restriction.  Specifically, if other files instantiate
12  * templates or use macros or inline functions from this file, or you compile
13  * this file and link it with other files to produce an executable, this
14  * file does not by itself cause the resulting executable to be covered by
15  * the GNU General Public License.  This exception does not however
16  * invalidate any other reasons why the executable file might be covered by
17  * the GNU General Public License.
18  */
19 #if 0
20 #define ABS_FUNC(s,value) \
21 .global s;          \
22 .type s, #function; \
23 .size s, 12;        \
24 s = value
25
26 ABS_FUNC(l4_atomic_add,     0xffffe000)
27 ABS_FUNC(l4_atomic_cmpxchg, 0xffffe100)
28 ABS_FUNC(l4_atomic_xchg,    0xffffe200)
29
30 #else
31
32 /* Using the above gives problems when using it in shared libs
33  * due to relocation which actually shouldn't happen */
34
35 #define JUMP_CODE(name)                 \
36         .global name;                   \
37         .type name, #function;          \
38         .size name, 12;                 \
39         name:                           \
40                 ldr     pc, .LC##name;  \
41                 /* Will return to our caller */
42
43 JUMP_CODE(l4_atomic_add)
44 JUMP_CODE(l4_atomic_cmpxchg)
45 JUMP_CODE(l4_atomic_xchg)
46         
47
48 .LCl4_atomic_add:         .word 0xffffe000
49 .LCl4_atomic_cmpxchg:     .word 0xffffe100
50 .LCl4_atomic_xchg:        .word 0xffffe200
51 #endif