History log of /freebsd-9.3-release/sys/kern/makesyscalls.sh
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 262034 17-Feb-2014 avg

MFC r255777: Omit "__restrict" when generating syscall argument strings

syscall argument strings are also regenerated as part of this commit


# 258106 13-Nov-2013 jhb

MFC 255490,255491:
Fix the type of the idtype argument to wait6() in syscalls.master.


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 225617 16-Sep-2011 kmacy

In order to maximize the re-usability of kernel code in user space this
patch modifies makesyscalls.sh to prefix all of the non-compatibility
calls (e.g. not linux_, freebsd32_) with sys_ and updates the kernel
entry points and all places in the code that use them. It also
fixes an additional name space collision between the kernel function
psignal and the libc function of the same name by renaming the kernel
psignal kern_psignal(). By introducing this change now we will ease future
MFCs that change syscalls.

Reviewed by: rwatson
Approved by: re (bz)


# 219559 12-Mar-2011 avg

add DTrace systrace support for linux32 and freebsd32 on amd64 syscalls

This commits makes necessary changes in syscall/sysent generation
infrastructure.

PR: kern/152822
Submitted by: Artem Belevich <fbsdlist@src.cx>
Reviewed by: jhb (ealier version)
MFC after: 3 weeks


# 219131 01-Mar-2011 rwatson

Continue to introduce Capsicum Capability Mode support:

Add a new system call flag, SYF_CAPENABLED, which indicates that a
particular system call is available in capability mode.

Add a new configuration file, kern/capabilities.conf (similar files
may be introduced for other ABIs in the future), which enumerates
system calls that are available in capability mode. When a new
system call is added to syscalls.master, it will also need to be
added here (if needed). Teach sysent parts to use this file to set
values for SYF_CAPENABLED for the native ABI.

Reviewed by: anderson
Discussed with: benl, kris, pjd
Obtained from: Capsicum Project
MFC after: 3 months


# 209579 28-Jun-2010 kib

Count number of threads that enter and leave dynamically registered
syscalls. On the dynamic syscall deregistration, wait until all
threads leave the syscall code. This somewhat increases the safety
of the loadable modules unloading.

Reviewed by: jhb
Tested by: pho
MFC after: 1 month


# 209390 21-Jun-2010 ed

Use ISO C99 integer types in sys/kern where possible.

There are only about 100 occurences of the BSD-specific u_int*_t
datatypes in sys/kern. The ISO C99 integer types are used here more
often.


# 203660 08-Feb-2010 ed

Remove unused LIBCOMPAT keyword from syscalls.master.


# 194833 24-Jun-2009 jhb

Add a new COMPAT7 flag for FreeBSD 7.x compatibility system calls.


# 194646 22-Jun-2009 jhb

Include definitions for the audit identifiers for compat system calls in
sysproto.h. This makes it possible to use SYSCALL_MODULE() for compat
system calls that live in kernel modules.


# 194390 17-Jun-2009 jhb

- Add the ability to mix multiple flags seperated by pipe ('|') characters
in the type field of system call tables. Specifically, one can now use
the 'NO*' types as flags in addition to the 'COMPAT*' types. For example,
to tag 'COMPAT*' system calls as living in a KLD via NOSTD. The COMPAT*
type is required to be listed first in this case.
- Add new functions 'type()' and 'flag()' to the embedded awk script in
makesyscalls.sh that return true if a requested flag is found in the
type field ($3). The flag() function checks all of the flags in the
field, but type() only checks the first flag. type() is meant to be
used in the top-level "switch" statement and flag() should be used
otherwise.
- Retire the CPT_NOA type, it is now replaced with "COMPAT|NOARGS" using
the flags approach.
- Tweak the comment descriptions of COMPAT[46] system calls so that they
say "freebsd[46] foo" rather than "old foo".
- Document the COMPAT6 type.
- Sync comments in compat32 syscall table with the master table.


# 194384 17-Jun-2009 jhb

Remove the now-unused NOIMPL flag. It serves no useful purpose given the
existing UNIMPL and NOSTD types.


