[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 02/32] exec.c: Remove static allocation of sub_sectio
From: |
Peter Maydell |
Subject: |
[Qemu-devel] [PULL 02/32] exec.c: Remove static allocation of sub_section of sub_page |
Date: |
Mon, 24 Oct 2016 18:24:58 +0100 |
From: Vijaya Kumar K <address@hidden>
Allocate sub_section dynamically. Remove dependency
on TARGET_PAGE_SIZE to make run-time page size detection
for arm platforms.
Signed-off-by: Vijaya Kumar K <address@hidden>
Message-id: address@hidden
[PMM: use flexible array member rather than separate malloc
so we don't need an extra pointer deref when using it]
Reviewed-by: Richard Henderson <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
---
exec.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/exec.c b/exec.c
index 6d7f600..93128fd 100644
--- a/exec.c
+++ b/exec.c
@@ -153,7 +153,7 @@ typedef struct subpage_t {
MemoryRegion iomem;
AddressSpace *as;
hwaddr base;
- uint16_t sub_section[TARGET_PAGE_SIZE];
+ uint16_t sub_section[];
} subpage_t;
#define PHYS_SECTION_UNASSIGNED 0
@@ -2215,8 +2215,7 @@ static subpage_t *subpage_init(AddressSpace *as, hwaddr
base)
{
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->base = base;
memory_region_init_io(&mmio->iomem, NULL, &subpage_ops, mmio,
--
2.7.4
- [Qemu-devel] [PULL 07/32] hw/arm/virt: Set minimum_page_bits to 12, (continued)
- [Qemu-devel] [PULL 07/32] hw/arm/virt: Set minimum_page_bits to 12, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 11/32] tests: ptimer: Add tests for "continuous trigger" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 06/32] target-arm: Make page size a runtime setting, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 25/32] i2c: Fix SMBus read transactions to avoid double events, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 26/32] timer: stm32f2xx_timer: add check for prescaler value, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 31/32] target-arm: Implement new HLT trap for semihosting, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 18/32] tests: ptimer: Change the copyright comment, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 10/32] hw/ptimer: Add "continuous trigger" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 21/32] tests: Add tests for the ARM MPTimer, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 13/32] tests: ptimer: Add tests for "no immediate trigger" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 02/32] exec.c: Remove static allocation of sub_section of sub_page,
Peter Maydell <=
- [Qemu-devel] [PULL 28/32] hw/arm: QOM'ify pxa2xx_gpio.c, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 08/32] hw/ptimer: Add "wraparound after one period" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 05/32] migration/savevm.c: migrate non-default page size, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 19/32] tests: ptimer: Replace 10000 with 1, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 17/32] tests: ptimer: Add tests for "no counter round down" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 15/32] tests: ptimer: Add tests for "no immediate reload" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 32/32] i2c: Add asserts for second smbus i2c_start_transfer(), Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 09/32] tests: ptimer: Add tests for "wraparound after one period" policy, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 04/32] cpu: Support a target CPU having a variable page size, Peter Maydell, 2016/10/24
- [Qemu-devel] [PULL 03/32] translate-all.c: Compute L1 page table properties at runtime, Peter Maydell, 2016/10/24