]> git.ipfire.org Git - thirdparty/glibc.git/blob - sysdeps/arm/nacl/sysdep.h
Add arm-nacl port.
[thirdparty/glibc.git] / sysdeps / arm / nacl / sysdep.h
1 /* Assembler macros for ARM/NaCl.
2 Copyright (C) 2015 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
4
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library. If not, see
17 <http://www.gnu.org/licenses/>. */
18
19 #ifndef _ARM_NACL_SYSDEP_H
20 #define _ARM_NACL_SYSDEP_H 1
21
22 #ifdef __ASSEMBLER__
23
24 # ifndef NO_THUMB
25 # define NO_THUMB
26 # endif
27 # define ARM_SFI_MACROS 1
28
29 /* The compiler driver primes the assembler with a standard set of
30 macros that includes sfi_breg and sfi_sp. The sfi_pld macro is
31 redundant with sfi_breg, but libc code uses it so as not to run
32 afoul of the assembler's parsing bug in versions prior to 2.23.2.
33 NaCl never uses an assembler that has this bug. */
34
35 .macro sfi_pld basereg, offset=#0
36 sfi_breg \basereg, pld [\basereg, \offset]
37 .endm
38
39 #endif
40
41 #include <sysdeps/arm/sysdep.h>
42
43 #ifdef __ASSEMBLER__
44
45 # undef eabi_fnstart
46 # define eabi_fnstart
47 # undef eabi_fnend
48 # define eabi_fnend
49 # undef eabi_save
50 # define eabi_save(...)
51 # undef eabi_cantunwind
52 # define eabi_cantunwind
53 # undef eabi_pad
54 # define eabi_pad(n)
55
56 /* NaCl has its own special way of getting the thread pointer. */
57 # undef GET_TLS
58 # define GET_TLS(tmp) ldr r0, [r9]
59
60 /* Rather than macroizing the code any more, we can just define a few
61 mnemonics as macros here. */
62 # define bl sfi_bl
63 # define bx sfi_bx
64 # define blx sfi_blx
65 # define bxeq sfi_bxeq /* Only condition now in use. */
66
67 #endif /* __ASSEMBLER__ */
68
69 #endif /* sysdep.h */