X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=lib_nios%2Fboard.c;h=5d2fb2ec4afd849d23ec661588b2cdbf3826049b;hb=e1957ef02c0d949c27f7386e5fa509a57e033d5a;hp=cd234578b7474cb16e74ddfae70592d882ea1e83;hpb=52cb4d4fb3487313f5a72ea740f527a4aefaa365;p=oweals%2Fu-boot.git diff --git a/lib_nios/board.c b/lib_nios/board.c index cd234578b7..5d2fb2ec4a 100644 --- a/lib_nios/board.c +++ b/lib_nios/board.c @@ -27,6 +27,7 @@ #include #include #include +#include #include #ifdef CONFIG_STATUS_LED #include @@ -48,41 +49,8 @@ DECLARE_GLOBAL_DATA_PTR; */ -extern void malloc_bin_reloc (void); typedef int (init_fnc_t) (void); -/* - * Begin and End of memory area for malloc(), and current "brk" - */ -static ulong mem_malloc_start = 0; -static ulong mem_malloc_end = 0; -static ulong mem_malloc_brk = 0; - -/* - * The Malloc area is immediately below the monitor copy in RAM - */ -static void mem_malloc_init (void) -{ - mem_malloc_start = CONFIG_SYS_MALLOC_BASE; - mem_malloc_end = mem_malloc_start + CONFIG_SYS_MALLOC_LEN; - mem_malloc_brk = mem_malloc_start; - memset ((void *) mem_malloc_start, - 0, - mem_malloc_end - mem_malloc_start); -} - -void *sbrk (ptrdiff_t increment) -{ - ulong old = mem_malloc_brk; - ulong new = old + increment; - - if ((new < mem_malloc_start) || (new > mem_malloc_end)) { - return (NULL); - } - mem_malloc_brk = new; - return ((void *) old); -} - /************************************************************************ * Initialization sequence * @@ -143,8 +111,9 @@ void board_init (void) } WATCHDOG_RESET (); - mem_malloc_init(); - malloc_bin_reloc(); + + /* The Malloc area is immediately below the monitor copy in RAM */ + mem_malloc_init(CONFIG_SYS_MALLOC_BASE, CONFIG_SYS_MALLOC_LEN); WATCHDOG_RESET (); bd->bi_flashsize = flash_init();