mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-09-09 00:07:57 -06:00
exec: Let the cpu_[physical]_memory API use void pointer arguments
As we are only dealing with a blob buffer, use a void pointer argument. This will let us simplify other APIs. Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
This commit is contained in:
parent
b7cbebf2b9
commit
d7ef71ef42
3 changed files with 7 additions and 5 deletions
8
exec.c
8
exec.c
|
@ -3019,11 +3019,12 @@ MemoryRegion *get_system_io(void)
|
||||||
/* physical memory access (slow version, mainly for debug) */
|
/* physical memory access (slow version, mainly for debug) */
|
||||||
#if defined(CONFIG_USER_ONLY)
|
#if defined(CONFIG_USER_ONLY)
|
||||||
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
||||||
uint8_t *buf, target_ulong len, int is_write)
|
void *ptr, target_ulong len, int is_write)
|
||||||
{
|
{
|
||||||
int flags;
|
int flags;
|
||||||
target_ulong l, page;
|
target_ulong l, page;
|
||||||
void * p;
|
void * p;
|
||||||
|
uint8_t *buf = ptr;
|
||||||
|
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
page = addr & TARGET_PAGE_MASK;
|
page = addr & TARGET_PAGE_MASK;
|
||||||
|
@ -3311,7 +3312,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr addr, MemTxAttrs attrs,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
|
void cpu_physical_memory_rw(hwaddr addr, void *buf,
|
||||||
hwaddr len, int is_write)
|
hwaddr len, int is_write)
|
||||||
{
|
{
|
||||||
address_space_rw(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
|
address_space_rw(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED,
|
||||||
|
@ -3789,10 +3790,11 @@ address_space_write_cached_slow(MemoryRegionCache *cache, hwaddr addr,
|
||||||
|
|
||||||
/* virtual memory access for debug (includes writing to ROM) */
|
/* virtual memory access for debug (includes writing to ROM) */
|
||||||
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
||||||
uint8_t *buf, target_ulong len, int is_write)
|
void *ptr, target_ulong len, int is_write)
|
||||||
{
|
{
|
||||||
hwaddr phys_addr;
|
hwaddr phys_addr;
|
||||||
target_ulong l, page;
|
target_ulong l, page;
|
||||||
|
uint8_t *buf = ptr;
|
||||||
|
|
||||||
cpu_synchronize_state(cpu);
|
cpu_synchronize_state(cpu);
|
||||||
while (len > 0) {
|
while (len > 0) {
|
||||||
|
|
|
@ -388,7 +388,7 @@ void dump_opcount_info(void);
|
||||||
#endif /* !CONFIG_USER_ONLY */
|
#endif /* !CONFIG_USER_ONLY */
|
||||||
|
|
||||||
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr,
|
||||||
uint8_t *buf, target_ulong len, int is_write);
|
void *ptr, target_ulong len, int is_write);
|
||||||
|
|
||||||
int cpu_exec(CPUState *cpu);
|
int cpu_exec(CPUState *cpu);
|
||||||
|
|
||||||
|
|
|
@ -69,7 +69,7 @@ void qemu_ram_unset_migratable(RAMBlock *rb);
|
||||||
size_t qemu_ram_pagesize(RAMBlock *block);
|
size_t qemu_ram_pagesize(RAMBlock *block);
|
||||||
size_t qemu_ram_pagesize_largest(void);
|
size_t qemu_ram_pagesize_largest(void);
|
||||||
|
|
||||||
void cpu_physical_memory_rw(hwaddr addr, uint8_t *buf,
|
void cpu_physical_memory_rw(hwaddr addr, void *buf,
|
||||||
hwaddr len, int is_write);
|
hwaddr len, int is_write);
|
||||||
static inline void cpu_physical_memory_read(hwaddr addr,
|
static inline void cpu_physical_memory_read(hwaddr addr,
|
||||||
void *buf, hwaddr len)
|
void *buf, hwaddr len)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue