From f05ef9550d95c4ea386bd1879e0e03e81fd0a951 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Sun, 7 Jun 2009 15:12:39 -0700 Subject: [PATCH] memdisk: move the heap to high memory Instead of using a heap arbitrarily allocated in low memory, move it to a chunk of bss in high memory. Signed-off-by: H. Peter Anvin --- memdisk/unzip.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/memdisk/unzip.c b/memdisk/unzip.c index 9f198a2..c4b56ef 100644 --- a/memdisk/unzip.c +++ b/memdisk/unzip.c @@ -349,12 +349,14 @@ int check_zip(void *indata, uint32_t size, uint32_t * zbytes_p, */ extern void _end; +static char heap[65536]; + void *unzip(void *indata, uint32_t zbytes, uint32_t dbytes, uint32_t orig_crc, void *target) { - /* Set up the heap; it's the 64K after the bounce buffer */ - free_mem_ptr = (ulg) sys_bounce + 0x10000; - free_mem_end_ptr = free_mem_ptr + 0x10000; + /* Set up the heap; it is simply a chunk of bss memory */ + free_mem_ptr = (size_t)heap; + free_mem_end_ptr = (size_t)heap + sizeof heap; /* Set up input buffer */ inbuf = indata; -- 2.7.4