diff options
author | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-08-23 11:00:29 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-08-24 12:59:15 +1000 |
commit | 276c1431d62548803a68906faba81cf947d2e77d (patch) | |
tree | 839e0c233d45f16d6b5045e3a2eae17c22283c5a | |
parent | 696893d8a2a32dbec962e691445aaebcc4a6f203 (diff) | |
download | skiboot-276c1431d62548803a68906faba81cf947d2e77d.zip skiboot-276c1431d62548803a68906faba81cf947d2e77d.tar.gz skiboot-276c1431d62548803a68906faba81cf947d2e77d.tar.bz2 |
test/mem_region: fix incorrect ibm,os-reserve region length
We were reserving all of memory up to the heap, which is fine
*unless* the system libc chooses to allocate something in that
block of memory that we use, which means we have overlapping
regions and general pain.
This should fix failing unit tests on some systems (e.g. Debian)
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
-rw-r--r-- | core/test/run-mem_region_release_unused.c | 2 | ||||
-rw-r--r-- | core/test/run-mem_region_release_unused_noalloc.c | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/core/test/run-mem_region_release_unused.c b/core/test/run-mem_region_release_unused.c index 886585b..712f98a 100644 --- a/core/test/run-mem_region_release_unused.c +++ b/core/test/run-mem_region_release_unused.c @@ -113,7 +113,7 @@ int main(void) /* Use malloc for the heap, so valgrind can find issues. */ skiboot_heap.start = (unsigned long)malloc(TEST_HEAP_SIZE); skiboot_heap.len = TEST_HEAP_SIZE; - skiboot_os_reserve.len = skiboot_heap.start; + skiboot_os_reserve.len = 0; dt_root = dt_new_root(""); dt_add_property_cells(dt_root, "#address-cells", 2); diff --git a/core/test/run-mem_region_release_unused_noalloc.c b/core/test/run-mem_region_release_unused_noalloc.c index 2a9f641..a79485b 100644 --- a/core/test/run-mem_region_release_unused_noalloc.c +++ b/core/test/run-mem_region_release_unused_noalloc.c @@ -110,9 +110,10 @@ int main(void) const char *last; /* Use malloc for the heap, so valgrind can find issues. */ - skiboot_heap.start = (unsigned long)malloc(TEST_HEAP_SIZE); + skiboot_heap.start = 0; skiboot_heap.len = TEST_HEAP_SIZE; - skiboot_os_reserve.len = skiboot_heap.start; + skiboot_os_reserve.start = 0; + skiboot_os_reserve.len = 0; dt_root = dt_new_root(""); dt_add_property_cells(dt_root, "#address-cells", 2); @@ -163,6 +164,5 @@ int main(void) } dt_free(dt_root); - free((void *)(long)skiboot_heap.start); return 0; } |