summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorjb <jb@FreeBSD.org>1998-03-09 07:22:12 +0000
committerjb <jb@FreeBSD.org>1998-03-09 07:22:12 +0000
commit1078515ef6ee623deb58e2fd34643c80cde1e41d (patch)
treeb42780c832974167cb6c22aa1db7f3aba0807858 /lib
parenta949c65da4599185f1c67836865bef4945521f0e (diff)
downloadFreeBSD-src-1078515ef6ee623deb58e2fd34643c80cde1e41d.zip
FreeBSD-src-1078515ef6ee623deb58e2fd34643c80cde1e41d.tar.gz
Yikes, this is the worst of the lot. Bruce suggested doing this (!).
Include the architecture specific sys makefile like previously, but what this contains differs. It defines MDASM which list architecture specific asm code that *replaces* syscalls of the same name defined in MIASM (which gets defined by the syscall.mk or netbsd_syscall.mk dependent of NETBSD_SYSCALLS being defined). If a syscall has a C source implementation or something funny done to it, or just doesn't need default asm source generated for it, then it is listed in NOASM. syscall.mk is generated by makesyscalls.sh with other syscall files. netbsd_syscall.mk is a hand-generated equivalent. So if a new syscall is added and no other makefiles are edited, it will automatically have the default asm source generated for it (whether you want it or not). Anything listed in MDASM gets added to SRCS and gets built. For each syscall name in MIASM, if it doesn't exist in MDASM or NOASM, it gets added to the ASM or ASMR lists to have code generated for it. If the syscall name was listed in HIDDEN_SYSCALLS (intended for use by libc_r, not libc which has it defined, but empty), then the name is added to the ASMR list and gets renamed before being built; otherwise it is added to the ASM list and gets built with the same name. I wonder if this is too complicated. But it works on both i386 and alpha.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/sys/Makefile.inc105
1 files changed, 47 insertions, 58 deletions
diff --git a/lib/libc/sys/Makefile.inc b/lib/libc/sys/Makefile.inc
index e1797a3..885f64f 100644
--- a/lib/libc/sys/Makefile.inc
+++ b/lib/libc/sys/Makefile.inc
@@ -2,64 +2,53 @@
# $Id: Makefile.inc,v 1.45 1998/01/31 05:53:57 imp Exp $
# sys sources
-.PATH: ${.CURDIR}/../libc/${MACHINE}/sys ${.CURDIR}/../libc/sys
-
-.include "${.CURDIR}/../libc/${MACHINE}/sys/Makefile.inc"
-
-# modules with non-default implementations on at least one architecture:
-SRCS+= Ovfork.S brk.S cerror.S exect.S fork.S pipe.S ptrace.S reboot.S \
- rfork.S sbrk.S setlogin.S sigpending.S sigprocmask.S sigreturn.S \
- sigsuspend.S syscall.S
-
-# glue to provide compatibility between GCC 1.X and 2.X
-SRCS+= ftruncate.c lseek.c mmap.c truncate.c
-
-# modules with default implementations on all architectures:
-ASM= __getcwd.o __syscall.o __sysctl.o \
- access.o acct.o adjtime.o \
- aio_cancel.o aio_error.o aio_read.o aio_return.o aio_suspend.o \
- aio_write.o \
- chdir.o chflags.o chmod.o chown.o chroot.o \
- clock_getres.o clock_gettime.o clock_settime.o \
- getdtablesize.o getegid.o \
- geteuid.o getfh.o getfsstat.o getgid.o getgroups.o getitimer.o \
- getpgrp.o getpgid.o getpid.o getppid.o getpriority.o \
- getrlimit.o getrusage.o getsid.o gettimeofday.o \
- getuid.o issetugid.o kill.o \
- kldfind.o kldfirstmod.o kldload.o kldnext.o kldstat.o kldunload.o \
- ktrace.o lchown.o \
- link.o lio_listio.o lstat.o \
- madvise.o mincore.o minherit.o mkdir.o mlock.o \
- modfind.o modfnext.o modnext.o modstat.o \
- mount.o \
- mprotect.o msgsys.o msync.o munlock.o munmap.o \
- ntp_adjtime.o pathconf.o profil.o quotactl.o \
- readlink.o rename.o revoke.o rmdir.o \
- rtprio.o semsys.o setegid.o seteuid.o setgid.o \
- setgroups.o setitimer.o setpgid.o setpriority.o \
- setregid.o setreuid.o setrlimit.o \
- setsid.o settimeofday.o setuid.o shmsys.o \
- stat.o statfs.o \
- swapon.o symlink.o sync.o sysarch.o \
- umask.o undelete.o unlink.o unmount.o utimes.o utrace.o \
- vadvise.o
-
-# Syscalls renamed as _thread_sys_{syscall} when building libc_r.
-ASMR= accept.o bind.o close.o connect.o dup.o dup2.o \
- execve.o fchdir.o fchflags.o fchmod.o fchown.o fcntl.o \
- flock.o fpathconf.o fstat.o fstatfs.o fsync.o getdirentries.o \
- getpeername.o getsockname.o getsockopt.o ioctl.o listen.o \
- mkfifo.o mknod.o nanosleep.o nfssvc.o open.o poll.o read.o readv.o \
- recvfrom.o recvmsg.o select.o sendmsg.o sendto.o setsockopt.o \
- shutdown.o sigaction.o sigaltstack.o signanosleep.o socket.o \
- socketpair.o \
- wait4.o write.o writev.o
-
-PSEUDO= _getlogin.o
-
-# Pseudo syscalls that are renamed as _thread_sys_{pseudo} when
-# building libc_r.
-PSEUDOR= _exit.o
+.PATH: ${.CURDIR}/../libc/${MACHINE_ARCH}/sys ${.CURDIR}/../libc/sys
+
+# Include the generated makefile containing the *complete* list
+# of syscall names in MIASM.
+.if defined(NETBSD_SYSCALLS)
+.include "${.CURDIR}/../../sys/sys/netbsd_syscall.mk"
+.else
+.include "${.CURDIR}/../../sys/sys/syscall.mk"
+.endif
+
+# Include machine dependent definitions.
+#
+# MDASM names override the default syscall names in MIASM.
+# NOASM will prevent the default syscall code from being generated.
+#
+.include "${.CURDIR}/../libc/${MACHINE_ARCH}/sys/Makefile.inc"
+
+# If using the NetBSD syscall interface add sources that convert
+# the NetBSD interface to the one FreeBSD expects:
+.if defined(NETBSD_SYSCALLS)
+SRCS+= netbsd_getdirentries.c netbsd_stat.c
+.endif
+
+# Sources common to both syscall interfaces:
+SRCS+= __error.c ftruncate.c lseek.c mmap.c truncate.c
+
+# Add machine dependent asm sources:
+SRCS+=${MDASM}
+
+# Look though the complete list of syscalls (MIASM) for names that are
+# not defined with machine dependent implementations (MDASM) and are
+# not declared for no generation of default code (NOASM). If the
+# syscall is not hidden, add it to the ASM list, otherwise add it
+# to the ASMR list.
+.for _asm in ${MIASM}
+.if (${MDASM:R:M${_asm:R}} == "")
+.if (${NOASM:R:M${_asm:R}} == "")
+.if (${HIDDEN_SYSCALLS:R:M${_asm:R}} == "")
+ASM+=$(_asm)
+.else
+ASMR+=$(_asm)
+.endif
+.endif
+.endif
+.endfor
+
+OBJS+= ${ASM} ${ASMR} ${PSEUDO} ${PSEUDOR}
SASM= ${ASM:S/.o/.S/}
OpenPOWER on IntegriCloud