sandbox: Add a new header for the system malloc()
Some files use U-Boot headers but still need to access the system
malloc(). Allow this by creating a new asm/malloc.h which can be used so
long as U-Boot's malloc.h has not been included.
Signed-off-by: Simon Glass <sjg@chromium.org>
diff --git a/arch/sandbox/cpu/start.c b/arch/sandbox/cpu/start.c
index 01adaeb..4760731 100644
--- a/arch/sandbox/cpu/start.c
+++ b/arch/sandbox/cpu/start.c
@@ -8,10 +8,10 @@
#include <errno.h>
#include <os.h>
#include <cli.h>
-#include <malloc.h>
#include <sort.h>
#include <asm/getopt.h>
#include <asm/io.h>
+#include <asm/malloc.h>
#include <asm/sections.h>
#include <asm/state.h>
#include <linux/ctype.h>
@@ -181,7 +181,7 @@
int len;
len = strlen(state->argv[0]) + strlen(fmt) + 1;
- fname = os_malloc(len);
+ fname = malloc(len);
if (!fname)
return -ENOMEM;
snprintf(fname, len, fmt, state->argv[0]);
@@ -201,7 +201,7 @@
int len;
len = strlen(state->argv[0]) + strlen(fmt) + 1;
- fname = os_malloc(len);
+ fname = malloc(len);
if (!fname)
return -ENOMEM;
strcpy(fname, state->argv[0]);