From d9b6cb97a8a9e93f1bbe5351874b03f7faa81783 Mon Sep 17 00:00:00 2001 From: David 'Digit' Turner Date: Wed, 20 Oct 2010 19:07:28 +0200 Subject: Fix linux-x86_64 build. Fix various 64-bitness issues in the source code to make the --try-64 option work again on Linux. Note that the generated binary is not faster than its 32-bit variant when it comes to benchmarking the boot sequence. Change-Id: Iad248e033757d4cd25524a438a5dbe1cf3aca6cf --- memcheck/memcheck_api.h | 2 +- memcheck/memcheck_common.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'memcheck') diff --git a/memcheck/memcheck_api.h b/memcheck/memcheck_api.h index 1961465..9e76ecd 100644 --- a/memcheck/memcheck_api.h +++ b/memcheck/memcheck_api.h @@ -43,7 +43,7 @@ extern int memcheck_watch_call_stack; * array is used to obtain guest PC address from a translated PC address. * tcg_gen_code_common will fill it up when memchecker is enabled. The array is * declared in ./translate_all.c */ -extern target_ulong* gen_opc_tpc2gpc_ptr; +extern void** gen_opc_tpc2gpc_ptr; /* Number of (tb_pc, guest_pc) pairs stored in gen_opc_tpc2gpc array. * The variable is declared in ./translate_all.c */ diff --git a/memcheck/memcheck_common.h b/memcheck/memcheck_common.h index 668b78c..e6d12db 100644 --- a/memcheck/memcheck_common.h +++ b/memcheck/memcheck_common.h @@ -125,7 +125,7 @@ typedef struct MallocDesc { /* Helpers for addressing field in MallocDesc structure, using which emulator * reports an error back to the guest. */ -#define ALLOC_RES_OFFSET ((uint32_t)&(((MallocDesc*)0)->libc_pid)) +#define ALLOC_RES_OFFSET ((uint32_t)(ptrdiff_t)&(((MallocDesc*)0)->libc_pid)) #define ALLOC_RES_ADDRESS(p) (p + ALLOC_RES_OFFSET) /* Describes memory block info queried from emulator. This structure is passed @@ -174,7 +174,7 @@ typedef struct MallocDescQuery { /* Helpers for addressing field in MallocDescQuery structure using which * emulator reports an error back to the guest. */ -#define QUERY_RES_OFFSET ((uint32_t)&(((MallocDescQuery*)0)->libc_pid)) +#define QUERY_RES_OFFSET ((uint32_t)(ptrdiff_t)&(((MallocDescQuery*)0)->libc_pid)) #define QUERY_RES_ADDRESS(p) (p + QUERY_RES_OFFSET) /* Describes memory block that is being freed back to the heap. This structure @@ -201,7 +201,7 @@ typedef struct MallocFree { /* Helpers for addressing field in MallocFree structure, using which emulator * reports an error back to the guest. */ -#define FREE_RES_OFFSET ((uint32_t)&(((MallocFree*)0)->libc_pid)) +#define FREE_RES_OFFSET ((uint32_t)(ptrdiff_t)&(((MallocFree*)0)->libc_pid)) #define FREE_RES_ADDRESS(p) (p + FREE_RES_OFFSET) /* Extends MallocDesc structure with additional information, used by memchecker. -- cgit v1.1