summaryrefslogtreecommitdiff
path: root/translate-all.c
diff options
context:
space:
mode:
authorStefan Weil <sw@weilnetz.de>2012-04-06 22:26:15 +0200
committerBlue Swirl <blauwirbel@gmail.com>2012-04-07 11:27:45 +0000
commit6375e09e79964fa6eac3e8426d25c8b759185482 (patch)
treea2976fe6b7f9b3b6336e6a15f6ad2680afd08c35 /translate-all.c
parent760e141613f5f7c09f5c141658f1e7c23b4a5c33 (diff)
downloadqemu-6375e09e79964fa6eac3e8426d25c8b759185482.tar.gz
qemu-6375e09e79964fa6eac3e8426d25c8b759185482.tar.bz2
qemu-6375e09e79964fa6eac3e8426d25c8b759185482.zip
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 'translate-all.c')
-rw-r--r--translate-all.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/translate-all.c b/translate-all.c
index 8c7d303d86..5bd2d3711a 100644
--- a/translate-all.c
+++ b/translate-all.c
@@ -109,11 +109,11 @@ int cpu_gen_code(CPUArchState *env, TranslationBlock *tb, int *gen_code_size_ptr
/* The cpu state corresponding to 'searched_pc' is restored.
*/
int cpu_restore_state(TranslationBlock *tb,
- CPUArchState *env, unsigned long searched_pc)
+ CPUArchState *env, uintptr_t searched_pc)
{
TCGContext *s = &tcg_ctx;
int j;
- unsigned long tc_ptr;
+ uintptr_t tc_ptr;
#ifdef CONFIG_PROFILER
int64_t ti;
#endif
@@ -133,7 +133,7 @@ int cpu_restore_state(TranslationBlock *tb,
}
/* find opc index corresponding to search_pc */
- tc_ptr = (unsigned long)tb->tc_ptr;
+ tc_ptr = (uintptr_t)tb->tc_ptr;
if (searched_pc < tc_ptr)
return -1;