aboutsummaryrefslogtreecommitdiff
path: root/lib/arm64/jump-patch.h
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arm64/jump-patch.h')
-rw-r--r--lib/arm64/jump-patch.h8
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);