mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-07-08 21:30:43 +00:00
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:
parent
eb75004013
commit
3082b4e4ec
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue