Prefer the address_space_ld/st API over the legacy ld_phys()
because it allow checking for bus access fault.

This code however doesn't check for fault, so we simply inline
the calls (not specifying any memory transaction attribute nor
expecting transation result) per the definition in
"system/memory_ldst_phys_endian.h.inc":

 27 static inline uint32_t LD_PHYS(l)(ARG1_DECL, hwaddr addr)
 28 {
 29     return ADDRESS_SPACE_LD(l)(ARG1, addr, MEMTXATTRS_UNSPECIFIED, NULL);
 30 }

 42 static inline void ST_PHYS(l)(ARG1_DECL, hwaddr addr, uint32_t val)
 43 {
 44     ADDRESS_SPACE_ST(l)(ARG1, addr, val, MEMTXATTRS_UNSPECIFIED, NULL);
 45 }

No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <[email protected]>
---
 hw/ppc/pegasos.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/hw/ppc/pegasos.c b/hw/ppc/pegasos.c
index 4217af25807..52e35949cc1 100644
--- a/hw/ppc/pegasos.c
+++ b/hw/ppc/pegasos.c
@@ -21,6 +21,7 @@
 #include "hw/ide/pci.h"
 #include "hw/i2c/smbus_eeprom.h"
 #include "hw/core/qdev-properties.h"
+#include "system/memory.h"
 #include "system/reset.h"
 #include "system/runstate.h"
 #include "system/qtest.h"
@@ -593,12 +594,12 @@ enum pegasos2_rtas_tokens {
 
 static uint32_t rtas_ldl(AddressSpace *as, hwaddr addr)
 {
-    return ldl_be_phys(as, addr);
+    return address_space_ldl(as, addr, MEMTXATTRS_UNSPECIFIED, NULL);
 }
 
 static void rtas_stl(AddressSpace *as, hwaddr addr, uint32_t value)
 {
-    stl_be_phys(as, addr, value);
+    address_space_stl(as, addr, value, MEMTXATTRS_UNSPECIFIED, NULL);
 }
 
 static target_ulong pegasos2_rtas(PowerPCCPU *cpu, PegasosMachineState *pm,
-- 
2.53.0


Reply via email to