diff options
author | Stefan Weil <sw@weilnetz.de> | 2012-04-06 22:26:15 +0200 |
---|---|---|
committer | Blue Swirl <blauwirbel@gmail.com> | 2012-04-07 11:27:45 +0000 |
commit | 6375e09e79964fa6eac3e8426d25c8b759185482 (patch) | |
tree | a2976fe6b7f9b3b6336e6a15f6ad2680afd08c35 /exec.c | |
parent | 760e141613f5f7c09f5c141658f1e7c23b4a5c33 (diff) |
w64: Fix data type of tb_next and other variables used for host addresses
QEMU host addresses must use uintptr_t to be portable for hosts with
an unusual size of long (w64).
tb_jmp_offset is an uint16_t value, therefore the local variable offset
in function tb_set_jmp_target was changed from unsigned long to uint16_t.
The type cast to long in function tb_add_jump now also uses uintptr_t.
For the bit operation used here, the signedness of the type cast does
not matter.
Some remaining unsigned long values are either only used for ARM assembler
code or will be fixed in a later patch for PPC.
v2:
Fix signature of tb_find_pc in exec.c, too (hint from Blue Swirl, thanks).
There remain lots of other long / unsigned long in exec.c which must be
replaced by uintptr_t. This will be done in a separate patch. Here
only one of these type casts is fixed.
v3:
Also fix signature of page_unprotect.
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'exec.c')
-rw-r--r-- | exec.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -1380,7 +1380,7 @@ void tb_link_page(TranslationBlock *tb, /* find the TB 'tb' such that tb[0].tc_ptr <= tc_ptr < tb[1].tc_ptr. Return NULL if not found */ -TranslationBlock *tb_find_pc(unsigned long tc_ptr) +TranslationBlock *tb_find_pc(uintptr_t tc_ptr) { int m_min, m_max, m; unsigned long v; @@ -2502,7 +2502,7 @@ int page_check_range(target_ulong start, target_ulong len, int flags) /* called from signal handler: invalidate the code and unprotect the page. Return TRUE if the fault was successfully handled. */ -int page_unprotect(target_ulong address, unsigned long pc, void *puc) +int page_unprotect(target_ulong address, uintptr_t pc, void *puc) { unsigned int prot; PageDesc *p; @@ -4484,7 +4484,7 @@ void cpu_io_recompile(CPUArchState *env, void *retaddr) target_ulong pc, cs_base; uint64_t flags; - tb = tb_find_pc((unsigned long)retaddr); + tb = tb_find_pc((uintptr_t)retaddr); if (!tb) { cpu_abort(env, "cpu_io_recompile: could not find TB for pc=%p", retaddr); |