diff options
author | comex | 2015-01-25 01:26:43 -0500 |
---|---|---|
committer | comex | 2015-01-25 01:26:43 -0500 |
commit | d3ea2155062131724c01d7f6727fdf90a4063b4d (patch) | |
tree | 6b3d4989b4f7ff9df464c8c18fffce488673274f /lib/arm64/jump-patch.h | |
parent | fixes (diff) | |
download | substitute-d3ea2155062131724c01d7f6727fdf90a4063b4d.tar.gz |
fixes
Diffstat (limited to 'lib/arm64/jump-patch.h')
-rw-r--r-- | lib/arm64/jump-patch.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/arm64/jump-patch.h b/lib/arm64/jump-patch.h index c42c730..aa818d3 100644 --- a/lib/arm64/jump-patch.h +++ b/lib/arm64/jump-patch.h @@ -3,20 +3,20 @@ #define MAX_JUMP_PATCH_SIZE 12 #define MAX_REWRITTEN_SIZE (7 * 2 * 4) /* also conservative */ static inline int jump_patch_size(uintptr_t pc, uintptr_t dpc, - struct arch_dis_ctx arch, + UNUSED struct arch_dis_ctx arch, bool force) { intptr_t diff = (dpc & ~0xfff) - (pc & ~0xfff); if (!(diff >= -0x100000000 && diff < 0x100000000)) return force ? 16 : -1; - else if (pc & 0xfff) + else if (!(dpc & 0xfff)) return 8; else return 12; } static inline void make_jump_patch(void **codep, uintptr_t pc, uintptr_t dpc, - struct arch_dis_ctx arch) { - int reg = 12; /* XXX */ + UNUSED struct arch_dis_ctx arch) { + int reg = 15; intptr_t diff = (dpc & ~0xfff) - (pc & ~0xfff); if (!(diff >= -0x100000000 && diff < 0x100000000)) MOVi64(codep, reg, dpc); |