summaryrefslogtreecommitdiffstats
path: root/lib/libc/i386
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2001-01-29 03:23:46 +0000
committerdeischen <deischen@FreeBSD.org>2001-01-29 03:23:46 +0000
commitca55abf319c2f815cb2c84655b25482829c1646d (patch)
treeffdfffc17ec6466cc6f96dfd93691c69a11f422c /lib/libc/i386
parent99d951b8404ce6f969ceda268a00bfe5f17d43e2 (diff)
downloadFreeBSD-src-ca55abf319c2f815cb2c84655b25482829c1646d.zip
FreeBSD-src-ca55abf319c2f815cb2c84655b25482829c1646d.tar.gz
Clean up syscall generation in libc by removing HIDDEN_SYSCALLS
and treating (almost) all system calls the same way: __sys_foo - actual syscall foo, _foo - weak definitions to __sys_foo Change PSEUDO syscalls (currently only _exit and _getlogin) to be __sys_foo (T) and _foo (W). Add $FreeBSD$ to a few files to satisfy commitprep. Suggested by: bde
Diffstat (limited to 'lib/libc/i386')
-rw-r--r--lib/libc/i386/SYS.h37
-rw-r--r--lib/libc/i386/sys/Makefile.inc6
-rw-r--r--lib/libc/i386/sys/fork.S2
-rw-r--r--lib/libc/i386/sys/pipe.S2
-rw-r--r--lib/libc/i386/sys/rfork.S2
-rw-r--r--lib/libc/i386/sys/sigreturn.S2
6 files changed, 11 insertions, 40 deletions
diff --git a/lib/libc/i386/SYS.h b/lib/libc/i386/SYS.h
index 2d58562..ba56bce 100644
--- a/lib/libc/i386/SYS.h
+++ b/lib/libc/i386/SYS.h
@@ -42,32 +42,6 @@
#include "DEFS.h"
#define SYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \
- ENTRY(__CONCAT(_,x)); \
- .weak CNAME(x); \
- .set CNAME(x),CNAME(__CONCAT(_,x)); \
- lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
-
-#define RSYSCALL(x) SYSCALL(x); ret
-
-#define PSEUDO(x,y) ENTRY(__CONCAT(_,x)); \
- .weak CNAME(x); \
- .set CNAME(x),CNAME(__CONCAT(_,x)); \
- lea __CONCAT(SYS_,y), %eax; KERNCALL; ret
-
-/* gas messes up offset -- although we don't currently need it, do for BCS */
-#define LCALL(x,y) .byte 0x9a ; .long y; .word x
-
-/*
- * Design note:
- *
- * The macros PSYSCALL() and PRSYSCALL() are intended for use where a
- * syscall needs to be renamed in the threaded library.
- */
-/*
- * For the thread_safe versions, we prepend __sys_ to the function
- * name so that the 'C' wrapper can go around the real name.
- */
-#define PSYSCALL(x) 2: PIC_PROLOGUE; jmp PIC_PLT(HIDENAME(cerror)); \
ENTRY(__CONCAT(__sys_,x)); \
.weak CNAME(x); \
.set CNAME(x),CNAME(__CONCAT(__sys_,x)); \
@@ -75,14 +49,15 @@
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
lea __CONCAT(SYS_,x),%eax; KERNCALL; jb 2b
-#define PRSYSCALL(x) PSYSCALL(x); ret
+#define RSYSCALL(x) SYSCALL(x); ret
-#define PPSEUDO(x,y) ENTRY(__CONCAT(__sys_,x)); \
- .weak CNAME(x); \
- .set CNAME(x),CNAME(__CONCAT(__sys_,x)); \
+#define PSEUDO(x) ENTRY(__CONCAT(__sys_,x)); \
.weak CNAME(__CONCAT(_,x)); \
.set CNAME(__CONCAT(_,x)),CNAME(__CONCAT(__sys_,x)); \
- lea __CONCAT(SYS_,y), %eax; KERNCALL; ret
+ lea __CONCAT(SYS_,x), %eax; KERNCALL; ret
+
+/* gas messes up offset -- although we don't currently need it, do for BCS */
+#define LCALL(x,y) .byte 0x9a ; .long y; .word x
#ifdef __ELF__
#define KERNCALL int $0x80 /* Faster */
diff --git a/lib/libc/i386/sys/Makefile.inc b/lib/libc/i386/sys/Makefile.inc
index 4a60875..98d9deb 100644
--- a/lib/libc/i386/sys/Makefile.inc
+++ b/lib/libc/i386/sys/Makefile.inc
@@ -14,11 +14,7 @@ NOASM= __semctl.o break.o exit.o ftruncate.o getdomainname.o getlogin.o \
semop.o setdomainname.o shmat.o shmctl.o shmdt.o shmget.o sstk.o \
truncate.o uname.o vfork.o yield.o
-PSEUDO= _getlogin.o
-
-# Pseudo syscalls that are renamed as __sys_{pseudo} so that libc_r can
-# override them with replacements.
-PSEUDOR= _exit.o
+PSEUDO= _getlogin.o _exit.o
.if ${LIB} == "c"
MAN2+= i386_get_ioperm.2 i386_get_ldt.2 i386_vm86.2
diff --git a/lib/libc/i386/sys/fork.S b/lib/libc/i386/sys/fork.S
index 6c3cde8..203f739 100644
--- a/lib/libc/i386/sys/fork.S
+++ b/lib/libc/i386/sys/fork.S
@@ -43,7 +43,7 @@
#include "SYS.h"
-PSYSCALL(fork)
+SYSCALL(fork)
cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */
je 1f
movl $0,%eax
diff --git a/lib/libc/i386/sys/pipe.S b/lib/libc/i386/sys/pipe.S
index 1684611..fca1187 100644
--- a/lib/libc/i386/sys/pipe.S
+++ b/lib/libc/i386/sys/pipe.S
@@ -43,7 +43,7 @@
#include "SYS.h"
-PSYSCALL(pipe)
+SYSCALL(pipe)
movl 4(%esp),%ecx
movl %eax,(%ecx)
movl %edx,4(%ecx)
diff --git a/lib/libc/i386/sys/rfork.S b/lib/libc/i386/sys/rfork.S
index b3e20e4..c5971c6 100644
--- a/lib/libc/i386/sys/rfork.S
+++ b/lib/libc/i386/sys/rfork.S
@@ -43,7 +43,7 @@
#include "SYS.h"
-PSYSCALL(rfork)
+SYSCALL(rfork)
cmpl $0,%edx /* parent, since %edx == 0 in parent, 1 in child */
je 1f
movl $0,%eax
diff --git a/lib/libc/i386/sys/sigreturn.S b/lib/libc/i386/sys/sigreturn.S
index 7405c34..449149f 100644
--- a/lib/libc/i386/sys/sigreturn.S
+++ b/lib/libc/i386/sys/sigreturn.S
@@ -48,5 +48,5 @@
* must be saved. On FreeBSD, this is not the case.
*/
-PSYSCALL(sigreturn)
+SYSCALL(sigreturn)
ret
OpenPOWER on IntegriCloud