On Sun, May 24, 2009 at 12:29:33PM +0300, Avi Kivity wrote:
+struct PhysicalMemoryRegion {
+ target_phys_addr_t start_addr;
+ target_phys_addr_t size;
+ ram_addr_t ram_addr;
+ ram_addr_t region_offset;
+};
+
+PhysicalMemoryRegion *physical_memory_region_register(
+ target_phys_addr_t start_addr,
+ target_phys_addr_t size,
+ ram_addr_t ram_addr)
+{
+ return physical_memory_region_register_offset(start_addr, size, ram_addr,
0);
+}
Wouldn't it be much easier if the client allocated the
PhysicalMemoryRegion and just passed a pointer to it into
physical_memory_region_register? That would also take care of the
physical_memory_region_register vs
physical_memory_region_register_offset split as the non-offset case
would just not fill out the region_offset field and be done with it.