]> git.sur5r.net Git - u-boot/blobdiff - lib_nios2/board.c
i386: Fix link collisions resulting from gcc4.4.1 upgrade
[u-boot] / lib_nios2 / board.c
index b142c59613796fa894088d7b6f69508aa60071eb..008f04f956277ddabe75cca2850c38e5d51ac306 100644 (file)
@@ -27,6 +27,7 @@
 #include <common.h>
 #include <stdio_dev.h>
 #include <watchdog.h>
+#include <malloc.h>
 #include <net.h>
 #ifdef CONFIG_STATUS_LED
 #include <status_led.h>
@@ -51,41 +52,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                                             *
@@ -149,8 +117,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();