From afcc28b2f12eef886df971bee0adc62f284655e7 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Mon, 17 May 1993 17:46:45 +0000 Subject: [PATCH] (INITIALIZE_TRAMPOLINE): Pass both the starting and ending addresses of the trampoline to the cacheflush pattern. From-SVN: r4484 --- gcc/config/pa/pa.h | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/gcc/config/pa/pa.h b/gcc/config/pa/pa.h index 84ebc373281..ef9e305970b 100644 --- a/gcc/config/pa/pa.h +++ b/gcc/config/pa/pa.h @@ -979,8 +979,13 @@ extern union tree_node *current_function_decl; } /* Length in units of the trampoline for entering a nested function. - If this grows to > 32 bytes, then you must update the flushcache - pattern in pa.md. */ + + Flush the cache entries corresponding to the first and last addresses + of the trampoline. This is necessary as the trampoline may cross two + cache lines. + + If the trampoline ever grows to > 32 bytes, then it will become + necessary to hack on the cacheflush pattern in pa.md. */ #define TRAMPOLINE_SIZE (5 * 4) @@ -993,16 +998,17 @@ extern union tree_node *current_function_decl; #define INITIALIZE_TRAMPOLINE(TRAMP, FNADDR, CXT) \ { \ - rtx addr, mem; \ + rtx start_addr, end_addr, mem; \ \ - addr = memory_address (Pmode, plus_constant ((TRAMP), 12)); \ - emit_move_insn (gen_rtx (MEM, Pmode, addr), (FNADDR)); \ - addr = memory_address (Pmode, plus_constant ((TRAMP), 16)); \ - emit_move_insn (gen_rtx (MEM, Pmode, addr), (CXT)); \ + start_addr = memory_address (Pmode, plus_constant ((TRAMP), 12));\ + emit_move_insn (gen_rtx (MEM, Pmode, start_addr), (FNADDR)); \ + start_addr = memory_address (Pmode, plus_constant ((TRAMP), 16));\ + emit_move_insn (gen_rtx (MEM, Pmode, start_addr), (CXT)); \ /* fdc and fic only use registers for the address to flush, \ they do not accept integer displacements. */ \ - addr = force_reg (SImode, (TRAMP)); \ - emit_insn (gen_cacheflush (addr)); \ + start_addr = force_reg (SImode, (TRAMP)); \ + end_addr = force_reg (SImode, plus_constant (start_addr, TRAMPOLINE_SIZE));\ + emit_insn (gen_cacheflush (start_addr, end_addr)); \ } /* Emit code for a call to builtin_saveregs. We must emit USE insns which -- 2.30.2