* Add WSYSCALL() to SYS.h, which creates a system call with an

internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
This commit is contained in:
thorpej 2002-01-14 00:55:55 +00:00
parent 0ff3653797
commit ac8c1c29e9
14 changed files with 125 additions and 31 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.7 2000/06/14 06:49:01 cgd Exp $ */
/* $NetBSD: SYS.h,v 1.8 2002/01/14 00:55:55 thorpej Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
@ -49,18 +49,6 @@ LEAF(name,0); /* XXX # of args? */ \
LEAF(name,0); /* XXX # of args? */ \
CALLSYS_NOERROR(name)
#define RSYSCALL(name) \
SYSCALL(name); \
RET; \
END(name)
#define RSYSCALL_NOERROR(name) \
SYSCALL_NOERROR(name); \
RET; \
END(name)
#define PSEUDO(label,name) \
LEAF(label,0); /* XXX # of args? */ \
CALLSYS_ERROR(name); \
@ -72,3 +60,17 @@ LEAF(label,0); /* XXX # of args? */ \
CALLSYS_NOERROR(name); \
RET; \
END(label);
#define RSYSCALL(name) \
SYSCALL(name); \
RET; \
END(name)
#define RSYSCALL_NOERROR(name) \
SYSCALL_NOERROR(name); \
RET; \
END(name)
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.2 2001/07/16 05:50:05 matt Exp $ */
/* $NetBSD: SYS.h,v 1.3 2002/01/14 00:55:55 thorpej Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -97,4 +97,13 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
PSEUDO(weak,weak)
#endif
.globl CERROR

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
* $NetBSD: SYS.h,v 1.15 2000/02/19 21:04:58 mycroft Exp $
* $NetBSD: SYS.h,v 1.16 2002/01/14 00:55:55 thorpej Exp $
*/
#include <machine/asm.h>
@ -95,5 +95,13 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
PSEUDO(weak,weak)
#endif
.globl CERROR

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.12 1999/10/25 23:48:07 thorpej Exp $ */
/* $NetBSD: SYS.h,v 1.13 2002/01/14 00:55:55 thorpej Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -86,7 +86,16 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
PSEUDO(weak,weak)
#endif
#define ASMSTR .asciz
.globl CERROR

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.12 2000/03/23 04:58:59 mycroft Exp $ */
/* $NetBSD: SYS.h,v 1.13 2002/01/14 00:55:55 thorpej Exp $ */
/*-
* Copyright (c) 1996 Jonathan STone
@ -109,6 +109,12 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
/*
* Do a syscall that has an internal name and a weak external alias.
*/
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
/*
* Do a renamed or pseudo syscall (e.g., _exit()), where the entrypoint

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.10 2000/12/29 23:16:42 matthias Exp $ */
/* $NetBSD: SYS.h,v 1.11 2002/01/14 00:55:56 thorpej Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@ -76,6 +76,15 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
PSEUDO(weak,weak)
#endif
#define CALL(x,y) \
bsr _C_LABEL(y); \
adjspd -4*x

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.7 1999/01/14 22:48:21 kleink Exp $ */
/* $NetBSD: SYS.h,v 1.8 2002/01/14 00:55:56 thorpej Exp $ */
#include <machine/asm.h>
#include <sys/syscall.h>
@ -36,3 +36,6 @@
#define RSYSCALL_NOERROR(x) PSEUDO_NOERROR(x,x)
#define RSYSCALL(x) PSEUDO(x,x)
#define WSYSCALL(weak,strong) WEAK_ALIAS(weak,strong) ;\
PSEUDO(strong,weak)

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
* $NetBSD: SYS.h,v 1.1 2000/01/05 14:07:30 msaitoh Exp $
* $NetBSD: SYS.h,v 1.2 2002/01/14 00:55:56 thorpej Exp $
*/
#include <machine/asm.h>
@ -99,4 +99,13 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
PSEUDO(weak,weak)
#endif
.globl cerror

View File