# 193234 01-Jun-2009 rwatson

Add 'sy_flags', a currently unused per-syscall entry flags field that will
see future use in 9-CURRENT and 8-STABLE for features such as the
capability-mode enable flag and pay-as-you-audit.

Discussed with: jhb, sson


# 183361 25-Sep-2008 jhb

Tidy up a few things with syscall generation:
- Instead of using a syscall slot (370) just to get a function prototype
for lkmressys(), add an explicit function prototype to <sys/sysent.h>.
This also removes unused special case checks for 'lkmressys' from
makesyscalls.sh.
- Instead of having magic logic in makesyscalls.sh to only generate a
function prototype the first time 'lkmnosys' is seen, make 'NODEF'
always not generate a function prototype and include an explicit
prototype for 'lkmnosys' in <sys/sysent.h>.
- As a result of the fix in (2), update the LKM syscall entries in
the freebsd32 syscall table to use 'lkmnosys' rather than 'nosys'.
- Use NOPROTO for the __syscall() entry (198) in the native ABI. This
avoids the need for magic logic in makesyscalls.h to only generate
a function prototype the first time 'nosys' is encountered.


# 177656 26-Mar-2008 jb

Generate another function for the DTrace syscall provider to specify
the syscall argument types.

This code is only compiled into the systrace kernel modul and has no
effect otherwise.


# 177597 25-Mar-2008 ru

Fixed type of the fourth argument of cpuset_{get,set}affinity(2) to be size_t.

Prodded by: davidxu


# 171208 04-Jul-2007 peter

Add support for COMPAT6 syscalls.

Also, change the visibility of compat syscalls a slightly. Compat
syscalls were missing from 'syscalls.h' entirely. This additionally adds
them with their compat prefix. eg: SYS_freebsd6_mmap.

Also, the syscalls.c names strings have different prefixes to differentiate
syscalls. Instead of several "old.mmap" strings, there will now be a
"compat.mmap" and "compat6.mmap" etc. Before, both would have had the
same "old.mmap" label.

Approved by: re


# 164184 11-Nov-2006 trhodes

Merge posix4/* into normal kernel hierarchy.

Reviewed by: glanced at by jhb
Approved by: silence on -arch@ and -standards@


# 161327 15-Aug-2006 jhb

Add a new set of macros <prefix>_AUE_<syscallname> to sysproto.h that
map to the audit event associated with a specific system call. For
example, SYS_AUE___semctl would be set to AUE_SEMCTL in sys/sysproto.h.


# 160942 03-Aug-2006 jb

Generate another file called systrace_args.c. This will be compiled
into systrace and is used to map the syscall arguments into the 64-bit
parameter array.


# 160912 02-Aug-2006 davidxu

Don't include sys/thr.h and umtx.h in sys/sysproto.h, it is unnecessary.


# 160798 28-Jul-2006 jhb

Now that all system calls are MPSAFE, retire the SYF_MPSAFE flag used to
mark system calls as being MPSAFE:
- Stop conditionally acquiring Giant around system call invocations.
- Remove all of the 'M' prefixes from the master system call files.
- Remove support for the 'M' prefix from the script that generates the
syscall-related files from the master system call files.
- Don't explicitly set SYF_MPSAFE when registering nfssvc.


# 146806 30-May-2005 rwatson

Introduce a new field in the syscalls.master file format to hold the
audit event identifier associated with each system call, which will
be stored by makesyscalls.sh in the sy_auevent field of struct sysent.
For now, default the audit identifier on all system calls to AUE_NULL,
but in the near future, other BSM event identifiers will be used. The
mapping of system calls to event identifiers is many:one due to
multiple system calls that map to the same end functionality across
compatibility wrappers, ABI wrappers, etc.

Submitted by: wsalamon
Obtained from: TrustedBSD Project


# 123749 23-Dec-2003 peter

Remove the namespace column from the syscalls tables. We don't actually
use it, if we ever did. They have been been VERY poorly maintained for
some time, possibly because they were a NOP. FWIW, This brings our table
formats back closer to the other *BSD's.


# 112906 31-Mar-2003 jeff

- Include umtx.h in files generated by makesyscalls.sh
- Add system calls for umtx.


# 112903 31-Mar-2003 jeff

- We now have to include umtx.h and ucontext.h in the system call related
headers.


# 106149 29-Oct-2002 dwmalone

The syscall names are string constants, so make them consts.


# 103574 18-Sep-2002 alfred

Add the rest of the kernel support for the sem_ API in kern/uipc_sem.c.

Option 'P1003_1B_SEMAPHORES' to compile them in, or load the "sem" module
to activate them.

Have kern/makesyscalls.sh emit an include for sys/_semaphore.h into sysproto.h
to pull in the typedef for semid_t.

Add the syscalls to the syscall table as module stubs.


# 99854 12-Jul-2002 alfred

Introduce syscall.master option 'COMPAT4' which allows one to wrap
syscalls for FreeBSD 4 compatibility.
Add kernel option COMPAT_FREEBSD4 to enable these syscalls.


# 95258 22-Apr-2002 des

Usage style sweep: spell "usage" with a small 'u'.
Also change one case of blatant __progname abuse (several more remain)
This commit does not touch anything in src/{contrib,crypto,gnu}/.


# 92721 19-Mar-2002 alfred

don't generate files with __P.


# 89984 30-Jan-2002 bde

Oops, fix previous commit to not generate a C comment in syscall.mk.


# 89977 30-Jan-2002 bde

Escape $FreeBSD$ in a different way to avoid using the bogus escapes \$
and \F. Awk just started warning about these.


# 84878 13-Oct-2001 phk

Don't generate <sys/syscalls-hide.h> it has never had any users anywhere in
the source tree.


# 84600 06-Oct-2001 marcel

Fix breakage caused by previous commit. The lkmnosys and lkmressys
syscalls are of type NODEF but not in a way that fits the given
definition of that type. The exact difference of lkmressys and
lkmnosys is unclear, which makes it all the more confusing. A
reevaluation of what we have and what we really need is in order.

Spotted by: Maxime Henrion <mux@qualys.com>
Pointy hat: marcel


# 84068 27-Sep-2001 marcel

Make the NODEF type usable. A syscall of type NODEF will only
have its entry in the syscall table added. Nothing else is
done. This differs from type NOPROTO in that NOPROTO adds a
definition to syscall.h besides adding a sysent. A syscall can
now have multiple entries without conflict. Note that the
argssize is fixed and depends on the syscall name.


# 83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


# 83046 04-Sep-2001 obrien

Fix the definition generation code from rev 1.15 that generates non-style(9)
compliant structure definitions.


# 82585 30-Aug-2001 dillon

Remove the MPSAFE keyword from the parser for syscalls.master.
Instead introduce the [M] prefix to existing keywords. e.g.
MSTD is the MP SAFE version of STD. This is prepatory for a
massive Giant lock pushdown. The old MPSAFE keyword made
syscalls.master too messy.

Begin comments MP-Safe procedures with the comment:
/*
* MPSAFE
*/
This comments means that the procedure may be called without
Giant held (The procedure itself may still need to obtain
Giant temporarily to do its thing).

sv_prepsyscall() is now MP SAFE and assumed to be MP SAFE
sv_transtrap() is now MP SAFE and assumed to be MP SAFE

ktrsyscall() and ktrsysret() are now MP SAFE (Giant Pushdown)
trapsignal() is now MP SAFE (Giant Pushdown)

