Loading...
--- Libc/Libc-583/sys/Makefile.inc
+++ Libc/Libc-262.3.2/sys/Makefile.inc
@@ -1,192 +1,66 @@
# @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
# $FreeBSD: src/lsys/Makefile.inc,v 1.91 2001/09/21 21:35:22 rwatson Exp $
+# sys sources
+.PATH: ${.CURDIR}/${MACHINE_ARCH}/sys ${.CURDIR}/sys
+
+# Include the generated makefile containing the *complete* list
+# of syscall names in MIASM.
+#.include "${.CURDIR}/../../sys/sys/syscall.mk"
+
# Include machine dependent definitions.
#
-.sinclude "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc"
-
-# sys sources
-.PATH: ${.CURDIR}/sys
-CWD := ${.CURDIR}/sys
+# MDASM names override the default syscall names in MIASM.
+# NOASM will prevent the default syscall code from being generated.
+#
+.if exists(${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc)
+.include "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc"
+.endif
# Sources common to both syscall interfaces:
+SRCS+= errno.c gettimeofday.c sigcatch.c sigsuspend.c getdtablesize.c \
+ sigaction.c sigtramp.c crt_externs.c
-MISRCS += chmod.c chmodx_np.c crt_externs.c \
- errno.c fchmod.c \
- getiopolicy_np.c getrlimit.c gettimeofday.c \
- kill.c __libc_init.c \
- mmap.c \
- openx_np.c \
- posix_spawn.c \
- remove_counter.c rename.c rmdir.c \
- select.c setrlimit.c settimeofday.c \
- sigaction.c sigcatch.c sigsuspend.c \
- sigtramp.c statx_np.c \
- umaskx_np.c unlink.c
-.ifdef FEATURE_MEM_THERM_NOTIFICATION_APIS
-MISRCS += OSMemoryNotification.c OSThermalNotification.c
-.endif
+# Add machine dependent asm sources:
+SRCS+=${MDASM}
-.if (${MACHINE_ARCH} != ppc)
-.if (${MACHINE_ARCH} != i386)
-.if (${MACHINE_ARCH} != x86_64)
-MISRCS+= context-stubs.c
+# 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). Add each
+# syscall that satisfies these conditions to the ASM list.
+.for _asm in ${MIASM}
+.if (${MDASM:R:M${_asm:R}} == "")
+.if (${NOASM:R:M${_asm:R}} == "")
+ASM+=$(_asm)
.endif
.endif
-.endif
-
-.include "Makefile.obsd_begin"
-OBSDMISRCS= stack_protector.c
-.include "Makefile.obsd_end"
-
-.ifdef FEATURE_PATCH_3375657
-# patches for sem_open() sem_unlink() shm_open() shm_unlink()
-MISRCS+= fix-3375657.c sem_open.c sem_unlink.c shm_open.c shm_unlink.c
-.endif # FEATURE_PATCH_3375657
-
-DARWINEXTSNSRCS += getgroups.c
-
-INODE32SRCS += statx_np.c
-
-CANCELABLESRCS += select.c sigsuspend.c
-
-.if defined(LP64) || (${MACHINE_ARCH} == arm)
-CANCELABLESRCS+= fcntl.c
-MISRCS+= fcntl.c ioctl.c
-.endif
-.if defined(LP64)
-PRE1050SRCS+= select.c
-.endif
-
-LEGACYSRCS += accept.c bind.c connect.c \
- getattrlist.c getpeername.c getsockname.c \
- kill.c lchown.c listen.c \
- mprotect.c msgctl.c msync.c munmap.c \
- open.c \
- recvfrom.c recvmsg.c \
- select.c semctl.c sendmsg.c sendto.c setattrlist.c \
- shmctl.c sigsuspend.c socketpair.c
-
-.for _src in msgctl.c semctl.c shmctl.c
-CFLAGS-${_src} += -DKERNEL
.endfor
-# sigtramp.c can only compile with __DARWIN_UNIX03=0 (for ppc64) because
-# the structure field names are renamed with __ prefix when __DARWIN_UNIX03=1.
-# If sigtramp.c ever needs to build variant, this will have to be fix properly
-CFLAGS-sigtramp.c = -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0
+OBJS+= ${ASM} ${PSEUDO}
-# set the LIBC_ALIAS_* macros so we can decorate the symbol independent
-# of other macro settings
-CFLAGS-accept.c += -DLIBC_ALIAS_ACCEPT
-#CFLAGS-aio_suspend.c += -DLIBC_ALIAS_AIO_SUSPEND
-CFLAGS-bind.c += -DLIBC_ALIAS_BIND
-CFLAGS-chmod.c += -DLIBC_ALIAS_CHMOD
-#CFLAGS-close.c += -DLIBC_ALIAS_CLOSE
-CFLAGS-connect.c += -DLIBC_ALIAS_CONNECT
-CFLAGS-fchmod.c += -DLIBC_ALIAS_FCHMOD
-CFLAGS-fcntl.c += -DLIBC_ALIAS_FCNTL
-#CFLAGS-fsync.c += -DLIBC_ALIAS_FSYNC
-CFLAGS-getattrlist.c += -DLIBC_ALIAS_GETATTRLIST
-CFLAGS-getpeername.c += -DLIBC_ALIAS_GETPEERNAME
-CFLAGS-getrlimit.c += -DLIBC_ALIAS_GETRLIMIT
-CFLAGS-getsockname.c += -DLIBC_ALIAS_GETSOCKNAME
-CFLAGS-kill.c += -DLIBC_ALIAS_KILL
-CFLAGS-lchmod.c += -DLIBC_ALIAS_LCHMOD
-CFLAGS-lchown.c += -DLIBC_ALIAS_LCHOWN
-CFLAGS-listen.c += -DLIBC_ALIAS_LISTEN
-CFLAGS-mmap.c += -DLIBC_ALIAS_MMAP
-CFLAGS-mprotect.c += -DLIBC_ALIAS_MPROTECT
-CFLAGS-msgctl.c += -DLIBC_ALIAS_MSGCTL
-#CFLAGS-msgrcv.c += -DLIBC_ALIAS_MSGRCV
-#CFLAGS-msgsnd.c += -DLIBC_ALIAS_MSGSND
-CFLAGS-msync.c += -DLIBC_ALIAS_MSYNC
-CFLAGS-munmap.c += -DLIBC_ALIAS_MUNMAP
-#CFLAGS-open.c += -DLIBC_ALIAS_OPEN
-#CFLAGS-poll.c += -DLIBC_ALIAS_POLL
-#CFLAGS-pread.c += -DLIBC_ALIAS_PREAD
-#CFLAGS-pwrite.c += -DLIBC_ALIAS_PWRITE
-#CFLAGS-read.c += -DLIBC_ALIAS_READ
-#CFLAGS-readv.c += -DLIBC_ALIAS_READV
-CFLAGS-recvfrom.c += -DLIBC_ALIAS_RECVFROM
-CFLAGS-recvmsg.c += -DLIBC_ALIAS_RECVMSG
-CFLAGS-select.c += -DLIBC_ALIAS_SELECT
-#CFLAGS-sem_wait.c += -DLIBC_ALIAS_SEM_WAIT
-CFLAGS-semctl.c += -DLIBC_ALIAS_SEMCTL
-CFLAGS-sendmsg.c += -DLIBC_ALIAS_SENDMSG
-CFLAGS-sendto.c += -DLIBC_ALIAS_SENDTO
-CFLAGS-setattrlist.c += -DLIBC_ALIAS_SETATTRLIST
-CFLAGS-setrlimit.c += -DLIBC_ALIAS_SETRLIMIT
-CFLAGS-shmctl.c += -DLIBC_ALIAS_SHMCTL
-CFLAGS-sigsuspend.c += -DLIBC_ALIAS_SIGSUSPEND
-CFLAGS-socketpair.c += -DLIBC_ALIAS_SOCKETPAIR
-#CFLAGS-waitid.c += -DLIBC_ALIAS_WAITID
-#CFLAGS-write.c += -DLIBC_ALIAS_WRITE
-#CFLAGS-writev.c += -DLIBC_ALIAS_WRITEV
+SASM= ${ASM:S/.o/.S/}
-COPYFILES+= ${.CURDIR}/sys/libc.syscall
+SPSEUDO= ${PSEUDO:S/.o/.S/}
+
+SRCS+= ${SASM} ${SPSEUDO}
+
+# Generated files
+CLEANFILES+= ${SASM} ${SPSEUDO}
+
+${SASM}:
+ printf '#include "SYS.h"\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
+
+${SPSEUDO}:
+ printf '#include "SYS.h"\nPSEUDO(${.PREFIX:S/_//})\n' \
+ > ${.TARGET}
.if ${LIB} == "c"
MAN2+= pthread_kill.2 pthread_sigmask.2 \
- sem_close.2 sem_open.2 sem_post.2 \
+ sem_close.2 sem_open.2 sem_post.2 sem_trywait.2 \
sem_unlink.2 sem_wait.2 shm_open.2 shm_unlink.2 \
sigwait.2 getdtablesize.2 setreuid.2 setregid.2 \
- nanosleep.2 undelete.2
-MAN3+= atomic.3 barrier.3 getiopolicy_np.3 spinlock.3 cache.3
-MLINKS+= atomic.3 OSAtomicAdd32.3
-MLINKS+= atomic.3 OSAtomicAdd32Barrier.3
-MLINKS+= atomic.3 OSAtomicAdd64.3
-MLINKS+= atomic.3 OSAtomicAdd64Barrier.3
-MLINKS+= atomic.3 OSAtomicAnd32.3
-MLINKS+= atomic.3 OSAtomicAnd32Barrier.3
-MLINKS+= atomic.3 OSAtomicAnd32Orig.3
-MLINKS+= atomic.3 OSAtomicAnd32OrigBarrier.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwap32.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwap32Barrier.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwap64.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwap64Barrier.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwapInt.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwapIntBarrier.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwapLong.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwapLongBarrier.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwapPtr.3
-MLINKS+= atomic.3 OSAtomicCompareAndSwapPtrBarrier.3
-MLINKS+= atomic.3 OSAtomicDecrement32.3
-MLINKS+= atomic.3 OSAtomicDecrement32Barrier.3
-MLINKS+= atomic.3 OSAtomicDecrement64.3
-MLINKS+= atomic.3 OSAtomicDecrement64Barrier.3
-MLINKS+= atomic.3 OSAtomicDequeue.3
-MLINKS+= atomic.3 OSAtomicEnqueue.3
-MLINKS+= atomic.3 OSAtomicIncrement32.3
-MLINKS+= atomic.3 OSAtomicIncrement32Barrier.3
-MLINKS+= atomic.3 OSAtomicIncrement64.3
-MLINKS+= atomic.3 OSAtomicIncrement64Barrier.3
-MLINKS+= atomic.3 OSAtomicOr32.3
-MLINKS+= atomic.3 OSAtomicOr32Barrier.3
-MLINKS+= atomic.3 OSAtomicOr32Orig.3
-MLINKS+= atomic.3 OSAtomicOr32OrigBarrier.3
-MLINKS+= atomic.3 OSAtomicTestAndClear.3
-MLINKS+= atomic.3 OSAtomicTestAndClearBarrier.3
-MLINKS+= atomic.3 OSAtomicTestAndSet.3
-MLINKS+= atomic.3 OSAtomicTestAndSetBarrier.3
-MLINKS+= atomic.3 OSAtomicXor32.3
-MLINKS+= atomic.3 OSAtomicXor32Barrier.3
-MLINKS+= atomic.3 OSAtomicXor32Orig.3
-MLINKS+= atomic.3 OSAtomicXor32OrigBarrier.3
-MLINKS+= barrier.3 OSMemoryBarrier.3
-
-MLINKS+= getiopolicy_np.3 setiopolicy_np.3
-
-MLINKS+= sem_wait.2 sem_trywait.2
-MLINKS+= cache.3 sys_cache_control.3
-MLINKS+= cache.3 sys_icache_invalidate.3
-MLINKS+= cache.3 sys_dcache_flush.3
-
-MLINKS+= spinlock.3 OSSpinLockLock.3 \
- spinlock.3 OSSpinLockTry.3 \
- spinlock.3 OSSpinLockUnlock.3
-
+ nanosleep.2
#MAN+= _exit.2 accept.2 access.2 acct.2 adjtime.2 \
# aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \
# aio_suspend.2 aio_waitcomplete.2 aio_write.2 \
@@ -201,7 +75,7 @@
# getsockopt.2 gettimeofday.2 getuid.2 \
# intro.2 ioctl.2 issetugid.2 jail.2 kill.2 \
# kldfind.2 kldfirstmod.2 kldload.2 kldnext.2 kldstat.2 kldsym.2 \
-# kldunload.2 kqueue.2 link.2 listen.2 lseek.2 \
+# kldunload.2 ktrace.2 kqueue.2 link.2 listen.2 lseek.2 \
# madvise.2 mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 mmap.2 \
# modfind.2 modnext.2 modstat.2 \
# mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \