Commit d1db4961 by Jim Wilson

(INITIALIZE_TRAMPOLINE): Delete #ifndef/#endif.

(INITIALIZE_TRAMPOLINE): Delete #ifndef/#endif.  Change
function name from __enable_execute_stack to __gcc_flush_cache.
(TRANSFER_FROM_TRAMPOLINE): Likewise.  Delete code calling
mprotect.  Uncomment code calling cacheflush.

From-SVN: r5614
parent 40811d84
...@@ -1982,45 +1982,28 @@ typedef struct mips_args { ...@@ -1982,45 +1982,28 @@ typedef struct mips_args {
RTX for the static chain value that should be passed to the RTX for the static chain value that should be passed to the
function when it is called. */ function when it is called. */
#ifndef INITIALIZE_TRAMPOLINE
#define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \ #define INITIALIZE_TRAMPOLINE(ADDR, FUNC, CHAIN) \
{ \ { \
rtx addr = ADDR; \ rtx addr = ADDR; \
emit_move_insn (gen_rtx (MEM, SImode, plus_constant (addr, 28)), FUNC); \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (addr, 28)), FUNC); \
emit_move_insn (gen_rtx (MEM, SImode, plus_constant (addr, 32)), CHAIN); \ emit_move_insn (gen_rtx (MEM, SImode, plus_constant (addr, 32)), CHAIN); \
\ \
/* Attempt to make stack executable */ \ /* Flush the instruction cache. */ \
emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__enable_execute_stack"), \ emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "__gcc_flush_cache"), \
0, VOIDmode, 1, addr, Pmode); \ 0, VOIDmode, 1, addr, Pmode); \
} }
#endif /* INITIALIZE_TRAMPOLINE */
/* Flush the instruction cache. */
/* Attempt to turn on access permissions for the stack. */
#ifndef TRANSFER_FROM_TRAMPOLINE
#define TRANSFER_FROM_TRAMPOLINE \ #define TRANSFER_FROM_TRAMPOLINE \
\ \
void \ void \
__enable_execute_stack (addr) \ __gcc_flush_cache (addr) \
char *addr; \ char *addr; \
{ \ { \
int size = getpagesize (); \
int mask = ~(size-1); \
char *page = (char *) (((int) addr) & mask); \
char *end = (char *) ((((int) (addr + TRAMPOLINE_SIZE)) & mask) + size); \
\
/* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ \
if (mprotect (page, end - page, 7) < 0) \
perror ("mprotect of trampoline code"); \
\
/* \
if (cacheflush (addr, TRAMPOLINE_SIZE, 1) < 0) \ if (cacheflush (addr, TRAMPOLINE_SIZE, 1) < 0) \
perror ("cacheflush of trampoline code"); \ perror ("cacheflush of trampoline code"); \
*/ \
} }
#endif /* TRANSFER_FROM_TRAMPOLINE */
/* Addressing modes, and classification of registers for them. */ /* Addressing modes, and classification of registers for them. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment