about summary refs log tree commit diff
path: root/sysdeps/arm/nacl/sysdep.h
blob: 951df3215d1150d3c8abcdbd7e96e1bc2adc52e1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/* Assembler macros for ARM/NaCl.
   Copyright (C) 2015 Free Software Foundation, Inc.
   This file is part of the GNU C Library.

   The GNU C Library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
   License as published by the Free Software Foundation; either
   version 2.1 of the License, or (at your option) any later version.

   The GNU C Library is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library.  If not, see
   <http://www.gnu.org/licenses/>.  */

#ifndef _ARM_NACL_SYSDEP_H
#define _ARM_NACL_SYSDEP_H	1

#ifdef __ASSEMBLER__

# ifndef NO_THUMB
#  define NO_THUMB
# endif
# define ARM_SFI_MACROS		1

/* The compiler driver primes the assembler with a standard set of
   macros that includes sfi_breg and sfi_sp.  The sfi_pld macro is
   redundant with sfi_breg, but libc code uses it so as not to run
   afoul of the assembler's parsing bug in versions prior to 2.23.2.
   NaCl never uses an assembler that has this bug.  */

.macro sfi_pld basereg, offset=#0
	sfi_breg \basereg, pld [\basereg, \offset]
.endm

#endif

#include <sysdeps/arm/sysdep.h>

#ifdef  __ASSEMBLER__

# undef eabi_fnstart
# define eabi_fnstart
# undef eabi_fnend
# define eabi_fnend
# undef eabi_save
# define eabi_save(...)
# undef eabi_cantunwind
# define eabi_cantunwind
# undef eabi_pad
# define eabi_pad(n)

/* NaCl has its own special way of getting the thread pointer.  */
# undef	GET_TLS
# define GET_TLS(tmp)		ldr r0, [r9]

/* Rather than macroizing the code any more, we can just define a few
   mnemonics as macros here.  */
# define bl			sfi_bl
# define bx			sfi_bx
# define blx			sfi_blx
# define bxeq			sfi_bxeq /* Only condition now in use.  */

#endif  /* __ASSEMBLER__ */

#endif  /* sysdep.h */