diff options
Diffstat (limited to 'contrib/gcc/config/arm/netbsd.h')
-rw-r--r-- | contrib/gcc/config/arm/netbsd.h | 54 |
1 files changed, 42 insertions, 12 deletions
diff --git a/contrib/gcc/config/arm/netbsd.h b/contrib/gcc/config/arm/netbsd.h index 2be49d8..38ccc3f 100644 --- a/contrib/gcc/config/arm/netbsd.h +++ b/contrib/gcc/config/arm/netbsd.h @@ -44,16 +44,22 @@ Boston, MA 02111-1307, USA. */ /* Some defines for CPP. arm32 is the NetBSD port name, so we always define arm32 and __arm32__. */ -#undef CPP_PREDEFINES -#define CPP_PREDEFINES "\ --Dunix -Driscbsd -Darm32 -D__arm32__ -D__arm__ -D__NetBSD__ \ --Asystem=unix -Asystem=NetBSD" +#define TARGET_OS_CPP_BUILTINS() \ + do { \ + NETBSD_OS_CPP_BUILTINS_AOUT(); \ + builtin_define_std ("arm32"); \ + builtin_define_std ("unix"); \ + builtin_define_std ("riscbsd"); \ + } while (0) + +#undef SUBTARGET_EXTRA_SPECS +#define SUBTARGET_EXTRA_SPECS \ + { "netbsd_cpp_spec", NETBSD_CPP_SPEC }, \ + { "netbsd_link_spec", NETBSD_LINK_SPEC_AOUT }, -/* Define _POSIX_SOURCE if necessary. */ #undef CPP_SPEC #define CPP_SPEC "\ -%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) %(cpp_endian) \ -%{posix:-D_POSIX_SOURCE} \ +%(cpp_cpu_arch) %(cpp_apcs_pc) %(cpp_float) %(cpp_endian) %(netbsd_cpp_spec) \ " /* Because TARGET_DEFAULT sets ARM_FLAG_APCS_32 */ @@ -66,10 +72,7 @@ Boston, MA 02111-1307, USA. */ /* Pass -X to the linker so that it will strip symbols starting with 'L' */ #undef LINK_SPEC -#define LINK_SPEC "\ --X %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{R*} \ -%{static:-Bstatic}} %{shared} %{assert*} \ -" +#define LINK_SPEC "-X %(netbsd_link_spec)" #undef SIZE_TYPE #define SIZE_TYPE "unsigned int" @@ -77,7 +80,7 @@ Boston, MA 02111-1307, USA. */ #undef PTRDIFF_TYPE #define PTRDIFF_TYPE "int" -#define HANDLE_SYSV_PRAGMA +#define HANDLE_SYSV_PRAGMA 1 /* We don't have any limit on the length as out debugger is GDB. */ #undef DBX_CONTIN_LENGTH @@ -142,3 +145,30 @@ Boston, MA 02111-1307, USA. */ requirements. */ #undef DEFAULT_STRUCTURE_SIZE_BOUNDARY #define DEFAULT_STRUCTURE_SIZE_BOUNDARY 8 + +/* Emit code to set up a trampoline and synchronize the caches. */ +#undef INITIALIZE_TRAMPOLINE +#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ +{ \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 8)), \ + (CXT)); \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant ((TRAMP), 12)), \ + (FNADDR)); \ + emit_library_call (gen_rtx_SYMBOL_REF (Pmode, "__clear_cache"), \ + 0, VOIDmode, 2, TRAMP, Pmode, \ + plus_constant (TRAMP, TRAMPOLINE_SIZE), Pmode); \ +} + +/* Clear the instruction cache from `BEG' to `END'. This makes a + call to the ARM32_SYNC_ICACHE architecture specific syscall. */ +#define CLEAR_INSN_CACHE(BEG, END) \ +{ \ + extern int sysarch(int number, void *args); \ + struct { \ + unsigned int addr; \ + int len; \ + } s; \ + s.addr = (unsigned int)(BEG); \ + s.len = (END) - (BEG); \ + (void)sysarch(0, &s); \ +} |