aboutsummaryrefslogtreecommitdiff
path: root/lib/arm64
diff options
context:
space:
mode:
Diffstat (limited to 'lib/arm64')
-rw-r--r--lib/arm64/assemble.h2
-rw-r--r--lib/arm64/jump-patch.h5
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/arm64/assemble.h b/lib/arm64/assemble.h
index 42c0f0c..c4fb487 100644
--- a/lib/arm64/assemble.h
+++ b/lib/arm64/assemble.h
@@ -46,7 +46,7 @@ static inline void LDRxi(void **codep, int Rt, int Rn, uint32_t off,
}
static inline void ADRP_ADD(void **codep, int reg, uint64_t pc, uint64_t dpc) {
- uintptr_t diff = (dpc & ~0xfff) - (pc & ~0xfff);
+ uint64_t diff = (dpc & ~0xfff) - (pc & ~0xfff);
/* ADRP reg, dpc */
op32(codep, 0x90000000 | reg | (diff & 0x3000) << 17 | (diff & 0x1ffffc000) >> 9);
uint32_t lo = dpc & 0xfff;
diff --git a/lib/arm64/jump-patch.h b/lib/arm64/jump-patch.h
index 5a44174..fe36d14 100644
--- a/lib/arm64/jump-patch.h
+++ b/lib/arm64/jump-patch.h
@@ -1,8 +1,9 @@
#pragma once
#include "arm64/assemble.h"
#define MAX_JUMP_PATCH_SIZE 20
+#define MAX_EXTENDED_PATCH_SIZE MAX_JUMP_PATCH_SIZE
-static inline int jump_patch_size(uintptr_t pc, uintptr_t dpc,
+static inline int jump_patch_size(uint_tptr pc, uint_tptr dpc,
UNUSED struct arch_dis_ctx arch,
bool force) {
intptr_t diff = (dpc & ~0xfff) - (pc & ~0xfff);
@@ -14,7 +15,7 @@ static inline int jump_patch_size(uintptr_t pc, uintptr_t dpc,
return 12;
}
-static inline void make_jump_patch(void **codep, uintptr_t pc, uintptr_t dpc,
+static inline void make_jump_patch(void **codep, uint_tptr pc, uint_tptr dpc,
struct arch_dis_ctx arch) {
int reg = arm64_get_unwritten_temp_reg(&arch);
intptr_t diff = (dpc & ~0xfff) - (pc & ~0xfff);