aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfeng.tang@intel.com <feng.tang@intel.com>2010-06-16 21:39:52 +0800
committerFeng Tang <feng.tang@intel.com>2010-07-20 11:10:03 +0800
commit066fc68f184ed163e36d8cefec965f7a8737e2eb (patch)
tree9f38fcd4c877fd15cfe205a4a8f88159a47e423e
parent0a4cb67a253b745eebf8df0833efab08932a2a8d (diff)
downloadsyslinux-066fc68f184ed163e36d8cefec965f7a8737e2eb.tar.gz
syslinux-066fc68f184ed163e36d8cefec965f7a8737e2eb.tar.xz
syslinux-066fc68f184ed163e36d8cefec965f7a8737e2eb.zip
elflink: use core/malloc as the malloc system, enlarge buffer to 1MB
-rwxr-xr-xbuild.sh3
-rw-r--r--com32/lib/free.c2
-rw-r--r--com32/lib/malloc.c12
-rw-r--r--core/mem/init.c3
4 files changed, 16 insertions, 4 deletions
diff --git a/build.sh b/build.sh
index 63a8b635..8761358b 100755
--- a/build.sh
+++ b/build.sh
@@ -1,4 +1,5 @@
-make -j 8 || exit 1
+make -j 4 || exit 1
cp extlinux/extlinux /home/feng/test/syslinux/
cp com32/elflink/modules/*.c32 /home/feng/test/syslinux/cd/
sudo extlinux/extlinux -i /home/feng/test/syslinux/cd/
+qemu -hda /home/feng/test/syslinux/test.img
diff --git a/com32/lib/free.c b/com32/lib/free.c
index fb8fdb4a..f58e9818 100644
--- a/com32/lib/free.c
+++ b/com32/lib/free.c
@@ -64,6 +64,7 @@ static struct free_arena_header *__free_block(struct free_arena_header *ah)
* free list. Only the a.size field of the arena header is assumed
* to be valid.
*/
+#if 0
void __inject_free_block(struct free_arena_header *ah)
{
struct free_arena_header *nah;
@@ -97,6 +98,7 @@ void __inject_free_block(struct free_arena_header *ah)
__free_block(ah);
}
+#endif
#if 0
void free(void *ptr)
diff --git a/com32/lib/malloc.c b/com32/lib/malloc.c
index ba79b659..6cc9681f 100644
--- a/com32/lib/malloc.c
+++ b/com32/lib/malloc.c
@@ -52,6 +52,9 @@ static int consider_memory_area(void *dummy, addr_t start,
end = start + len;
+ mp("start = 0x%x, len = 0x%x",
+ start, len);
+
if (end > __com32.cs_memsize) {
if (start <= __com32.cs_memsize) {
start = __com32.cs_memsize;
@@ -61,7 +64,7 @@ static int consider_memory_area(void *dummy, addr_t start,
if (len >= 2 * sizeof(struct arena_header)) {
fp = (struct free_arena_header *)start;
fp->a.size = len;
- mp("will inject a block with size %d", len);
+ mp("will inject a block start:0x%x size 0x%x", start, len);
__inject_free_block(fp);
}
}
@@ -75,11 +78,16 @@ static void __constructor init_memory_arena(void)
struct free_arena_header *fp;
size_t start, total_space;
- mp("enter");
+ //mp("enter");
+
+ mp("skip this init as core has a mem_init");
+ return;
start = (size_t) ARENA_ALIGN_UP(__mem_end);
total_space = sp() - start;
+ mp("start = 0x%x, sp() = 0x%0x, space = 0x%x", start, sp(), total_space);
+
if (__stack_size == 0 || __stack_size > total_space >> 1)
__stack_size = total_space >> 1; /* Half for the stack, half for the heap... */
diff --git a/core/mem/init.c b/core/mem/init.c
index 5063633e..497c2134 100644
--- a/core/mem/init.c
+++ b/core/mem/init.c
@@ -7,7 +7,8 @@
struct free_arena_header __core_malloc_head[NHEAP];
-static __hugebss char main_heap[128 << 10];
+//static __hugebss char main_heap[128 << 10];
+static __hugebss char main_heap[128 << 13];
extern char __lowmem_heap[];
void mem_init(void)