diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2017-05-15 13:40:37 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-05-16 15:41:35 +1000 |
commit | 76a7a130b2084a8fbb0122061044b945a39dc401 (patch) | |
tree | 1ed2a77ac6ab819c793c535df134d12ff19e43f6 | |
parent | 65612f1207351220f4e3e5269ac456bafbe36e1c (diff) | |
download | skiboot-76a7a130b2084a8fbb0122061044b945a39dc401.zip skiboot-76a7a130b2084a8fbb0122061044b945a39dc401.tar.gz skiboot-76a7a130b2084a8fbb0122061044b945a39dc401.tar.bz2 |
core/test: Test pre-init memory reservations
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/test/run-mem_region_reservations.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/test/run-mem_region_reservations.c b/core/test/run-mem_region_reservations.c index bb402e2..8764953 100644 --- a/core/test/run-mem_region_reservations.c +++ b/core/test/run-mem_region_reservations.c @@ -74,7 +74,7 @@ bool lock_held_by_me(struct lock *l) return l->lock_val; } -#define TEST_HEAP_ORDER 12 +#define TEST_HEAP_ORDER 14 #define TEST_HEAP_SIZE (1ULL << TEST_HEAP_ORDER) static void add_mem_node(uint64_t start, uint64_t len) @@ -203,14 +203,17 @@ int main(void) buf = real_malloc(1024*1024); add_mem_node((unsigned long)buf, 1024*1024); - /* Now convert. */ - mem_region_init(); - - /* create our reservations */ + /* add pre-init reservations */ for (i = 0; i < ARRAY_SIZE(test_regions); i++) mem_reserve_hw(test_regions[i].name, test_regions[i].addr, 0x1000); + /* Now convert. */ + mem_region_init(); + + /* add a post-init reservation */ + mem_reserve_hw("test.4", 0x5000, 0x1000); + /* release unused */ mem_region_release_unused(); @@ -218,7 +221,7 @@ int main(void) mem_region_add_dt_reserved(); /* ensure we can't create further reservations */ - r = new_region("test.4", 0x5000, 0x1000, NULL, REGION_RESERVED); + r = new_region("test.5", 0x5000, 0x1000, NULL, REGION_RESERVED); assert(!add_region(r)); /* check old property-style reservations */ |