mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
memory: Replace io_mem_read/write with memory_region_dispatch_read/write
Rather than retaining io_mem_read/write as simple wrappers around the memory_region_dispatch_read/write functions, make the latter public and change all the callers to use them, since we need to touch all the callsites anyway to add MemTxAttrs and MemTxResult support. Delete io_mem_read and io_mem_write entirely. (All the callers currently pass MEMTXATTRS_UNSPECIFIED and convert the return value back to bool or ignore it.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
This commit is contained in:
parent
cc05c43ad9
commit
3b64349539
7 changed files with 95 additions and 54 deletions
|
@ -341,10 +341,6 @@ void phys_mem_set_alloc(void *(*alloc)(size_t, uint64_t *align));
|
|||
|
||||
struct MemoryRegion *iotlb_to_region(CPUState *cpu,
|
||||
hwaddr index);
|
||||
bool io_mem_read(struct MemoryRegion *mr, hwaddr addr,
|
||||
uint64_t *pvalue, unsigned size);
|
||||
bool io_mem_write(struct MemoryRegion *mr, hwaddr addr,
|
||||
uint64_t value, unsigned size);
|
||||
|
||||
void tlb_fill(CPUState *cpu, target_ulong addr, int is_write, int mmu_idx,
|
||||
uintptr_t retaddr);
|
||||
|
|
|
@ -1052,6 +1052,37 @@ void memory_global_dirty_log_stop(void);
|
|||
|
||||
void mtree_info(fprintf_function mon_printf, void *f);
|
||||
|
||||
/**
|
||||
* memory_region_dispatch_read: perform a read directly to the specified
|
||||
* MemoryRegion.
|
||||
*
|
||||
* @mr: #MemoryRegion to access
|
||||
* @addr: address within that region
|
||||
* @pval: pointer to uint64_t which the data is written to
|
||||
* @size: size of the access in bytes
|
||||
* @attrs: memory transaction attributes to use for the access
|
||||
*/
|
||||
MemTxResult memory_region_dispatch_read(MemoryRegion *mr,
|
||||
hwaddr addr,
|
||||
uint64_t *pval,
|
||||
unsigned size,
|
||||
MemTxAttrs attrs);
|
||||
/**
|
||||
* memory_region_dispatch_write: perform a write directly to the specified
|
||||
* MemoryRegion.
|
||||
*
|
||||
* @mr: #MemoryRegion to access
|
||||
* @addr: address within that region
|
||||
* @data: data to write
|
||||
* @size: size of the access in bytes
|
||||
* @attrs: memory transaction attributes to use for the access
|
||||
*/
|
||||
MemTxResult memory_region_dispatch_write(MemoryRegion *mr,
|
||||
hwaddr addr,
|
||||
uint64_t data,
|
||||
unsigned size,
|
||||
MemTxAttrs attrs);
|
||||
|
||||
/**
|
||||
* address_space_init: initializes an address space
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue