system: Move cpu_physical_memory_*() declarations to 'system/physmem.h'

The following cpu_physical_memory_*() methods do not involve any
vCPU but only access physical memory:

 - cpu_physical_memory_read()
 - cpu_physical_memory_write()
 - cpu_physical_memory_map()
 - cpu_physical_memory_unmap()

Rename them removing the 'cpu_' prefix, and move then to the
"system/physmem.h" header with the other methods involved in
global physical address space.

Mechanical change using sed, then adding missing headers manually.

No logical change intended.

Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20260616020839.19104-7-philmd@oss.qualcomm.com>
This commit is contained in:
Philippe Mathieu-Daudé
2026-06-09 17:07:29 +02:00
parent 736641b660
commit cb30b8758d
54 changed files with 270 additions and 230 deletions

View File

@@ -40,6 +40,7 @@
#include "system/cpus.h"
#include "qemu/guest-random.h"
#include "hw/core/nmi.h"
#include "system/physmem.h"
#include "system/replay.h"
#include "system/runstate.h"
#include "system/cpu-timers.h"
@@ -898,7 +899,7 @@ void qmp_pmemsave(uint64_t addr, uint64_t size, const char *filename,
l = sizeof(buf);
if (l > size)
l = size;
cpu_physical_memory_read(addr, buf, l);
physical_memory_read(addr, buf, l);
if (fwrite(buf, 1, l, f) != l) {
error_setg(errp, "writing memory to '%s' failed",
filename);

View File

@@ -3477,13 +3477,13 @@ MemTxResult address_space_set(const AddressSpace *as, hwaddr addr,
return error;
}
void cpu_physical_memory_read(hwaddr addr, void *buf, hwaddr len)
void physical_memory_read(hwaddr addr, void *buf, hwaddr len)
{
address_space_read(&address_space_memory, addr,
MEMTXATTRS_UNSPECIFIED, buf, len);
}
void cpu_physical_memory_write(hwaddr addr, const void *buf, hwaddr len)
void physical_memory_write(hwaddr addr, const void *buf, hwaddr len)
{
address_space_write(&address_space_memory, addr,
MEMTXATTRS_UNSPECIFIED, buf, len);
@@ -3808,16 +3808,14 @@ void address_space_unmap(AddressSpace *as, void *buffer, hwaddr len,
address_space_notify_map_clients(as);
}
void *cpu_physical_memory_map(hwaddr addr,
hwaddr *plen,
bool is_write)
void *physical_memory_map(hwaddr addr, hwaddr *plen, bool is_write)
{
return address_space_map(&address_space_memory, addr, plen, is_write,
MEMTXATTRS_UNSPECIFIED);
}
void cpu_physical_memory_unmap(void *buffer, hwaddr len,
bool is_write, hwaddr access_len)
void physical_memory_unmap(void *buffer, hwaddr len,
bool is_write, hwaddr access_len)
{
return address_space_unmap(&address_space_memory, buffer, len, is_write, access_len);
}