1 # @(#)Makefile.inc 8.3 (Berkeley) 10/24/94
2 # $FreeBSD: src/lsys/Makefile.inc,v 1.91 2001/09/21 21:35:22 rwatson Exp $
4 # Include machine dependent definitions.
6 # MDASM names override the default syscall names in MIASM.
7 # NOASM will prevent the default syscall code from being generated.
9 .sinclude "${.CURDIR}/${MACHINE_ARCH}/sys/Makefile.inc"
15 # Include the generated makefile containing the *complete* list
16 # of syscall names in MIASM.
17 #.include "${.CURDIR}/../../sys/sys/syscall.mk"
19 # Sources common to both syscall interfaces:
21 MISRCS += chmod.c chmodx_np.c crt_externs.c \
23 getiopolicy_np.c getrlimit.c gettimeofday.c \
24 kill.c __libc_init.c \
28 select.c sem_open.c sem_unlink.c semctl.c \
30 shm_open.c shm_unlink.c sigaction.c sigcatch.c sigsuspend.c \
31 sigtramp.c statx_np.c \
34 .ifdef FEATURE_MEM_THERM_NOTIFICATION_APIS
35 MISRCS += OSMemoryNotification.c OSThermalNotification.c
38 .if (${MACHINE_ARCH} != ppc)
39 .if (${MACHINE_ARCH} != i386)
40 MISRCS+= context-stubs.c
44 .include "Makefile.obsd_begin"
45 OBSDMISRCS= stack_protector.c
46 .include "Makefile.obsd_end"
48 .ifdef FEATURE_PATCH_3375657
49 # patches for sem_open() sem_unlink() shm_open() shm_unlink()
50 MISRCS+= fix-3375657.c
51 .endif # FEATURE_PATCH_3375657
53 INODE32SRCS += statx_np.c
55 CANCELABLESRCS += select.c sigsuspend.c
57 .if defined(LP64) || (${MACHINE_ARCH} == arm)
58 CANCELABLESRCS+= fcntl.c
59 MISRCS+= fcntl.c ioctl.c
60 PRE1050SRCS+= select.c
63 LEGACYSRCS += accept.c bind.c connect.c \
64 getattrlist.c getpeername.c getsockname.c \
65 kill.c lchown.c listen.c \
66 mprotect.c msgctl.c msync.c munmap.c \
68 recvfrom.c recvmsg.c \
69 select.c semctl.c sendmsg.c sendto.c setattrlist.c \
70 shmctl.c sigsuspend.c socketpair.c
72 # we need to create open.h, which just contains a definition for O_NOCTTY
73 open.${OBJSUFFIX}: open.h
75 ${CC} -E -dD ${CFLAGS} -include fcntl.h -x c /dev/null | grep O_NOCTTY > ${.TARGET}
77 .for _src in msgctl.c semctl.c shmctl.c
78 CFLAGS-${_src} += -DKERNEL
81 # sigtramp.c can only compile with __DARWIN_UNIX03=0 (for ppc64) because
82 # the structure field names are renamed with __ prefix when __DARWIN_UNIX03=1.
83 # If sigtramp.c ever needs to build variant, this will have to be fix properly
84 CFLAGS-sigtramp.c = -U__DARWIN_UNIX03 -D__DARWIN_UNIX03=0
86 # set the LIBC_ALIAS_* macros so we can decorate the symbol independent
87 # of other macro settings
88 CFLAGS-accept.c += -DLIBC_ALIAS_ACCEPT
89 #CFLAGS-aio_suspend.c += -DLIBC_ALIAS_AIO_SUSPEND
90 CFLAGS-bind.c += -DLIBC_ALIAS_BIND
91 CFLAGS-chmod.c += -DLIBC_ALIAS_CHMOD
92 #CFLAGS-close.c += -DLIBC_ALIAS_CLOSE
93 CFLAGS-connect.c += -DLIBC_ALIAS_CONNECT
94 CFLAGS-fchmod.c += -DLIBC_ALIAS_FCHMOD
95 CFLAGS-fcntl.c += -DLIBC_ALIAS_FCNTL
96 #CFLAGS-fsync.c += -DLIBC_ALIAS_FSYNC
97 CFLAGS-getattrlist.c += -DLIBC_ALIAS_GETATTRLIST
98 CFLAGS-getpeername.c += -DLIBC_ALIAS_GETPEERNAME
99 CFLAGS-getrlimit.c += -DLIBC_ALIAS_GETRLIMIT
100 CFLAGS-getsockname.c += -DLIBC_ALIAS_GETSOCKNAME
101 CFLAGS-kill.c += -DLIBC_ALIAS_KILL
102 CFLAGS-lchmod.c += -DLIBC_ALIAS_LCHMOD
103 CFLAGS-lchown.c += -DLIBC_ALIAS_LCHOWN
104 CFLAGS-listen.c += -DLIBC_ALIAS_LISTEN
105 CFLAGS-mmap.c += -DLIBC_ALIAS_MMAP
106 CFLAGS-mprotect.c += -DLIBC_ALIAS_MPROTECT
107 CFLAGS-msgctl.c += -DLIBC_ALIAS_MSGCTL
108 #CFLAGS-msgrcv.c += -DLIBC_ALIAS_MSGRCV
109 #CFLAGS-msgsnd.c += -DLIBC_ALIAS_MSGSND
110 CFLAGS-msync.c += -DLIBC_ALIAS_MSYNC
111 CFLAGS-munmap.c += -DLIBC_ALIAS_MUNMAP
112 CFLAGS-open.c += -DLIBC_ALIAS_OPEN
113 #CFLAGS-poll.c += -DLIBC_ALIAS_POLL
114 #CFLAGS-pread.c += -DLIBC_ALIAS_PREAD
115 #CFLAGS-pwrite.c += -DLIBC_ALIAS_PWRITE
116 #CFLAGS-read.c += -DLIBC_ALIAS_READ
117 #CFLAGS-readv.c += -DLIBC_ALIAS_READV
118 CFLAGS-recvfrom.c += -DLIBC_ALIAS_RECVFROM
119 CFLAGS-recvmsg.c += -DLIBC_ALIAS_RECVMSG
120 CFLAGS-select.c += -DLIBC_ALIAS_SELECT
121 #CFLAGS-sem_wait.c += -DLIBC_ALIAS_SEM_WAIT
122 CFLAGS-semctl.c += -DLIBC_ALIAS_SEMCTL
123 CFLAGS-sendmsg.c += -DLIBC_ALIAS_SENDMSG
124 CFLAGS-sendto.c += -DLIBC_ALIAS_SENDTO
125 CFLAGS-setattrlist.c += -DLIBC_ALIAS_SETATTRLIST
126 CFLAGS-setrlimit.c += -DLIBC_ALIAS_SETRLIMIT
127 CFLAGS-shmctl.c += -DLIBC_ALIAS_SHMCTL
128 CFLAGS-sigsuspend.c += -DLIBC_ALIAS_SIGSUSPEND
129 CFLAGS-socketpair.c += -DLIBC_ALIAS_SOCKETPAIR
130 #CFLAGS-waitid.c += -DLIBC_ALIAS_WAITID
131 #CFLAGS-write.c += -DLIBC_ALIAS_WRITE
132 #CFLAGS-writev.c += -DLIBC_ALIAS_WRITEV
134 # Add machine dependent asm sources:
137 # Look though the complete list of syscalls (MIASM) for names that are
138 # not defined with machine dependent implementations (MDASM) and are
139 # not declared for no generation of default code (NOASM). Add each
140 # syscall that satisfies these conditions to the ASM list.
141 .for _asm in ${MIASM}
142 .if (${MDASM:R:M${_asm:R}} == "")
143 .if (${NOASM:R:M${_asm:R}} == "")
149 OBJS+= ${ASM} ${PSEUDO}
151 SASM= ${ASM:S/.o/.S/}
153 SPSEUDO= ${PSEUDO:S/.o/.S/}
155 SRCS+= ${SASM} ${SPSEUDO}
158 CLEANFILES+= ${SASM} ${SPSEUDO}
161 printf '#include <SYS.h>\nRSYSCALL(${.PREFIX})\n' > ${.TARGET}
164 printf '#include <SYS.h>\nPSEUDO(${.PREFIX:S/_//})\n' \
167 COPYFILES+= ${.CURDIR}/sys/libc.syscall
170 MAN2+= pthread_kill.2 pthread_sigmask.2 \
171 sem_close.2 sem_open.2 sem_post.2 \
172 sem_unlink.2 sem_wait.2 shm_open.2 shm_unlink.2 \
173 sigwait.2 getdtablesize.2 setreuid.2 setregid.2 \
174 nanosleep.2 undelete.2
175 MAN3+= atomic.3 barrier.3 getiopolicy_np.3 spinlock.3 cache.3
176 MLINKS+= atomic.3 OSAtomicAdd32.3
177 MLINKS+= atomic.3 OSAtomicAdd32Barrier.3
178 MLINKS+= atomic.3 OSAtomicAdd64.3
179 MLINKS+= atomic.3 OSAtomicAdd64Barrier.3
180 MLINKS+= atomic.3 OSAtomicAnd32.3
181 MLINKS+= atomic.3 OSAtomicAnd32Barrier.3
182 MLINKS+= atomic.3 OSAtomicAnd32Orig.3
183 MLINKS+= atomic.3 OSAtomicAnd32OrigBarrier.3
184 MLINKS+= atomic.3 OSAtomicCompareAndSwap32.3
185 MLINKS+= atomic.3 OSAtomicCompareAndSwap32Barrier.3
186 MLINKS+= atomic.3 OSAtomicCompareAndSwap64.3
187 MLINKS+= atomic.3 OSAtomicCompareAndSwap64Barrier.3
188 MLINKS+= atomic.3 OSAtomicCompareAndSwapInt.3
189 MLINKS+= atomic.3 OSAtomicCompareAndSwapIntBarrier.3
190 MLINKS+= atomic.3 OSAtomicCompareAndSwapLong.3
191 MLINKS+= atomic.3 OSAtomicCompareAndSwapLongBarrier.3
192 MLINKS+= atomic.3 OSAtomicCompareAndSwapPtr.3
193 MLINKS+= atomic.3 OSAtomicCompareAndSwapPtrBarrier.3
194 MLINKS+= atomic.3 OSAtomicDecrement32.3
195 MLINKS+= atomic.3 OSAtomicDecrement32Barrier.3
196 MLINKS+= atomic.3 OSAtomicDecrement64.3
197 MLINKS+= atomic.3 OSAtomicDecrement64Barrier.3
198 MLINKS+= atomic.3 OSAtomicDequeue.3
199 MLINKS+= atomic.3 OSAtomicEnqueue.3
200 MLINKS+= atomic.3 OSAtomicIncrement32.3
201 MLINKS+= atomic.3 OSAtomicIncrement32Barrier.3
202 MLINKS+= atomic.3 OSAtomicIncrement64.3
203 MLINKS+= atomic.3 OSAtomicIncrement64Barrier.3
204 MLINKS+= atomic.3 OSAtomicOr32.3
205 MLINKS+= atomic.3 OSAtomicOr32Barrier.3
206 MLINKS+= atomic.3 OSAtomicOr32Orig.3
207 MLINKS+= atomic.3 OSAtomicOr32OrigBarrier.3
208 MLINKS+= atomic.3 OSAtomicTestAndClear.3
209 MLINKS+= atomic.3 OSAtomicTestAndClearBarrier.3
210 MLINKS+= atomic.3 OSAtomicTestAndSet.3
211 MLINKS+= atomic.3 OSAtomicTestAndSetBarrier.3
212 MLINKS+= atomic.3 OSAtomicXor32.3
213 MLINKS+= atomic.3 OSAtomicXor32Barrier.3
214 MLINKS+= atomic.3 OSAtomicXor32Orig.3
215 MLINKS+= atomic.3 OSAtomicXor32OrigBarrier.3
216 MLINKS+= barrier.3 OSMemoryBarrier.3
218 MLINKS+= getiopolicy_np.3 setiopolicy_np.3
220 MLINKS+= sem_wait.2 sem_trywait.2
221 MLINKS+= cache.3 sys_cache_control.3
222 MLINKS+= cache.3 sys_icache_invalidate.3
223 MLINKS+= cache.3 sys_dcache_flush.3
225 MLINKS+= spinlock.3 OSSpinLockLock.3 \
226 spinlock.3 OSSpinLockTry.3 \
227 spinlock.3 OSSpinLockUnlock.3
229 #MAN+= _exit.2 accept.2 access.2 acct.2 adjtime.2 \
230 # aio_cancel.2 aio_error.2 aio_read.2 aio_return.2 \
231 # aio_suspend.2 aio_waitcomplete.2 aio_write.2 \
232 # bind.2 brk.2 chdir.2 chflags.2 \
233 # chmod.2 chown.2 chroot.2 clock_gettime.2 close.2 \
234 # connect.2 dup.2 execve.2 extattr_get_file.2 \
235 # fcntl.2 fhopen.2 flock.2 fork.2 fsync.2 \
236 # getdirentries.2 getdtablesize.2 \
237 # getfh.2 getfsstat.2 getgid.2 getgroups.2 getitimer.2 getlogin.2 \
238 # getpeername.2 getpgrp.2 getpid.2 getpriority.2 getrlimit.2 \
239 # getrusage.2 getsid.2 getsockname.2 \
240 # getsockopt.2 gettimeofday.2 getuid.2 \
241 # intro.2 ioctl.2 issetugid.2 jail.2 kill.2 \
242 # kldfind.2 kldfirstmod.2 kldload.2 kldnext.2 kldstat.2 kldsym.2 \
243 # kldunload.2 kqueue.2 link.2 listen.2 lseek.2 \
244 # madvise.2 mincore.2 minherit.2 mkdir.2 mkfifo.2 mknod.2 mlock.2 mmap.2 \
245 # modfind.2 modnext.2 modstat.2 \
246 # mount.2 mprotect.2 msync.2 munmap.2 nanosleep.2 \
247 # nfssvc.2 open.2 pathconf.2 pipe.2 poll.2 profil.2 ptrace.2 quotactl.2 \
248 # read.2 readlink.2 reboot.2 recv.2 rename.2 revoke.2 rfork.2 rmdir.2 \
249 # rtprio.2 select.2 semctl.2 semget.2 semop.2 send.2 sendfile.2 \
250 # setgroups.2 setpgid.2 setregid.2 setresuid.2 setreuid.2 setsid.2 \
251 # setuid.2 shmat.2 shmctl.2 shmget.2 shutdown.2 \
252 # sigaction.2 sigaltstack.2 sigpending.2 sigprocmask.2 sigreturn.2 \
253 # sigstack.2 sigsuspend.2 socket.2 socketpair.2 stat.2 statfs.2 \
254 # swapon.2 symlink.2 sync.2 sysarch.2 syscall.2 \
255 # truncate.2 umask.2 undelete.2 \
256 # unlink.2 utimes.2 vfork.2 wait.2 write.2
257 #.if !defined(NO_P1003_1B)
258 #MAN+= sched_get_priority_max.2 sched_setparam.2 \
259 # sched_setscheduler.2 sched_yield.2
262 #MLINKS+=access.2 eaccess.2
263 #MLINKS+=brk.2 sbrk.2
264 #MLINKS+=chdir.2 fchdir.2
265 #MLINKS+=chflags.2 fchflags.2
266 #MLINKS+=chmod.2 fchmod.2 chmod.2 lchmod.2
267 #MLINKS+=chown.2 fchown.2 chown.2 lchown.2
268 #MLINKS+=clock_gettime.2 clock_getres.2 clock_gettime.2 clock_settime.2
269 #MLINKS+=dup.2 dup2.2
270 #MLINKS+=extattr_get_file.2 extattr_set_file.2 \
271 # extattr_get_file.2 extattr_delete_file.2 \
272 # extattr_get_file.2 extattr_get_fd.2 \
273 # extattr_get_file.2 extattr_set_fd.2 \
274 # extattr_get_file.2 extattr_delete_fd.2 \
275 # extattr_get_file.2 extattr.2
276 #MLINKS+=fhopen.2 fhstat.2 fhopen.2 fhstatfs.2
277 #MLINKS+=getdirentries.2 getdents.2
278 #MLINKS+=getgid.2 getegid.2
279 #MLINKS+=getitimer.2 setitimer.2
280 #MLINKS+=getlogin.2 getlogin_r.3
281 #MLINKS+=getlogin.2 setlogin.2
282 #MLINKS+=getpgrp.2 getpgid.2
283 #MLINKS+=getpid.2 getppid.2
284 #MLINKS+=getpriority.2 setpriority.2
285 #MLINKS+=getrlimit.2 setrlimit.2
286 #MLINKS+=getsockopt.2 setsockopt.2
287 #MLINKS+=gettimeofday.2 settimeofday.2
288 #MLINKS+=getuid.2 geteuid.2
289 #MLINKS+=intro.2 errno.2
290 #MLINKS+=kqueue.2 kevent.2
291 #MLINKS+=mlock.2 munlock.2
292 #MLINKS+=modnext.2 modfnext.2
293 #MLINKS+=mount.2 unmount.2
294 #MLINKS+=pathconf.2 fpathconf.2
295 #MLINKS+=read.2 pread.2 read.2 readv.2
296 #MLINKS+=recv.2 recvfrom.2 recv.2 recvmsg.2
297 #MLINKS+=send.2 sendmsg.2 send.2 sendto.2
298 #MLINKS+=setpgid.2 setpgrp.2
299 #MLINKS+=setresuid.2 setresgid.2 setresuid.2 getresuid.2 setresuid.2 getresgid.2
300 #MLINKS+=setuid.2 setegid.2 setuid.2 seteuid.2 setuid.2 setgid.2
301 #MLINKS+=shmat.2 shmdt.2
302 #MLINKS+=stat.2 fstat.2 stat.2 lstat.2
303 #MLINKS+=statfs.2 fstatfs.2
304 #MLINKS+=syscall.2 __syscall.2
305 #MLINKS+=truncate.2 ftruncate.2
306 #MLINKS+=utimes.2 futimes.2 utimes.2 lutimes.2
307 #MLINKS+=wait.2 wait3.2 wait.2 wait4.2 wait.2 waitpid.2
308 #MLINKS+=write.2 pwrite.2 write.2 writev.2
309 #.if !defined(NO_P1003_1B)
310 #MLINKS+=sched_get_priority_max.2 sched_get_priority_min.2 \
311 # sched_get_priority_max.2 sched_rr_get_interval.2
312 #MLINKS+=sched_setparam.2 sched_getparam.2
313 #MLINKS+=sched_setscheduler.2 sched_getscheduler.2