From f1a1f3c642ac9d4909eceb48c6c4d749224912c6 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Mon, 22 Apr 2019 07:09:55 -0400 Subject: [PATCH] cpu_ldst_template.h: Use ld*_p directly rather than via ld*_raw macros The ld*_raw and st*_raw macros are now only used within the code produced by cpu_ldst_template.h, and only in three places. Expand these out to just call the ld_p and st_p functions directly. Note that in all the callsites the address argument is a uintptr_t, so we can drop that part of the double-cast used in the saddr() and laddr() macros. Backports commit 355392329e4a843580e53cb027ed85e0cbebb640 from qemu --- qemu/include/exec/cpu_ldst_template.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qemu/include/exec/cpu_ldst_template.h b/qemu/include/exec/cpu_ldst_template.h index 4e4342c1..a98daf2b 100644 --- a/qemu/include/exec/cpu_ldst_template.h +++ b/qemu/include/exec/cpu_ldst_template.h @@ -92,7 +92,7 @@ glue(glue(glue(cpu_ld, USUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, oi, retaddr); } else { uintptr_t hostaddr = (uintptr_t)(addr + entry->addend); - res = glue(glue(ld, USUFFIX), _raw)(hostaddr); + res = glue(glue(ld, USUFFIX), _p)((uint8_t *)hostaddr); } return res; } @@ -125,7 +125,7 @@ glue(glue(glue(cpu_lds, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, MMUSUFFIX)(env, addr, oi, retaddr); } else { uintptr_t hostaddr = (uintptr_t)(addr + entry->addend); - res = glue(glue(lds, SUFFIX), _raw)(hostaddr); + res = glue(glue(lds, SUFFIX), _p)((uint8_t *)hostaddr); } return res; } @@ -160,7 +160,7 @@ glue(glue(glue(cpu_st, SUFFIX), MEMSUFFIX), _ra)(CPUArchState *env, retaddr); } else { uintptr_t hostaddr = (uintptr_t)(addr + entry->addend); - glue(glue(st, SUFFIX), _raw)(hostaddr, v); + glue(glue(st, SUFFIX), _p)((uint8_t *)hostaddr, v); } }