summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/v850
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/v850')
-rw-r--r--libc/sysdeps/linux/v850/Makefile2
-rw-r--r--libc/sysdeps/linux/v850/_mmap.c20
2 files changed, 21 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/v850/Makefile b/libc/sysdeps/linux/v850/Makefile
index a48dcfd1d..4e2974551 100644
--- a/libc/sysdeps/linux/v850/Makefile
+++ b/libc/sysdeps/linux/v850/Makefile
@@ -18,7 +18,7 @@ CFLAGS+= -I../ -D__ASSEMBLER__ -DASM_GLOBAL_DIRECTIVE=.globl
TARGET_MACHINE_TYPE=$(shell $(CC) -dumpmachine)
-CRT0=crt0.S
+CRT0=crt0.S _mmap.c
CRT0_OBJ=$(patsubst %.S,%.o, $(CRT0))
SSRC=setjmp.S longjmp.S vfork.S
diff --git a/libc/sysdeps/linux/v850/_mmap.c b/libc/sysdeps/linux/v850/_mmap.c
new file mode 100644
index 000000000..a0c58253a
--- /dev/null
+++ b/libc/sysdeps/linux/v850/_mmap.c
@@ -0,0 +1,20 @@
+/* Use old style mmap for v850 */
+#include <unistd.h>
+#include <sys/mman.h>
+#include <sys/syscall.h>
+
+
+__ptr_t mmap(__ptr_t addr, size_t len, int prot,
+ int flags, int fd, __off_t offset)
+{
+ unsigned long buffer[6];
+
+ buffer[0] = (unsigned long) addr;
+ buffer[1] = (unsigned long) len;
+ buffer[2] = (unsigned long) prot;
+ buffer[3] = (unsigned long) flags;
+ buffer[4] = (unsigned long) fd;
+ buffer[5] = (unsigned long) offset;
+ return (__ptr_t) _mmap(buffer);
+}
+