[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [PATCH 13/15] system/physmem: Inline cpu_physical_memory_rw() and remove it
After inlining the legacy cpu_physical_memory_rw() in the 2 functions using it (cpu_physical_memory_read and cpu_physical_memory_write), we removed all its use: remove it. Signed-off-by: Philippe Mathieu-Daudé <philmd@xxxxxxxxxx> --- docs/devel/loads-stores.rst | 4 +--- scripts/coccinelle/exec_rw_const.cocci | 22 ---------------------- include/exec/cpu-common.h | 2 -- system/physmem.c | 13 ++++--------- 4 files changed, 5 insertions(+), 36 deletions(-) diff --git a/docs/devel/loads-stores.rst b/docs/devel/loads-stores.rst index f9b565da57a..c906c6509ee 100644 --- a/docs/devel/loads-stores.rst +++ b/docs/devel/loads-stores.rst @@ -460,10 +460,8 @@ For new code they are better avoided: ``cpu_physical_memory_write`` -``cpu_physical_memory_rw`` - Regexes for git grep: - - ``\<cpu_physical_memory_\(read\|write\|rw\)\>`` + - ``\<cpu_physical_memory_\(read\|write\)\>`` ``cpu_memory_rw_debug`` ~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/scripts/coccinelle/exec_rw_const.cocci b/scripts/coccinelle/exec_rw_const.cocci index 1a202969519..4c02c94e04e 100644 --- a/scripts/coccinelle/exec_rw_const.cocci +++ b/scripts/coccinelle/exec_rw_const.cocci @@ -21,13 +21,6 @@ expression E1, E2, E3, E4, E5; + address_space_rw(E1, E2, E3, E4, E5, true) | -- cpu_physical_memory_rw(E1, E2, E3, 0) -+ cpu_physical_memory_rw(E1, E2, E3, false) -| -- cpu_physical_memory_rw(E1, E2, E3, 1) -+ cpu_physical_memory_rw(E1, E2, E3, true) -| - - cpu_physical_memory_map(E1, E2, 0) + cpu_physical_memory_map(E1, E2, false) | @@ -62,18 +55,6 @@ symbol true, false; + address_space_write(E1, E2, E3, E4, E5) ) -// Avoid uses of cpu_physical_memory_rw() with a constant is_write argument. -@@ -expression E1, E2, E3; -@@ -( -- cpu_physical_memory_rw(E1, E2, E3, false) -+ cpu_physical_memory_read(E1, E2, E3) -| -- cpu_physical_memory_rw(E1, E2, E3, true) -+ cpu_physical_memory_write(E1, E2, E3) -) - // Remove useless cast @@ expression E1, E2, E3, E4, E5, E6; @@ -93,9 +74,6 @@ type T; + address_space_write_rom(E1, E2, E3, E4, E5) | -- cpu_physical_memory_rw(E1, (T *)(E2), E3, E4) -+ cpu_physical_memory_rw(E1, E2, E3, E4) -| - cpu_physical_memory_read(E1, (T *)(E2), E3) + cpu_physical_memory_read(E1, E2, E3) | diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 6e8cb530f6e..910e1c2afb9 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -131,8 +131,6 @@ void cpu_address_space_init(CPUState *cpu, int asidx, */ void cpu_address_space_destroy(CPUState *cpu, int asidx); -void cpu_physical_memory_rw(hwaddr addr, void *buf, - hwaddr len, bool is_write); void cpu_physical_memory_read(hwaddr addr, void *buf, hwaddr len); void cpu_physical_memory_write(hwaddr addr, const void *buf, hwaddr len); void *cpu_physical_memory_map(hwaddr addr, diff --git a/system/physmem.c b/system/physmem.c index 5a0ee3b8e58..93e9550338f 100644 --- a/system/physmem.c +++ b/system/physmem.c @@ -3181,21 +3181,16 @@ MemTxResult address_space_set(AddressSpace *as, hwaddr addr, return error; } -void cpu_physical_memory_rw(hwaddr addr, void *buf, - hwaddr len, bool is_write) -{ - address_space_rw(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED, - buf, len, is_write); -} - void cpu_physical_memory_read(hwaddr addr, void *buf, hwaddr len) { - cpu_physical_memory_rw(addr, buf, len, false); + address_space_read(&address_space_memory, addr, + MEMTXATTRS_UNSPECIFIED, buf, len); } void cpu_physical_memory_write(hwaddr addr, const void *buf, hwaddr len) { - cpu_physical_memory_rw(addr, (void *)buf, len, true); + address_space_write(&address_space_memory, addr, + MEMTXATTRS_UNSPECIFIED, buf, len); } /* used for ROM loading : can write in RAM and ROM */ -- 2.51.0
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |