OSDN Git Service

Revert global old mmap usage, and do it per arch
authorEric Andersen <andersen@codepoet.org>
Tue, 16 Oct 2001 03:10:39 +0000 (03:10 -0000)
committerEric Andersen <andersen@codepoet.org>
Tue, 16 Oct 2001 03:10:39 +0000 (03:10 -0000)
Makefile
extra/Configs/Config.v850e
libc/sysdeps/linux/common/syscalls.c
libc/sysdeps/linux/v850/Makefile
libc/sysdeps/linux/v850/_mmap.c [new file with mode: 0644]

index 897c415..3f9cc9a 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -165,11 +165,6 @@ uClibc_config.h: Makefile Config
        else \
            echo "#undef __UCLIBC_USE_UNIFIED_SYSCALL__" >> uClibc_config.h ; \
        fi
-       @if [ "$(OLD_STYLE_MMAP)" != "false" ] ; then \
-           echo "#define __UCLIBC_OLD_STYLE_MMAP__ 1" >> uClibc_config.h ; \
-       else \
-           echo "#undef __UCLIBC_OLD_STYLE_MMAP__" >> uClibc_config.h ; \
-       fi
        @echo "#define C_SYMBOL_PREFIX "\""$(C_SYMBOL_PREFIX)"\" >> uClibc_config.h
 
 subdirs: $(patsubst %, _dir_%, $(DIRS))
index 3383293..2d05338 100644 (file)
@@ -119,11 +119,6 @@ MALLOC = malloc
 # At present, only affects i386.
 UNIFIED_SYSCALL = false
 
-# If false, then the mmap syscall takes individual arguments, just like
-# every other syscall; otherwise, they're all packed into a buffer first
-# (which was necessary on old version of linux worked).
-OLD_STYLE_MMAP = false
-
 # If you want large file summit support (greater then 2 Gib), 
 # turn this on.  This has no effect unless your kernel supports 
 # lfs.  This currently does nothing, but may someday...
index 0d470db..b02d486 100644 (file)
@@ -2,8 +2,9 @@
 /*
  * Syscalls for uClibc
  *
- * Copyright (C) 2000, 2001 by Lineo, inc.  Written by Erik Andersen
- * <andersen@lineo.com>, <andersee@debian.org>
+ * Copyright (C) 2000 by Lineo, inc
+ * Copyright (C) 2001 by Erik Andersen
+ * Written by Erik Andersen <andersen@codpoet.org>
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License as published by
index a48dcfd..4e29745 100644 (file)
@@ -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 (file)
index 0000000..a0c5825
--- /dev/null
@@ -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);
+}
+