@ -37,7 +37,7 @@
* @(#)SYS.h 8.1 (Berkeley) 6/4/93
*
* from: Header: SYS.h,v 1.2 92/07/03 18:57:00 torek Exp
* $NetBSD: SYS.h,v 1.11 2001/07/23 01:40:33 christos Exp $
* $NetBSD: SYS.h,v 1.12 2002/01/14 00:55:56 thorpej Exp $
*/
#include <machine/asm.h>
@ -99,6 +99,19 @@
ENTRY(x); mov (_CAT(SYS_,y))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \
t ST_SYSCALL; ERROR()
/*
* WSYSCALL(weak,strong) is like RSYSCALL(weak), except that weak is
* a weak internal alias for the strong symbol.
*/
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
RSYSCALL(weak)
#endif
/*
* SYSCALL_NOERROR is like SYSCALL, except it's used for syscalls
* that never fail.

View File

@ -37,7 +37,7 @@
* @(#)SYS.h 8.1 (Berkeley) 6/4/93
*
* from: Header: SYS.h,v 1.2 92/07/03 18:57:00 torek Exp
* $NetBSD: SYS.h,v 1.6 2001/07/23 07:26:50 thorpej Exp $
* $NetBSD: SYS.h,v 1.7 2002/01/14 00:55:56 thorpej Exp $
*/
#include <machine/asm.h>
@ -96,6 +96,14 @@
ENTRY(x); mov (_CAT(SYS_,y))|SYSCALL_G2RFLAG,%g1; add %o7,8,%g2; \
t ST_SYSCALL; ERROR()
/*
* WSYSCALL(weak,strong) is like RSYSCALL(weak), except that weak is
* a weak internal alias for the strong symbol.
*/
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
/*
* SYSCALL_NOERROR is like SYSCALL, except it's used for syscalls
* that never fail.

View File

@ -1,4 +1,4 @@
/* $NetBSD: SYS.h,v 1.6 2000/06/28 19:20:16 matt Exp $ */
/* $NetBSD: SYS.h,v 1.7 2002/01/14 00:55:57 thorpej Exp $ */
/*
* Copyright (c) 1983, 1993
* The Regents of the University of California. All rights reserved.
@ -72,6 +72,15 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#ifdef WEAK_ALIAS
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
#else
#define WSYSCALL(weak,strong) \
PSEUDO(weak,weak)
#endif
#define ASMSTR .asciz
#ifdef __ELF__

View File

@ -34,7 +34,7 @@
* SUCH DAMAGE.
*
* from: @(#)SYS.h 5.5 (Berkeley) 5/7/91
* $NetBSD: SYS.h,v 1.1 2001/06/19 00:25:01 fvdl Exp $
* $NetBSD: SYS.h,v 1.2 2002/01/14 00:55:57 thorpej Exp $
*/
/*
@ -92,5 +92,8 @@
#define RSYSCALL(x) \
PSEUDO(x,x)
#define WSYSCALL(weak,strong) \
WEAK_ALIAS(weak,strong); \
PSEUDO(strong,weak)
.globl CERROR

View File

@ -1,4 +1,4 @@
/* $NetBSD: namespace.h,v 1.68 2002/01/13 21:45:52 thorpej Exp $ */
/* $NetBSD: namespace.h,v 1.69 2002/01/14 00:55:57 thorpej Exp $ */
/*-
* Copyright (c) 1997, 1998 The NetBSD Foundation, Inc.
@ -469,6 +469,7 @@
#define svcudp_create _svcudp_create
#define svcudp_enablecache _svcudp_enablecache
#define svis _svis
#define sysarch _sysarch
#define sysctl _sysctl
#define syslog _syslog
#define tcdrain _tcdrain

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.inc,v 1.122 2001/11/13 19:16:41 tv Exp $
# $NetBSD: Makefile.inc,v 1.123 2002/01/14 00:55:57 thorpej Exp $
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
# sys sources
@ -65,22 +65,27 @@ ASM= accept.S access.S acct.S bind.S chdir.S chflags.S \
__shmctl13.S shmdt.S shmget.S shutdown.S __sigaction14.S \
__sigaltstack14.S __sigpending14.S __sigprocmask14.S __sigsuspend14.S \
socket.S socketpair.S __stat13.S statfs.S \
swapctl.S symlink.S sysarch.S umask.S undelete.S unlink.S \
swapctl.S symlink.S umask.S undelete.S unlink.S \
unmount.S utimes.S utrace.S vadvise.S wait4.S write.S writev.S \
__sysctl.S \
__posix_chown.S __posix_fchown.S __posix_lchown.S __posix_rename.S
WEAKASM= sysarch.S
NOERR= getegid.S geteuid.S getgid.S getpid.S getppid.S getuid.S \
issetugid.S sync.S
PSEUDONOERR= _exit.S
SRCS+= ${ASM} ${NOERR} ${PSEUDONOERR}
CLEANFILES+= ${ASM} ${NOERR} ${PSEUDONOERR}
SRCS+= ${ASM} ${WEAKASM} ${NOERR} ${PSEUDONOERR}
CLEANFILES+= ${ASM} ${WEAKASM} ${NOERR} ${PSEUDONOERR}
${ASM}: ${ARCHDIR}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' >${.TARGET}
${WEAKASM}: ${ARCHDIR}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
printf '#include "SYS.h"\nWSYSCALL(${.PREFIX},_${.PREFIX})\n' >${.TARGET}
${NOERR}: ${ARCHDIR}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
printf '#include "SYS.h"\nRSYSCALL_NOERROR(${.PREFIX})\n' >${.TARGET}
@ -90,7 +95,7 @@ ${PSEUDONOERR}: ${ARCHDIR}/SYS.h ${DESTDIR}/usr/include/sys/syscall.h
LintSysNormal.c: ${.CURDIR}/sys/makelintstub \
${DESTDIR}/usr/include/sys/syscall.h
sh ${.CURDIR}/sys/makelintstub -o ${.TARGET} \
-s ${DESTDIR}/usr/include/sys/syscall.h ${ASM}
-s ${DESTDIR}/usr/include/sys/syscall.h ${ASM} ${WEAKASM}
LintSysNoerr.c: ${.CURDIR}/sys/makelintstub \
${DESTDIR}/usr/include/sys/syscall.h