Places which used to do the if (mtx_owned(&Giant)) mtx_unlock(&Giant)
test in syscall[2]() in */*/trap.c now do not. Instead they
explicitly unlock Giant if they previously obtained it, and then
assert that it is no longer held to catch broken system calls.

Rebuild syscall tables.


# 82149 22-Aug-2001 tmm

Add padding before each element of the syscall argument structures in
sysproto.h in addition to the existing padding afterwards.
This is needed to support big-endian architectures like sparc64.

Reviewed by: bde
Tested on alpha by: jhb


# 69448 01-Dec-2000 alfred

Add reserved lkmressys keyword. I swear, this script will die the
next time I need to hack on it.


# 69445 01-Dec-2000 alfred

implement NOSTD syscall type, this creates the syscall args, but sticks
a lkmnosys into the sysent table so that SYSCALL_MODULE() works


# 63986 28-Jul-2000 peter

Change the 'exit()' system call to 'sys_exit()'. This avoids overlapping
gcc's internal exit() prototypes and the (futile) hackery that we did to
try and avoid warnings. main() was renamed for similar reasons.
Remove an exit related hack from makesyscalls.sh.


# 60287 09-May-2000 bde

Fixed the calculation of sy_nargs in sysent tables. We attempted to do
this in awk using the hack of counting args of type off_t twice and args
of all other types once. This is too simple to work. It gave benignly
wrong results on alphas (off_t shouldn't be counted twice) and for
svr4_sys_mmap64() on i386's (off64_t should be counted twice). It gave
fatally wrong results for i386's with 64-bit longs (longs should be
counted twice). The correct value for sy_nargs is easier to determine
from the size of the args struct anyway, except for complications to
make the generated code almost readable.

Improved formatting of sysent tables by lining up the comments where
possible.


# 58963 03-Apr-2000 alfred

Make makesyscalls.sh parse an optional field 'MPSAFE' that specifies
that a syscall does not want the BGL to be grabbed automatically.

Add the new MPSAFE flag to the syscalls that dillon has determined to
be MPSAFE.


# 54803 19-Dec-1999 rwatson

Second pass commit to introduce new ACL and Extended Attribute system
calls, vnops, vfsops, both in /kern, and to individual file systems that
require a vfsop_ array entry.

Reviewed by: eivind


# 51135 10-Sep-1999 peter

Add $FreeBSD$ tags to generated files otherwise the checker won't let them
be committed.


# 50478 27-Aug-1999 peter

Id -> FreeBSD


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 37227 28-Jun-1998 phk

Add trailing newline to sys/syscall.mk so that diff doesn't choke on it.


# 36782 09-Jun-1998 bde

Don't generate COMPAT_43 cruft if there are no COMPAT_43 syscalls.
In particular, don't generate an include of "opt_compat.h" if it
wouldn't affect anything we create. This will fix recent breakage
of the ibcs2 LKM. The ibcs2 syscall files were not regenerated
properly, so the LKM didn't break immediately when we started
generating this extraneous include.


# 36770 08-Jun-1998 bde

Fixed some style bugs in output (missing tabs and unparenthesized macros).

Fixed some style bugs in source (mostly, superfluous backslashes).


# 36735 07-Jun-1998 dfr

This commit fixes various 64bit portability problems required for
FreeBSD/alpha. The most significant item is to change the command
argument to ioctl functions from int to u_long. This change brings us
inline with various other BSD versions. Driver writers may like to
use (__FreeBSD_version == 300003) to detect this change.

The prototype FreeBSD/alpha machdep will follow in a couple of days
time.


# 34354 09-Mar-1998 jb

Add statements to generate a sys/syscall.mk file for inclusion
during the libc/libc_r to automatically pick up syscall names on
the assumption that default asm code needs to generated for them.

In the up-coming changes to the libc makefiles, there is the option
to provide a machine dependent asm source file which will turn off
the automatic generation of the default. There is also an option
to just stop code being generated for a syscall. In most cases,
though, the default asm code is all that is required, so this
change makes that the most convenient was to do business.

Idea suggested by: bde


# 33039 03-Feb-1998 bde

Generate a forward declaration of `struct proc' in <sys/sysproto.h>.

Removed extra args to a printf.

Fixed some style inconsistencies (unnecessary parentheses for printf).
awk is not C.


# 31785 16-Dec-1997 eivind

Move around opt_compat include to accomodate Linulator brokenness (for
the time being).


# 31778 16-Dec-1997 eivind

Make COMPAT_43 and COMPAT_SUNOS new-style options.


# 31627 08-Dec-1997 jmg

add process id to tmp files... this prevents two runs from stomping
over each other's tmp files... (usr.bin/truss uncovered this bug)


# 31213 18-Nov-1997 peter

Don't generate new prototype files with the extra int retval[] arg at
the end since pdk deleted them.

Forgotten by: phk


# 30740 26-Oct-1997 phk

Add "NOIMPL" for syscalls we know what is, but don't implement as "STD".
Use this for getfh & nfssvc.


# 27067 29-Jun-1997 bde

Don't generate unused nested #include of <sys/aio.h>.


# 26671 15-Jun-1997 dyson

Modifications to existing files to support the initial AIO/LIO and
kernel based threading support.


# 24373 29-Mar-1997 peter

Make sure we touch all the temporary files at startup, because we assume
they were created later on. This is not the case when processing
syscalls.isc in the ibcs2 area. (It generates no declarations, it's
all either hidden (already prototyped elsewhere) or unimplemented).


# 22975 22-Feb-1997 peter

Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are not
ready for it yet.


# 21776 16-Jan-1997 bde

Reduced #include spam in <sys/sysproto.h> and fixed things that depended
on it.

makesyscalls.sh:
This parsed $Id$. Fixed(?) to parse $FreeBSD$. The output is wrong when
the id is not expanded in the source file.

syscalls.master:
Fixed declaration of sigsuspend(). There are still some bogons and
spam involving sigset_t.
Use `struct foo *' instead of the equivalent `foo_t *' for some nfs and
lfs syscalls so that <sys/sysproto.h> doesn't depend on <sys/mount.h>.


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 18277 13-Sep-1996 bde

Don't use __dead in the kernel. It was an obfuscation for gcc >= 2.5
and a no-op for gcc >= 2.6.


# 14331 02-Mar-1996 peter

Mega-commit for Linux emulator update.. This has been stress tested under
netscape-2.0 for Linux running all the Java stuff. The scrollbars are now
working, at least on my machine. (whew! :-)

I'm uncomfortable with the size of this commit, but it's too
inter-dependant to easily seperate out.

The main changes:

COMPAT_LINUX is *GONE*. Most of the code has been moved out of the i386
machine dependent section into the linux emulator itself. The int 0x80
syscall code was almost identical to the lcall 7,0 code and a minor tweak
allows them to both be used with the same C code. All kernels can now
just modload the lkm and it'll DTRT without having to rebuild the kernel
first. Like IBCS2, you can statically compile it in with "options LINUX".

A pile of new syscalls implemented, including getdents(), llseek(),
readv(), writev(), msync(), personality(). The Linux-ELF libraries want
to use some of these.

linux_select() now obeys Linux semantics, ie: returns the time remaining
of the timeout value rather than leaving it the original value.

Quite a few bugs removed, including incorrect arguments being used in
syscalls.. eg: mixups between passing the sigset as an int, vs passing
it as a pointer and doing a copyin(), missing return values, unhandled
cases, SIOC* ioctls, etc.

The build for the code has changed. i386/conf/files now knows how
to build linux_genassym and generate linux_assym.h on the fly.

Supporting changes elsewhere in the kernel:

The user-mode signal trampoline has moved from the U area to immediately
below the top of the stack (below PS_STRINGS). This allows the different
binary emulations to have their own signal trampoline code (which gets rid
of the hardwired syscall 103 (sigreturn on BSD, syslog on Linux)) and so
that the emulator can provide the exact "struct sigcontext *" argument to
the program's signal handlers.

The sigstack's "ss_flags" now uses SS_DISABLE and SS_ONSTACK flags, which
have the same values as the re-used SA_DISABLE and SA_ONSTACK which are
intended for sigaction only. This enables the support of a SA_RESETHAND
flag to sigaction to implement the gross SYSV and Linux SA_ONESHOT signal
semantics where the signal handler is reset when it's triggered.

makesyscalls.sh no longer appends the struct sysentvec on the end of the
generated init_sysent.c code. It's a lot saner to have it in a seperate
file rather than trying to update the structure inside the awk script. :-)

At exec time, the dozen bytes or so of signal trampoline code are copied
to the top of the user's stack, rather than obtaining the trampoline code
the old way by getting a clone of the parent's user area. This allows
Linux and native binaries to freely exec each other without getting
trampolines mixed up.


# 11330 07-Oct-1995 swallace

Fix misc formatting errors in makesyscalls.sh.

Add CPT_NOA type which is COMPAT with NOARGS -- do not produce argument
struct in sysproto.

Change accept, recvfrom, getsockname to CPT_NOA type.
Fix getrlimit, setrlimit argument #2 name to struct rlimit.


# 11294 07-Oct-1995 swallace

Add new functionality to makesyscalls.sh:
o optional config-file to set vars: sysnames, sysproto, sysproto_h,
syshdr, syssw, syshide, syscallprefix, switchname, namesname, sysvec.
o change syntax of syscalls.master entry:
remove argument count.
add pseudo-prototype field defining function name and arguments.
o generates correct structure definitions for all system calls
in sys/sysproto.h
o add type NOARGS: same as STD except do not create structure in
sys/sysproto.h
o add type NOPROTO: same as STD except do not create structure or function
prototype in sys/sysproto.h

New functionality provides complete prototype definitions.
Usefull for generating files for emulated systems like my new ibcs2 code.

Update syscalls.master to reflect new changes. For example, read()
entry now looks like:

3 STD POSIX { int ibcs2_read(int fd, char *buf, u_int nbytes); }

This is similar to how NetBSD generates these files.


# 10906 19-Sep-1995 bde

Oops. Avoid literal $Id in an awk string to stop cvs from substituting it.


# 10905 19-Sep-1995 bde

Generate prototypes for syscall-implementing functions. Put them in
<sys/sysproto.h> and use them (so far only) in kern/init_sysent.c.

Don't put $Id in generated files.

kern/syscalls.master:
I had to add some new fields to describe some non-orthogonal names.
E.g., the args struct for the syscall-implementing function foo()
is usually named `foo_args', but for getpid() it is named `args'.

sys/sysent.h:
sy_call_t is still incomplete to hide a couple of warnings.


# 7090 16-Mar-1995 bde

Add and move declarations to fix all of the warnings from `gcc -Wimplicit'
(except in netccitt, netiso and netns) and most of the warnings from
`gcc -Wnested-externs'. Fix all the bugs found. There were no serious
ones.


# 6380 14-Feb-1995 sos

First attempt to run linux binaries. This is only the changes needed to
the generic kernel. The actual emulator is a separate LKM. (not finished
yet, sorry).
Submitted by: sos@freebsd.org & sef@kithrup.com


# 4216 06-Nov-1994 ats

Put a small hack into a large hack named makeyscall.sh. Generate only
one lkmnosys() entry in init_sysent.c.


# 3478 09-Oct-1994 sos

Added errno conversion table (initialize to zero).


# 3109 26-Sep-1994 phk

init_sysent.c was missing the final newline.


# 2700 13-Sep-1994 wollman

Forgot to check this important file in.


# 2671 11-Sep-1994 ats

Change the makesyscalls.sh to only generate one line for the external
declaration of nosys. This prevents some warnings from the compiler.


# 2293 26-Aug-1994 sos

Oops didn't check that init_sysent.c was generated proberly. Fixed.

Reviewed by:
Submitted by:


# 2257 24-Aug-1994 sos

Changes preparing for iBCS support
Reviewed by:
Submitted by:


# 2124 19-Aug-1994 dg

Terry Lambert's loadable kernel module support w/improvements from the
NetBSD group.


# 1817 02-Aug-1994 dg

Added $Id$


# 1542 24-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1541,
which included commits to RCS files with non-trunk default branches.


# 1541 24-May-1994 rgrimes

BSD 4.4 Lite Kernel Sources