From d1e44df1fa5fefd8a083f6c1e909bbcdc97c6438 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Fri, 17 Apr 2015 09:02:19 -0700 Subject: Add arm-nacl port. --- sysdeps/arm/nacl/sysdep.h | 69 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 sysdeps/arm/nacl/sysdep.h (limited to 'sysdeps/arm/nacl/sysdep.h') diff --git a/sysdeps/arm/nacl/sysdep.h b/sysdeps/arm/nacl/sysdep.h new file mode 100644 index 0000000000..951df3215d --- /dev/null +++ b/sysdeps/arm/nacl/sysdep.h @@ -0,0 +1,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 + . */ + +#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 + +#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 */ -- cgit 1.4.1