exec.c: Remove static allocation of sub_section of sub_page

Allocate sub_section dynamically. Remove dependency
on TARGET_PAGE_SIZE to make run-time page size detection
for arm platforms.

Backports commit 2615fabd42ea0078dd9e659bdb21a5b7a1f87a9a from qemu
This commit is contained in:
Vijaya Kumar K 2018-02-26 10:48:57 -05:00 committed by Lioncash
parent eb75004013
commit 3082b4e4ec
No known key found for this signature in database
GPG key ID: 4E3C3CC1031BA9C7
2 changed files with 4 additions and 4 deletions

View file

@ -118,7 +118,7 @@ typedef struct subpage_t {
MemoryRegion iomem; MemoryRegion iomem;
AddressSpace *as; AddressSpace *as;
hwaddr base; hwaddr base;
uint16_t sub_section[TARGET_PAGE_SIZE]; uint16_t sub_section[];
} subpage_t; } subpage_t;
#define PHYS_SECTION_UNASSIGNED 0 #define PHYS_SECTION_UNASSIGNED 0
@ -1673,7 +1673,7 @@ static subpage_t *subpage_init(AddressSpace *as, hwaddr base)
{ {
subpage_t *mmio; subpage_t *mmio;
mmio = g_malloc0(sizeof(subpage_t)); mmio = g_malloc0(sizeof(subpage_t) + TARGET_PAGE_SIZE * sizeof(uint16_t));
mmio->as = as; mmio->as = as;
mmio->base = base; mmio->base = base;

View file

@ -1706,8 +1706,8 @@ bool memory_region_present(MemoryRegion *container, hwaddr addr)
return mr && mr != container; return mr && mr != container;
} }
static void listener_add_address_space(MemoryListener *listener, static QEMU_UNUSED_FUNC void listener_add_address_space(MemoryListener *listener,
AddressSpace *as) AddressSpace *as)
{ {
FlatView *view; FlatView *view;
FlatRange *fr; FlatRange *fr;