From: Taylor R Campbell Date: Fri, 25 Jan 2019 04:35:12 +0000 (+0000) Subject: No need for a separate function here. X-Git-Tag: mit-scheme-pucked-10.1.20~11^2~66^2~16 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=b10c049480db221855647dd70fd9300896c08e8a;p=mit-scheme.git No need for a separate function here. --- diff --git a/src/microcode/cmpintmd/aarch64.c b/src/microcode/cmpintmd/aarch64.c index af2c6f3b5..2baebfe3d 100644 --- a/src/microcode/cmpintmd/aarch64.c +++ b/src/microcode/cmpintmd/aarch64.c @@ -244,11 +244,26 @@ read_uuo_target_no_reloc (SCHEME_OBJECT * saddr) return (read_uuo_target (saddr)); } -static void -write_uuo_insns (insn_t * target, insn_t * iaddr, int pcrel) +void +write_uuo_target (insn_t * target, SCHEME_OBJECT * saddr) { - /* ldr x1, pc-pcrel */ - (iaddr[0]) = (0x58000001UL | ((((unsigned) pcrel) & 0x7ffff) << 5)); + insn_t * iaddr; + int ioff; + + /* Set the target. */ + (saddr[0]) = ((SCHEME_OBJECT) target); + + /* Determine where the instructions start relative where we store the + target. */ +#ifdef WORDS_BIGENDIAN + ioff = 2; +#else + ioff = 3; +#endif + iaddr = (((insn_t *) saddr) + ioff); + + /* ldr x1, PC-ioff */ + (iaddr[0]) = (0x58000001UL | ((((unsigned) ioff) & 0x7ffff) << 5)); /* If the target PC is right after the target offset, then the PC requires no further relocation and we can jump to a fixed address. @@ -305,23 +320,6 @@ write_uuo_insns (insn_t * target, insn_t * iaddr, int pcrel) (iaddr[4]) = 0xd61f0220UL; /* br x17 */ } } - -void -write_uuo_target (insn_t * target, SCHEME_OBJECT * saddr) -{ - insn_t * iaddr; - int ioff; - -#ifdef WORDS_BIGENDIAN - ioff = 2; -#else - ioff = 3; -#endif - - (saddr[0]) = ((SCHEME_OBJECT) target); - iaddr = (((insn_t *) saddr) + ioff); - write_uuo_insns (target, iaddr, -ioff); -} #define TRAMPOLINE_ENTRY_PADDING_SIZE 1 #define OBJECTS_PER_TRAMPOLINE_ENTRY 4