/**
* Get the root memory region. This is a legacy function, provided for
* compatibility. Prefer using SysBusState::system_memory directly.
*/
-MemoryRegion *get_system_memory(void);
+inline MemoryRegion *get_system_memory(void)
+{
+ assert(current_machine);
+
+ return ¤t_machine->main_system_bus.system_memory;
+}
/**
* Get the root I/O port region. This is a legacy function, provided for
* compatibility. Prefer using SysBusState::system_io directly.
*/
-MemoryRegion *get_system_io(void);
+inline MemoryRegion *get_system_io(void)
+{
+ assert(current_machine);
+
+ return ¤t_machine->main_system_bus.system_io;
+}
/**
* Get the root memory address space. This is a legacy function,
provided for
* compatibility. Prefer using SysBusState::address_space_memory
directly.
*/
-AddressSpace *get_address_space_memory(void);
+inline AddressSpace *get_address_space_memory(void)
+{
+ assert(current_machine);
+
+ return ¤t_machine->main_system_bus.address_space_memory;
+}
/**
* Get the root I/O port address space. This is a legacy function,
provided
* for compatibility. Prefer using SysBusState::address_space_io
directly.
*/
-AddressSpace *get_address_space_io(void);
+inline AddressSpace *get_address_space_io(void)
+{
+ assert(current_machine);
+
+ return ¤t_machine->main_system_bus.address_space_io;
+}
#endif
diff --git a/softmmu/physmem.c b/softmmu/physmem.c
index 07e9a9171c..dce088f55c 100644
--- a/softmmu/physmem.c
+++ b/softmmu/physmem.c
@@ -2674,34 +2674,6 @@ static void memory_map_init(SysBusState *sysbus)
address_space_init(&sysbus->address_space_io, system_io, "I/O");
}
-MemoryRegion *get_system_memory(void)
-{
- assert(current_machine);
-
- return ¤t_machine->main_system_bus.system_memory;
-}
-
-MemoryRegion *get_system_io(void)
-{
- assert(current_machine);
-
- return ¤t_machine->main_system_bus.system_io;
-}
-
-AddressSpace *get_address_space_memory(void)
-{
- assert(current_machine);
-
- return ¤t_machine->main_system_bus.address_space_memory;
-}
-
-AddressSpace *get_address_space_io(void)
-{
- assert(current_machine);
-
- return ¤t_machine->main_system_bus.address_space_io;
-}
-
static void invalidate_and_set_dirty(MemoryRegion *mr, hwaddr addr,
hwaddr length)
{