mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 23:33:54 -06:00
memory: move mmio access to functions
Currently mmio access goes directly to the io_mem_{read,write} arrays. In preparation for eliminating them, add indirection via a function. Signed-off-by: Avi Kivity <avi@redhat.com> Reviewed-by: Richard Henderson <rth@twiddle.net>
This commit is contained in:
parent
f1f6e3b86e
commit
acbbec5d43
4 changed files with 55 additions and 39 deletions
13
memory.c
13
memory.c
|
@ -1580,6 +1580,19 @@ void set_system_io_map(MemoryRegion *mr)
|
|||
memory_region_update_topology(NULL);
|
||||
}
|
||||
|
||||
uint64_t io_mem_read(int io_index, target_phys_addr_t addr, unsigned size)
|
||||
{
|
||||
return _io_mem_read[io_index][bitops_ffsl(size)](io_mem_opaque[io_index],
|
||||
addr);
|
||||
}
|
||||
|
||||
void io_mem_write(int io_index, target_phys_addr_t addr,
|
||||
uint64_t val, unsigned size)
|
||||
{
|
||||
_io_mem_write[io_index][bitops_ffsl(size)](io_mem_opaque[io_index],
|
||||
addr, val);
|
||||
}
|
||||
|
||||
typedef struct MemoryRegionList MemoryRegionList;
|
||||
|
||||
struct MemoryRegionList {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue