]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - arch/sandbox/cpu/os.c
sandbox: Add improved RAM simulation
[karo-tx-uboot.git] / arch / sandbox / cpu / os.c
index f80faac1f5ff5d911e9b76f92a803b542aeb04cf..b7c3bf5f80adbb68c63651653328d8edb0786c98 100644 (file)
@@ -25,6 +25,7 @@
 #include <unistd.h>
 #include <sys/types.h>
 #include <sys/stat.h>
+#include <sys/mman.h>
 
 #include <os.h>
 
@@ -87,3 +88,9 @@ void os_tty_raw(int fd)
 
        atexit(os_fd_restore);
 }
+
+void *os_malloc(size_t length)
+{
+       return mmap(NULL, length, PROT_READ | PROT_WRITE,
+                       MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
+}