From 23ddbf08bfe3cf3e9d6993bd7918b6c4339ba2bb Mon Sep 17 00:00:00 2001 From: Stefan Weil Date: Sun, 15 Apr 2012 21:02:09 +0200 Subject: softmmu: Use uintptr_t for physaddr and rename it Variable physaddr is a host address which should be represented by data type 'uintptr_t'. This is needed for w64 and changes nothing for other hosts. v2: Rename physaddr -> hostaddr (suggested by Blue Swirl). Signed-off-by: Stefan Weil --- softmmu_header.h | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'softmmu_header.h') diff --git a/softmmu_header.h b/softmmu_header.h index 6b72093a0..289dae2e5 100644 --- a/softmmu_header.h +++ b/softmmu_header.h @@ -99,7 +99,6 @@ glue(glue(glue(CPU_PREFIX, ld), USUFFIX), MEMSUFFIX)(ENV_PARAM int page_index; RES_TYPE res; target_ulong addr; - unsigned long physaddr; int mmu_idx; addr = ptr; @@ -111,8 +110,8 @@ glue(glue(glue(CPU_PREFIX, ld), USUFFIX), MEMSUFFIX)(ENV_PARAM addr, mmu_idx); } else { - physaddr = addr + env->tlb_table[mmu_idx][page_index].addend; - res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)physaddr); + uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend; + res = glue(glue(ld, USUFFIX), _raw)((uint8_t *)hostaddr); } return res; } @@ -124,7 +123,6 @@ glue(glue(glue(CPU_PREFIX, lds), SUFFIX), MEMSUFFIX)(ENV_PARAM { int res, page_index; target_ulong addr; - unsigned long physaddr; int mmu_idx; addr = ptr; @@ -135,8 +133,8 @@ glue(glue(glue(CPU_PREFIX, lds), SUFFIX), MEMSUFFIX)(ENV_PARAM res = (DATA_STYPE)glue(glue(glue(HELPER_PREFIX, ld), SUFFIX), MMUSUFFIX)(ENV_VAR addr, mmu_idx); } else { - physaddr = addr + env->tlb_table[mmu_idx][page_index].addend; - res = glue(glue(lds, SUFFIX), _raw)((uint8_t *)physaddr); + uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend; + res = glue(glue(lds, SUFFIX), _raw)((uint8_t *)hostaddr); } return res; } @@ -152,7 +150,6 @@ glue(glue(glue(CPU_PREFIX, st), SUFFIX), MEMSUFFIX)(ENV_PARAM target_ulong ptr, { int page_index; target_ulong addr; - unsigned long physaddr; int mmu_idx; addr = ptr; @@ -163,8 +160,8 @@ glue(glue(glue(CPU_PREFIX, st), SUFFIX), MEMSUFFIX)(ENV_PARAM target_ulong ptr, glue(glue(glue(HELPER_PREFIX, st), SUFFIX), MMUSUFFIX)(ENV_VAR addr, v, mmu_idx); } else { - physaddr = addr + env->tlb_table[mmu_idx][page_index].addend; - glue(glue(st, SUFFIX), _raw)((uint8_t *)physaddr, v); + uintptr_t hostaddr = addr + env->tlb_table[mmu_idx][page_index].addend; + glue(glue(st, SUFFIX), _raw)((uint8_t *)hostaddr, v); } } -- cgit v1.2.3