Skip to content

Commit

Permalink
exec: dummy_section: Pass address space through.
Browse files Browse the repository at this point in the history
Rather than use the global singleton.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
pete128 authored and bonzini committed Jun 17, 2014
1 parent 3fb5bf5 commit a656e22
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions exec.c
Expand Up @@ -1776,10 +1776,12 @@ static subpage_t *subpage_init(AddressSpace *as, hwaddr base)
return mmio;
}

static uint16_t dummy_section(PhysPageMap *map, MemoryRegion *mr)
static uint16_t dummy_section(PhysPageMap *map, AddressSpace *as,
MemoryRegion *mr)
{
assert(as);
MemoryRegionSection section = {
.address_space = &address_space_memory,
.address_space = as,
.mr = mr,
.offset_within_address_space = 0,
.offset_within_region = 0,
Expand Down Expand Up @@ -1811,13 +1813,13 @@ static void mem_begin(MemoryListener *listener)
AddressSpaceDispatch *d = g_new0(AddressSpaceDispatch, 1);
uint16_t n;

n = dummy_section(&d->map, &io_mem_unassigned);
n = dummy_section(&d->map, as, &io_mem_unassigned);
assert(n == PHYS_SECTION_UNASSIGNED);
n = dummy_section(&d->map, &io_mem_notdirty);
n = dummy_section(&d->map, as, &io_mem_notdirty);
assert(n == PHYS_SECTION_NOTDIRTY);
n = dummy_section(&d->map, &io_mem_rom);
n = dummy_section(&d->map, as, &io_mem_rom);
assert(n == PHYS_SECTION_ROM);
n = dummy_section(&d->map, &io_mem_watch);
n = dummy_section(&d->map, as, &io_mem_watch);
assert(n == PHYS_SECTION_WATCH);

d->phys_map = (PhysPageEntry) { .ptr = PHYS_MAP_NODE_NIL, .skip = 1 };
Expand Down

0 comments on commit a656e22

Please sign in to comment.