From 163d9996179cb12fb53a3f0d6f2a9447ea1c4303 Mon Sep 17 00:00:00 2001 From: Kresten Krab Thorup Date: Wed, 22 Sep 1993 17:45:18 +0000 Subject: [PATCH] (INITIALIZE_TRAMPOLINE): Append call to __enable_execute_stack. (INITIALIZE_TRAMPOLINE): Append call to __enable_execute_stack. (CLEAR_INSN_CACHE): New macro. From-SVN: r5395 --- gcc/config/m68k/next.h | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/gcc/config/m68k/next.h b/gcc/config/m68k/next.h index 845bf7c1b93..55891b403a9 100644 --- a/gcc/config/m68k/next.h +++ b/gcc/config/m68k/next.h @@ -181,3 +181,26 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define OBJC_FORWARDING_STACK_OFFSET 8 #define OBJC_FORWARDING_MIN_OFFSET 8 + +/* INITIALIZE_TRAMPOLINE is changed so that it also enables executable + stack. The __enable_execute_stack also clears the insn cache. */ + +/* NOTE: part of this is copied from m68k.h */ +#undef INITIALIZE_TRAMPOLINE +#define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ +{ \ + rtx _addr, _func; \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 2)), TRAMP); \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 18)), CXT); \ + emit_move_insn (gen_rtx (MEM, SImode, plus_constant (TRAMP, 22)), FNADDR); \ + _addr = memory_address (SImode, (TRAMP)); \ + _func = gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"); \ + emit_library_call (_func, 0, VOIDmode, 1, _addr, Pmode); \ +} + +/* A C expression used to clear the instruction cache from + address BEG to address END. On NeXTSTEP this i a system trap. */ + +#define CLEAR_INSN_CACHE(BEG, END) \ + asm volatile ("trap #2") + -- 2.30.2