mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-07 17:53:56 -06:00
tcg: Change relocation offsets to intptr_t
Reviewed-by: Aurelien Jarno <aurelien@aurel32.net> Signed-off-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
2f2f244d02
commit
2ba7fae29e
13 changed files with 40 additions and 39 deletions
|
@ -668,16 +668,16 @@ static inline uint64_t tcg_opc_x3(int qp, uint64_t opc, uint64_t imm)
|
|||
* Relocations
|
||||
*/
|
||||
|
||||
static inline void reloc_pcrel21b (void *pc, tcg_target_long target)
|
||||
static inline void reloc_pcrel21b(void *pc, intptr_t target)
|
||||
{
|
||||
uint64_t imm;
|
||||
int64_t disp;
|
||||
int slot;
|
||||
|
||||
slot = (tcg_target_long) pc & 3;
|
||||
pc = (void *)((tcg_target_long) pc & ~3);
|
||||
slot = (intptr_t)pc & 3;
|
||||
pc = (void *)((intptr_t)pc & ~3);
|
||||
|
||||
disp = target - (tcg_target_long) pc;
|
||||
disp = target - (intptr_t)pc;
|
||||
imm = (uint64_t) disp >> 4;
|
||||
|
||||
switch(slot) {
|
||||
|
@ -728,12 +728,12 @@ static inline uint64_t get_reloc_pcrel21b (void *pc)
|
|||
}
|
||||
}
|
||||
|
||||
static inline void reloc_pcrel60b (void *pc, tcg_target_long target)
|
||||
static inline void reloc_pcrel60b(void *pc, intptr_t target)
|
||||
{
|
||||
int64_t disp;
|
||||
uint64_t imm;
|
||||
|
||||
disp = target - (tcg_target_long) pc;
|
||||
disp = target - (intptr_t)pc;
|
||||
imm = (uint64_t) disp >> 4;
|
||||
|
||||
*(uint64_t *)(pc + 8) = (*(uint64_t *)(pc + 8) & 0xf700000fff800000ull)
|
||||
|
@ -759,7 +759,7 @@ static inline uint64_t get_reloc_pcrel60b (void *pc)
|
|||
|
||||
|
||||
static void patch_reloc(uint8_t *code_ptr, int type,
|
||||
tcg_target_long value, tcg_target_long addend)
|
||||
intptr_t value, intptr_t addend)
|
||||
{
|
||||
value += addend;
|
||||
switch (type) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue