summaryrefslogtreecommitdiff
path: root/lib_i386/board.c
diff options
context:
space:
mode:
authorGraeme Russ <graeme.russ@gmail.com>2009-11-24 20:04:13 +1100
committerWolfgang Denk <wd@denx.de>2009-12-05 01:02:10 +0100
commitb4feeb4e8a1d9124bae39985a97b99d08e06186d (patch)
treeef7a0d8a2b8616561da4f3ef578e5c2e1823ceec /lib_i386/board.c
parentc74bfce0fb20ec4d01809fa0566263894923467b (diff)
downloadu-boot-imx-b4feeb4e8a1d9124bae39985a97b99d08e06186d.zip
u-boot-imx-b4feeb4e8a1d9124bae39985a97b99d08e06186d.tar.gz
u-boot-imx-b4feeb4e8a1d9124bae39985a97b99d08e06186d.tar.bz2
i386: Fix malloc initialization
Signed-off-by: Graeme Russ <graeme.russ@gmail.com>
Diffstat (limited to 'lib_i386/board.c')
-rw-r--r--lib_i386/board.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/lib_i386/board.c b/lib_i386/board.c
index 12ca20f..ebd7047 100644
--- a/lib_i386/board.c
+++ b/lib_i386/board.c
@@ -77,17 +77,16 @@ ulong i386boot_bios_size = (ulong)&_i386boot_bios_size; /* size of BIOS
const char version_string[] =
U_BOOT_VERSION" (" U_BOOT_DATE " - " U_BOOT_TIME ")";
-static int mem_malloc_init(void)
+static int heap_init(void)
{
/* start malloc area right after the stack */
- mem_malloc_start = i386boot_bss_start +
- i386boot_bss_size + CONFIG_SYS_STACK_SIZE;
- mem_malloc_start = (mem_malloc_start+3)&~3;
+ ulong start = i386boot_bss_start + i386boot_bss_size +
+ CONFIG_SYS_STACK_SIZE;
- /* Use all available RAM for malloc() */
- mem_malloc_end = gd->ram_size;
+ /* 4-byte aligned */
+ start = (start+3)&~3;
- mem_malloc_brk = mem_malloc_start;
+ mem_malloc_init(start, CONFIG_SYS_MALLOC_LEN);
return 0;
}
@@ -184,7 +183,7 @@ init_fnc_t *init_sequence[] = {
cpu_init, /* basic cpu dependent setup */
board_init, /* basic board dependent setup */
dram_init, /* configure available RAM banks */
- mem_malloc_init, /* dependant on dram_init */
+ heap_init, /* dependant on dram_init */
interrupt_init, /* set up exceptions */
timer_init,
serial_init,