diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-01-06 21:42:47 -0800 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-01-06 21:42:47 -0800 |
commit | 997310913d6c271b328d67795d34539a72bc6e1f (patch) | |
tree | a7a3629cb1051b2c3f5a0c7e42b2734eddb933b4 /glibc | |
parent | dfeb2d60bf9583149b517a476ff3df766b1f3b9f (diff) | |
download | riscv-gnu-toolchain-997310913d6c271b328d67795d34539a72bc6e1f.zip riscv-gnu-toolchain-997310913d6c271b328d67795d34539a72bc6e1f.tar.gz riscv-gnu-toolchain-997310913d6c271b328d67795d34539a72bc6e1f.tar.bz2 |
glibc: clean up sysdep.h and friends
Diffstat (limited to 'glibc')
-rw-r--r-- | glibc/sysdeps/riscv/Makefile | 4 | ||||
-rw-r--r-- | glibc/sysdeps/unix/riscv/rt-sysdep.c | 1 | ||||
-rw-r--r-- | glibc/sysdeps/unix/riscv/sysdep.h | 66 | ||||
-rw-r--r-- | glibc/sysdeps/unix/sysv/linux/riscv/Makefile | 4 | ||||
-rw-r--r-- | glibc/sysdeps/unix/sysv/linux/riscv/sysdep.c (renamed from glibc/sysdeps/unix/riscv/sysdep.c) | 5 | ||||
-rw-r--r-- | glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h | 56 |
6 files changed, 47 insertions, 89 deletions
diff --git a/glibc/sysdeps/riscv/Makefile b/glibc/sysdeps/riscv/Makefile index 0ffe1be..5a699a2 100644 --- a/glibc/sysdeps/riscv/Makefile +++ b/glibc/sysdeps/riscv/Makefile @@ -42,8 +42,4 @@ ifeq ($(subdir),misc) sysdep_headers += sys/asm.h endif -ifeq ($(subdir),rt) -librt-sysdep_routines += rt-sysdep -endif - ASFLAGS-.os += $(pic-ccflag) diff --git a/glibc/sysdeps/unix/riscv/rt-sysdep.c b/glibc/sysdeps/unix/riscv/rt-sysdep.c deleted file mode 100644 index 3ff5595..0000000 --- a/glibc/sysdeps/unix/riscv/rt-sysdep.c +++ /dev/null @@ -1 +0,0 @@ -#include <sysdep.c> diff --git a/glibc/sysdeps/unix/riscv/sysdep.h b/glibc/sysdeps/unix/riscv/sysdep.h deleted file mode 100644 index 6e6c20d..0000000 --- a/glibc/sysdeps/unix/riscv/sysdep.h +++ /dev/null @@ -1,66 +0,0 @@ -/* Copyright (C) 1992, 1995, 1997, 1999, 2000, 2002, 2003, 2004 - Free Software Foundation, Inc. - This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. */ - -#ifdef __ASSEMBLER__ - -#include <sys/asm.h> - -#define ENTRY(name) LEAF(name) - -#undef PSEUDO_END -#define PSEUDO_END(sym) END(sym) - -#define PSEUDO_NOERRNO(name, syscall_name, args) \ - .align 2; \ - ENTRY(name) \ - li a7, SYS_ify(syscall_name); \ - scall - -#undef PSEUDO_END_NOERRNO -#define PSEUDO_END_NOERRNO(sym) PSEUDO_END(sym) - -#define ret_NOERRNO ret - -#define PSEUDO_ERRVAL(name, syscall_name, args) \ - PSEUDO_NOERRNO(name, syscall_name, args) - -#undef PSEUDO_END_ERRVAL -#define PSEUDO_END_ERRVAL(sym) PSEUDO_END_NOERRNO(sym) - -#define ret_ERRVAL ret - -#define r0 a0 -#define r1 a1 -#define MOVE(x,y) move y , x - -#define L(label) .L ## label - -#define PSEUDO(name, syscall_name, args) \ - .align 2; \ - 99: j __syscall_error; \ - ENTRY(name) \ - li a7, SYS_ify(syscall_name); \ - scall; \ - bltz a0, 99b; \ -L(syse1): - -#endif - -#include <sysdeps/unix/sysdep.h> diff --git a/glibc/sysdeps/unix/sysv/linux/riscv/Makefile b/glibc/sysdeps/unix/sysv/linux/riscv/Makefile index 7bc7a04..6997f8c 100644 --- a/glibc/sysdeps/unix/sysv/linux/riscv/Makefile +++ b/glibc/sysdeps/unix/sysv/linux/riscv/Makefile @@ -10,3 +10,7 @@ endif ifeq ($(subdir),stdlib) gen-as-const-headers += ucontext_i.sym endif + +ifeq ($(subdir),rt) +librt-sysdep_routines += sysdep +endif diff --git a/glibc/sysdeps/unix/riscv/sysdep.c b/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.c index ac520f4..85829d9 100644 --- a/glibc/sysdeps/unix/riscv/sysdep.c +++ b/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.c @@ -1,7 +1,6 @@ -/* Copyright (C) 1992, 1993, 1994, 1997, 1998, 1999, 2000, 2002, 2003 - Free Software Foundation, Inc. +/* Copyright (C) 2015 Free Software Foundation, Inc. This file is part of the GNU C Library. - Contributed by Brendan Kehoe (brendan@zen.org). + Contributed by Andrew Waterman (waterman@cs.berkeley.edu). The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public diff --git a/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h b/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h index f598d7f..c7aff6a 100644 --- a/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h +++ b/glibc/sysdeps/unix/sysv/linux/riscv/sysdep.h @@ -18,20 +18,51 @@ #ifndef _LINUX_RISCV_SYSDEP_H #define _LINUX_RISCV_SYSDEP_H 1 -#include <sysdeps/unix/riscv/sysdep.h> #include <sysdeps/unix/sysv/linux/generic/sysdep.h> #include <tls.h> -/* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h - of the kernel. But these symbols do not follow the SYS_* syntax - so we have to redefine the `SYS_ify' macro here. */ +#ifdef __ASSEMBLER__ + +#include <sys/asm.h> + +#define ENTRY(name) LEAF(name) + +#define PSEUDO_END(sym) END(sym) + +#define PSEUDO_NOERRNO(name, syscall_name, args) \ + .align 2; \ + ENTRY(name) \ + li a7, SYS_ify(syscall_name); \ + scall + +#define ret_NOERRNO ret + +#define PSEUDO_ERRVAL(name, syscall_name, args) \ + PSEUDO_NOERRNO(name, syscall_name, args) + +#define ret_ERRVAL ret + +#define r0 a0 +#define r1 a1 +#define MOVE(x,y) move y , x + +#define L(label) .L ## label + +#define PSEUDO(name, syscall_name, args) \ + .align 2; \ + 99: j __syscall_error; \ + ENTRY(name) \ + li a7, SYS_ify(syscall_name); \ + scall; \ + bltz a0, 99b; \ +L(syse1): + +#endif /* __ASSEMBLER__ */ + +#include <sysdeps/unix/sysdep.h> + #undef SYS_ify -#ifdef __STDC__ -# define SYS_ify(syscall_name) __NR_##syscall_name -#else -# define SYS_ify(syscall_name) __NR_/**/syscall_name -#endif +#define SYS_ify(syscall_name) __NR_##syscall_name #ifndef __ASSEMBLER__ @@ -49,20 +80,15 @@ } \ result_var; }) -#undef INTERNAL_SYSCALL_DECL #define INTERNAL_SYSCALL_DECL(err) do { } while (0) -#undef INTERNAL_SYSCALL_ERROR_P #define INTERNAL_SYSCALL_ERROR_P(val, err) ((unsigned long) (val) > -4096UL) -#undef INTERNAL_SYSCALL_ERRNO #define INTERNAL_SYSCALL_ERRNO(val, err) (-val) -#undef INTERNAL_SYSCALL #define INTERNAL_SYSCALL(name, err, nr, args...) \ internal_syscall##nr (SYS_ify (name), err, args) -#undef INTERNAL_SYSCALL_NCS #define INTERNAL_SYSCALL_NCS(number, err, nr, args...) \ internal_syscall##nr (number, err, args) |