Home | History | Annotate | Download | only in kern
History log of /src/sys/kern/sys_generic.c
RevisionDateAuthorComments
 1.134  10-Jul-2022  riastradh readv(2), writev(2): Avoid arithmetic overflow in bounds check.
 1.133  11-Sep-2021  riastradh sys/kern: Allow custom fileops to specify fo_seek method.

Previously only vnodes allowed lseek/pread[v]/pwrite[v], which meant
converting a regular device to a cloning device doesn't always work.

Semantics is:

(*fp->f_ops->fo_seek)(fp, delta, whence, newoffp, flags)

1. Compute a new offset according to whence + delta -- that is, if
whence is SEEK_CUR, add delta to fp->f_offset; if whence is
SEEK_END, add delta to end of file; if whence is SEEK_CUR, use delta
as is.

2. If newoffp is nonnull, return the new offset in *newoffp.

3. If flags & FOF_UPDATE_OFFSET, set fp->f_offset to the new offset.

Access to fp->f_offset, and *newoffp if newoffp = &fp->f_offset, must
happen under the object lock (e.g., vnode lock), in order to
synchronize fp->f_offset reads and writes.

This change has the side effect that every call to VOP_SEEK happens
under the vnode lock now, when previously it didn't. However, from a
review of all the VOP_SEEK implementations, it does not appear that
any file system even examines the vnode, let alone locks it. So I
think this is safe -- and essentially the only reasonable way to do
things, given that it is used to validate a change from oldoff to
newoff, and oldoff becomes stale the moment we unlock the vnode.

No kernel bump because this reuses a spare entry in struct fileops,
and it is safe for the entry to be null, so all existing fileops will
continue to work as before (rejecting seek).
 1.132  23-May-2020  ad Move proc_lock into the data segment. It was dynamically allocated because
at the time we had mutex_obj_alloc() but not __cacheline_aligned.
 1.131  01-Jun-2017  chs remove checks for failure after memory allocation calls that cannot fail:

kmem_alloc() with KM_SLEEP
kmem_zalloc() with KM_SLEEP
percpu_alloc()
pserialize_create()
psref_class_create()

all of these paths include an assertion that the allocation has not failed,
so callers should not assert that again.
 1.130  05-Sep-2014  matt branches: 1.130.2;
Try not to use f_data, use f_{vnode,socket,pipe,mqueue,kqueue,ksem} to get
a correctly typed pointer.
 1.129  04-Apr-2013  martin Provide binary compatibility for architectures that (erroneously) had
a larger MAXPARTITIONS value (and thus larger struct disklabel).
 1.128  25-Jan-2012  christos branches: 1.128.2; 1.128.4; 1.128.6;
As discussed in tech-kern, provide the means to prevent delivery of SIGPIPE
on EPIPE for all file descriptor types:

- provide O_NOSIGPIPE for open,kqueue1,pipe2,dup3,fcntl(F_{G,S}ETFL) [NetBSD]
- provide SOCK_NOSIGPIPE for socket,socketpair [NetBSD]
- provide SO_NOSIGPIPE for {g,s}seckopt [NetBSD/FreeBSD/MacOSX]
- provide F_{G,S}ETNOSIGPIPE for fcntl [MacOSX]
 1.127  27-Jul-2011  uebayasi branches: 1.127.2; 1.127.6;
These don't need uvm/uvm_extern.h.
 1.126  10-Apr-2011  christos - Add O_CLOEXEC to open(2)
- Add fd_set_exclose() to encapsulate uses of FIO{,N}CLEX, O_CLOEXEC, F{G,S}ETFD
- Add a pipe1() function to allow passing flags to the fd's that pipe(2)
opens to ease implementation of linux pipe2(2)
- Factor out fp handling code from open(2) and fhopen(2)
 1.125  18-Jan-2011  matt Make struct disklabel 8 byte aligned. This increases its size by 4 bytes
on IPL32 platforms so add code in sys_ioctl (and netbsd32_ioctl) to deal
with the older/smaller diskabel size. This change makes disklabel the
same for both IPL32 and LP64 platforms.
 1.124  13-Aug-2009  haad branches: 1.124.4; 1.124.6;
Allow undescribed, direct ioctls as used by Unix. This capability was removed in BSD, presumably because nothing used it any more.
Third party system software written for Unix (like ZFS) requires this to work without significant modifications.

Ok supremeleader@
 1.123  24-May-2009  ad More changes to improve kern_descrip.c.

- Avoid atomics in more places.
- Remove the per-descriptor mutex, and just use filedesc_t::fd_lock.
It was only being used to synchronize close, and in any case we needed
to take fd_lock to free the descriptor slot.
- Optimize certain paths for the <NDFDFILE case.
- Sprinkle more comments and assertions.
- Cache more stuff in filedesc_t.
- Fix numerous minor bugs spotted along the way.
- Restructure how the open files array is maintained, for clarity and so
that we can eliminate the membar_consumer() call in fd_getfile(). This is
mostly syntactic sugar; the main functional change is that fd_nfiles now
lives alongside the open file array.

Some measurements with libmicro:

- simple file syscalls are like close() are between 1 to 10% faster.
- some nice improvements, e.g. poll(1000) which is ~50% faster.
 1.122  17-May-2009  ad Updates to f_flag need to be made with atomics.
 1.121  17-May-2009  yamt remove FILE_LOCK and FILE_UNLOCK.
 1.120  02-Jul-2008  matt branches: 1.120.6; 1.120.10; 1.120.12;
Change {ff,fd}_exclose and ff_allocated to bool. Change exclose arg to
fd_dup to bool. Switch assignments from 1/0 to true/false.

This make alpha kernels compile. Bump kern to 4.99.69 since structure
changed.
 1.119  28-Apr-2008  martin branches: 1.119.2; 1.119.4;
Remove clause 3 and 4 from TNF licenses
 1.118  24-Apr-2008  ad branches: 1.118.2;
Network protocol interrupts can now block on locks, so merge the globals
proclist_mutex and proclist_lock into a single adaptive mutex (proc_lock).
Implications:

- Inspecting process state requires thread context, so signals can no longer
be sent from a hardware interrupt handler. Signal activity must be
deferred to a soft interrupt or kthread.

- As the proc state locking is simplified, it's now safe to take exit()
and wait() out from under kernel_lock.

- The system spends less time at IPL_SCHED, and there is less lock activity.
 1.117  23-Mar-2008  ad branches: 1.117.2;
Split select/poll into their own file.
 1.116  22-Mar-2008  ad Commit the "per-CPU" select patch. This is the result of much work and
testing by rmind@ and myself.

Which approach to use is still being discussed, but I would like to get
this out of my working tree. If we decide to use a different approach
there is no problem with revisiting this.
 1.115  21-Mar-2008  ad Catch up with descriptor handling changes. See kern_descrip.c revision
1.173 for details.
 1.114  17-Mar-2008  ad Add a boolean parameter to syncobj_t::sobj_unsleep. If true we want the
existing behaviour: the unsleep method unlocks and wakes the swapper if
needs be. If false, the caller is doing a batch operation and will take
care of that later. This is kind of ugly, but it's difficult for the caller
to know which lock to release in some situations.
 1.113  05-Mar-2008  ad selclear() while exiting netsmb's custom copy of select(). PR kern/38123.
 1.112  01-Mar-2008  rmind Welcome to 4.99.55:

- Add a lot of missing selinit() and seldestroy() calls.

- Merge selwakeup() and selnotify() calls into a single selnotify().

- Add an additional 'events' argument to selnotify() call. It will
indicate which event (POLL_IN, POLL_OUT, etc) happen. If unknown,
zero may be used.

Note: please pass appropriate value of 'events' where possible.
Proposed on: <tech-kern>
 1.111  05-Jan-2008  dsl branches: 1.111.2; 1.111.6;
Use FILE_LOCK() and FILE_UNLOCK()
 1.110  20-Dec-2007  dsl Convert all the system call entry points from:
int foo(struct lwp *l, void *v, register_t *retval)
to:
int foo(struct lwp *l, const struct foo_args *uap, register_t *retval)
Fixup compat code to not write into 'uap' and (in some cases) to actually
pass a correctly formatted 'uap' structure with the right name to the
next routine.
A few 'compat' routines that just call standard ones have been deleted.
All the 'compat' code compiles (along with the kernels required to test
build it).
98% done by automated scripts.
 1.109  05-Dec-2007  ad branches: 1.109.4;
Match the docs: MUTEX_DRIVER/SPIN are now only for porting code written
for Solaris.
 1.108  08-Oct-2007  ad branches: 1.108.4; 1.108.6;
Merge file descriptor locking, cwdi locking and cross-call changes
from the vmlocking branch.
 1.107  25-Sep-2007  ad Add selinit() / seldestroy() from the vmlocking branch.
 1.106  06-Sep-2007  rmind branches: 1.106.2;
Fix various possible dereferences via uvmspace_free() of non-initialized *vm.
Also, error case might happen before proc_vmspace_getref() (hi <ad>!).
Thanks CID 4551 and 4552. This is serious, pullup will be requested.

OK by <wrstuden>.
 1.105  27-Aug-2007  dsl branches: 1.105.2;
Only ktrace the part of the buffer actually read/written.
 1.104  15-Aug-2007  ad Changes to make ktrace LKM friendly and reduce ifdef KTRACE. Proposed
on tech-kern.
 1.103  09-Jul-2007  ad branches: 1.103.2; 1.103.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.102  16-Jun-2007  dsl Move the point at which sys_readv and sys_preadv (and writev) get merged
so that the same common code can be used with a kernel-resident 'iov'
array from the 32-bit compat code (which currently has its own copy
of these routines.
 1.101  02-Jun-2007  dsl Instead of unconditionally initialising the ktriov and conditionally
copying in aiov, just unconditionally copy in aiov.
Probably saves a mispredicted branch and a data cache miss - as well as
removing some code.
 1.100  04-Mar-2007  christos branches: 1.100.2; 1.100.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.99  17-Feb-2007  pavel Change the process/lwp flags seen by userland via sysctl back to the
P_*/L_* naming convention, and rename the in-kernel flags to avoid
conflict. (P_ -> PK_, L_ -> LW_ ). Add back the (now unused) LSDEAD
constant.

Restores source compatibility with pre-newlock2 tools like ps or top.

Reviewed by Andrew Doran.
 1.98  09-Feb-2007  ad branches: 1.98.2;
Merge newlock2 to head.
 1.97  20-Nov-2006  ad branches: 1.97.2; 1.97.4;
selcommon(), pollcommon(): restore the correct signal mask on failure.
 1.96  01-Nov-2006  yamt remove some __unused from function parameters.
 1.95  17-Oct-2006  dogcow now that we have -Wno-unused-parameter, back out all the tremendously ugly
code to gratuitously access said parameters.
 1.94  13-Oct-2006  dogcow More -Wunused fallout. sprinkle __unused when possible; otherwise, use the
do { if (&x) {} } while (/* CONSTCOND */ 0);
construct as suggested by uwe in <20061012224845.GA9449@snark.ptc.spbu.ru>.
 1.93  12-Oct-2006  christos - sprinkle __unused on function decls.
- fix a couple of unused bugs
- no more -Wno-unused for i386
 1.92  03-Sep-2006  christos branches: 1.92.2; 1.92.4;
use c99 initializers
 1.91  14-Jul-2006  kardel make inittimeleft() and gettimeleft() available (for e. g. kern_event.c)
 1.90  14-Jul-2006  christos factor out common code.
 1.89  14-Jul-2006  christos - rename sleepts to sleeptv since it is a timeval.
- don't initialize it needlessly.
- fix the poll code the same way the select code was fixed, so that it
computes the remaining time to sleep properly.
 1.88  08-Jul-2006  kardel when adjusting the left over timeout value in selcommon()
do actually subtract the elapsed time instead of adding it.
 1.87  08-Jul-2006  kardel fix a bug reported by Steven M. Bellovin regarding oversleeping
select(2) timeouts. Introduced via timecounter branch from a
tvtohz() conversion.
The left over timeout was not decremented when re-starting
the sleep in select.
 1.86  07-Jun-2006  kardel branches: 1.86.2;
merge FreeBSD timecounters from branch simonb-timecounters
- struct timeval time is gone
time.tv_sec -> time_second
- struct timeval mono_time is gone
mono_time.tv_sec -> time_uptime
- access to time via
{get,}{micro,nano,bin}time()
get* versions are fast but less precise
- support NTP nanokernel implementation (NTP API 4)
- further reading:
Timecounter Paper: http://phk.freebsd.dk/pubs/timecounter.pdf
NTP Nanokernel: http://www.eecis.udel.edu/~mills/ntp/html/kern.html
 1.85  01-Mar-2006  yamt branches: 1.85.2; 1.85.8;
merge yamt-uio_vmspace branch.

- use vmspace rather than proc or lwp where appropriate.
the latter is more natural to specify an address space.
(and less likely to be abused for random purposes.)
- fix a swdmover race.
 1.84  11-Dec-2005  christos branches: 1.84.2; 1.84.4; 1.84.6;
merge ktrace-lwp.
 1.83  29-May-2005  christos branches: 1.83.2;
- add const.
- remove unnecessary casts.
- add __UNCONST casts and mark them with XXXUNCONST as necessary.
 1.82  25-Feb-2005  matt Add the code for pselect and pollts. Add selcommon and pollcommon to
<sys/select.h> and <sys/poll.h>.
 1.81  23-Mar-2004  junyoung branches: 1.81.8; 1.81.10;
Nuke __P().
 1.80  10-Oct-2003  chs use "poll" as the wmesg for poll.
 1.79  21-Sep-2003  jdolecek cleanup & uniform descriptor owner handling:
* introduce fsetown(), fgetown(), fownsignal() - this sets/retrieves/signals
the owner of descriptor, according to appropriate sematics
of TIOCSPGRP/FIOSETOWN/SIOCSPGRP/TIOCGPGRP/FIOGETOWN/SIOCGPGRP ioctl; use
these routines instead of custom code where appropriate
* make every place handling TIOCSPGRP/TIOCGPGRP handle also FIOSETOWN/FIOGETOWN
properly, and remove the translation of FIO[SG]OWN to TIOC[SG]PGRP
in sys_ioctl() & sys_fcntl()
* also remove the socket-specific hack in sys_ioctl()/sys_fcntl() and
pass the ioctls down to soo_ioctl() as any other ioctl

change discussed on tech-kern@
 1.78  16-Sep-2003  drochner Take into account the possibility that the ktrace flags can change
during a read(v)/write(v). If that happeded, we either passed a NULL
pointer or a pointer to something uninitialized as iov to ktrace,
or we got a memory leak. In read/write (w/o -v) we zero-initialize
the iov now to limit damage, in the -v calls the (dynamically allocated)
pointer is checked after the I/O.
 1.77  07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22364, verified by myself.
 1.76  29-Jun-2003  fvdl branches: 1.76.2;
Back out the lwp/ktrace changes. They contained a lot of colateral damage,
and need to be examined and discussed more.
 1.75  28-Jun-2003  darrenr Pass lwp pointers throughtout the kernel, as required, so that the lwpid can
be inserted into ktrace records. The general change has been to replace
"struct proc *" with "struct lwp *" in various function prototypes, pass
the lwp through and use l_proc to get the process pointer when needed.

Bump the kernel rev up to 1.6V
 1.74  28-May-2003  dsl Report ioctl read and write the correct way around.
 1.73  12-May-2003  dsl ktrace ioctl data buffers
Optimise structure layout for 'struct selinfo' to avoid padding on 64bit
systems. Use an entire variable for the 'collision' flag for efficiency.
 1.72  26-Mar-2003  jdolecek switch to LIST_FOREACH() in selrecord()
 1.71  22-Mar-2003  jdolecek use LIST_FOREACH() in selwakeup() for the process's lwp walk loop
 1.70  23-Feb-2003  pk Make updating a file's reference and use count MP-safe.
 1.69  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.68  30-Nov-2002  jdolecek Unfortunately, we can't really know if select collision is needed
until after wakeup event, so we can't clear the SI_COLL flag
in selrecord(). Thus, effectively back rev. 1.57 off.

Problem reported in PR kern/17517 by David Laight, program triggering
the problem is in regress/sys/kern/poll/poll3w.c.
 1.67  29-Nov-2002  jdolecek selwakeup(): don't bother with pfind() in SI_COLL case; sel_pid is always zero
in this case, and even if not, the process would be already woken up by the
wakeup() call
change sent as part of kern/17517 by David Laight

XXX perhaps should KASSERT() sel_pid is zero in the SI_COLL case
 1.66  26-Nov-2002  christos si_ -> sel_ to avoid conflicts with siginfo.
 1.65  24-Nov-2002  scw Quell uninitialised variable warnings.
 1.64  25-Aug-2002  thorpej Fix some signed/unsigned comparison warnings from GCC 3.3.
 1.63  08-Aug-2002  jdolecek selscan(): make flag[] const
 1.62  22-Mar-2002  jdolecek branches: 1.62.2;
Make sure file descriptor is properly FILE_UNUSE()d in error case
of writev(2).
Problem found by Alistair G. Crooks.
 1.61  17-Mar-2002  atatat Convert ioctl code to use EPASSTHROUGH instead of -1 or ENOTTY for
indicating an unhandled "command". ERESTART is -1, which can lead to
confusion. ERESTART has been moved to -3 and EPASSTHROUGH has been
placed at -4. No ioctl code should now return -1 anywhere. The
ioctl() system call is now properly restartable.
 1.60  14-Nov-2001  christos Make poll(2) ignore negative file descriptors (Bang Jun-Young).
 1.59  12-Nov-2001  lukem add RCSIDs
 1.58  30-Oct-2001  itohy Fix memory leak if
- ktrace enabled for I/O operaion, and
- readv() causes an error.
 1.57  28-Jun-2001  atatat branches: 1.57.2; 1.57.4; 1.57.6;
If no select collision is needed, try our best to avoid it by clearing
the flag.
 1.56  14-Jun-2001  thorpej Fix a partial construction problem that can cause race conditions
between creation of a file descriptor and close(2) when using kernel
assisted threads. What we do is stick descriptors in the table, but
mark them as "larval". This causes essentially everything to treat
it as a non-existent descriptor, except for fdalloc(), which sees a
filled slot so that it won't (incorrectly) allocate it again. When
a descriptor is fully constructed, the code that has constructed it
marks it as "mature" (which actually clears the "larval" flag), and
things continue to work as normal.

While here, gather all the code that gets a descriptor from the table
into a fd_getfile() function, and call it, rather than having the
same (sometimes incorrect) code copied all over the place.
 1.55  24-May-2001  lukem for FIOGETOWN, only change the sign of *data if fo_ioctl returned without error
 1.54  27-Feb-2001  lukem branches: 1.54.2;
oops; accidentally dropped an initialisation in pollscan() in previous.
called poll() to fail in interesting ways. noted by chs/nathanw
 1.53  26-Feb-2001  lukem convert to ANSI KNF
 1.52  21-Aug-2000  thorpej splsched() is appropriate for select()/poll().
 1.51  20-Aug-2000  thorpej Add a lock around the scheduler, and use it as necessary, including
in the non-MULTIPROCESSOR case (LOCKDEBUG requires it). Scheduler
lock is held upon entry to mi_switch() and cpu_switch(), and
cpu_switch() releases the lock before returning.

Largely from Bill Sommerfeld, with some minor bug fixes and
machine-dependent code hacking from me.
 1.50  02-Aug-2000  thorpej MALLOC()/FREE() are not to be used for variable sized allocations.
 1.49  13-Jul-2000  thorpej When select(2)/poll(2) is awakened by a collision, recalculate the
timeout value for tsleep(). From Artur Grabowski <art@stacken.kth.se>.
 1.48  27-May-2000  sommerfeld branches: 1.48.4;
Reduce use of curproc in several places:

- Change ktrace interface to pass in the current process, rather than
p->p_tracep, since the various ktr* function need curproc anyway.

- Add curproc as a parameter to mi_switch() since all callers had it
handy anyway.

- Add a second proc argument for inferior() since callers all had
curproc handy.

Also, miscellaneous cleanups in ktrace:

- ktrace now always uses file-based, rather than vnode-based I/O
(simplifies, increases type safety); eliminate KTRFLAG_FD & KTRFAC_FD.
Do non-blocking I/O, and yield a finite number of times when receiving
EWOULDBLOCK before giving up.

- move code duplicated between sys_fktrace and sys_ktrace into ktrace_common.

- simplify interface to ktrwrite()
 1.47  30-Mar-2000  augustss Get rid of register declarations.
 1.46  17-Mar-2000  darrenr build stkbuf out of u_long rather than char for sys_ioctl() to ensure we get an aligned array
 1.45  05-May-1999  thorpej branches: 1.45.2;
Add "use counting" to file entries. When closing a file, and it's reference
count is 0, wait for use count to drain before finishing the close.

This is necessary in order for multiple processes to safely share file
descriptor tables.
 1.44  04-Aug-1998  perry branches: 1.44.8;
Abolition of bcopy, ovbcopy, bcmp, and bzero, phase one.
bcopy(x, y, z) -> memcpy(y, x, z)
ovbcopy(x, y, z) -> memmove(y, x, z)
bcmp(x, y, z) -> memcmp(x, y, z)
bzero(x, y) -> memset(x, 0, y)
 1.43  03-Aug-1998  kleink UIO_MAXIOV -> IOV_MAX
 1.42  31-Jul-1998  perry fix sizeofs so they comply with the KNF style guide. yes, it is pedantic.
 1.41  31-Jul-1998  kleink Reject an iovcnt argument of 0 to readv(), writev(), preadv() and pwritev()
as invalid. This has been stated by the respective manual pages at least
since Net/2, and is the behaviour specified by XSH5.
 1.40  28-Jul-1998  thorpej branches: 1.40.2;
When checking for overflow in the residual count, test against SSIZE_MAX.
The read/write system calls return ssize_t because -1 is used to indicate
error, therefore the transfer size MUST be limited to SSIZE_MAX, otherwise
garbage can be returned to the user.

There is NO change from existing behavior here, only a more precise
definition of that the semantics are, except in the Alpha case, where
the full SSIZE_MAX transfer size can now be realized (ssize_t is 64-bit
on the Alpha).
 1.39  30-Jun-1998  thorpej Split up read/readv/write/writev into the system call front-end and
the guts that actually perform the I/O request.
 1.38  30-Jun-1998  thorpej Add two additional arguments to the fileops read and write calls, a
pointer to the offset to use, and a flags word. Define a flag that
specifies whether or not to update the offset passed by reference.
 1.37  25-Jun-1998  thorpej defopt KTRACE
 1.36  01-Mar-1998  fvdl Merge with Lite2 + local changes
 1.35  04-Nov-1997  thorpej Fix slight argument bogosity with getgroups(), setgroups(), select(),
and swapctl(). For the former three, they use an 'int' in their user-land
prototype which was a 'u_int' in the kernel, which screwed up automatic
generation/checking of lint syscall stubs. For the latter, the user-land
prototype uses a "const char *", but the syscall just used "char *".

From Chris Demetriou <cgd@pa.dec.com>.
 1.34  15-Oct-1997  mycroft branches: 1.34.2;
Adjust u_int arguments of some system calls to int, to match user-level
prototypes.
 1.33  23-Feb-1997  mrg in pollscan, cast incoming fd to unsigned int. from mycroft.
 1.32  18-Feb-1997  mrg check that fd being poll()ed is valid. from mycroft.
 1.31  22-Dec-1996  cgd branches: 1.31.6;
* catch up with system call argument type fixups/const poisoning.
* Fix arguments to various copyin()/copyout() invocations, to avoid
gratuitous casts.
* Some KNF formatting fixes
 1.30  07-Sep-1996  mycroft Use INFTIM, not -1.
 1.29  07-Sep-1996  mycroft Modify poll(2) prototype.
 1.28  07-Sep-1996  mycroft Implement poll(2).
 1.27  05-Sep-1996  mycroft Clean up sys_select() slightly.
 1.26  13-Jun-1996  cgd in select(), if it's a small number of file descriptors use a
automatic array rather than an array allocated with alloca().
(This was the only use of alloca() in the kernel, and it wasn't
necessary or consistent with the way other functions in this file
work.)
 1.25  02-Jun-1996  mycroft Deal with FD_SETSIZE larger than the default.
 1.24  29-Mar-1996  cgd branches: 1.24.4;
kill unnecessary (and sometimes dangerous) casts of ioctl commands to int
 1.23  09-Feb-1996  christos More proto fixes
 1.22  04-Feb-1996  christos First pass at prototyping
 1.21  07-Oct-1995  mycroft Prefix names of system call implementation functions with `sys_'.
 1.20  19-Sep-1995  thorpej Make system calls conform to a standard prototype and bring those
prototypes into scope.
 1.19  21-Mar-1995  mycroft Update to use timer{add,sub}().
 1.18  11-Dec-1994  mycroft Use __timer{add,sub}(), not timeval{add,sub}(). Remove the latter completely.
 1.17  30-Oct-1994  cgd be more careful with types, also pull in headers where necessary.
 1.16  20-Oct-1994  cgd update for new syscall args description mechanism
 1.15  29-Jun-1994  cgd New RCS ID's, take two. they're more aesthecially pleasant, and use 'NetBSD'
 1.14  19-May-1994  cgd update to 4.4-lite
 1.13  07-May-1994  cgd setrun changes name
 1.12  05-May-1994  cgd lots of changes: prototype migration, move lots of variables, definitions,
and structure elements around. kill some unnecessary type and macro
definitions. standardize clock handling. More changes than you'd want.
 1.11  04-May-1994  cgd Rename a lot of process flags.
 1.10  16-Feb-1994  pk read(): return EINVAL if `count' argument is negative.
 1.9  18-Dec-1993  mycroft Canonicalize all #includes.
 1.8  15-Jul-1993  cgd branches: 1.8.4;
make args & locals of select unsigned where appropriate.
 1.7  13-Jul-1993  cgd break args structs out, into syscallname_args structs, so gcc2 doesn't
whine so much.
 1.6  22-Jun-1993  glass more damn ansi function declarations. damn you chris....
 1.5  14-Jun-1993  cgd a few changes to select. most notable: don't sleep forever unless
user actually wants to. (it could happen in strange circumstances...)
 1.4  13-Jun-1993  mycroft Believe it or not, selrecord() was broken...
 1.3  18-May-1993  cgd make kernel select interface be one-stop shopping & clean it all up.
 1.2  21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.3  01-Mar-1998  fvdl Import 4.4BSD-Lite2
 1.1.1.2  01-Mar-1998  fvdl Import 4.4BSD-Lite for reference
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.4.2  14-Nov-1993  mycroft Canonicalize all #includes.
 1.8.4.1  24-Sep-1993  mycroft Make all files using spl*() #include cpu.h. Changes from trunk.
init_main.c: New method of pseudo-device of initialization.
kern_clock.c: hardclock() and softclock() now take a pointer to a clockframe.
softclock() only does callouts.
kern_synch.c: Remove spurious declaration of endtsleep(). Adjust uses of
averunnable for new struct loadav.
subr_prf.c: Allow printf() formats in panic().
tty.c: averunnable changes.
vfs_subr.c: va_size and va_bytes are now quads.
 1.24.4.1  10-Dec-1996  mycroft From trunk:
Clean up sys_select() a bit, and make it deal with nfds being larger than
the default FD_SETSIZE.
 1.31.6.1  12-Mar-1997  is Merge in changes from Trunk
 1.34.2.1  04-Nov-1997  thorpej Pull up from trunk: Fix syscall argument type bogons.
 1.40.2.1  08-Aug-1998  eeh Revert cdevsw mmap routines to return int.
 1.44.8.1  21-Jun-1999  thorpej Sync w/ -current.
 1.45.2.2  12-Mar-2001  bouyer Sync with HEAD.
 1.45.2.1  20-Nov-2000  bouyer Update thorpej_scsipi to -current as of a month ago
 1.48.4.3  28-Mar-2002  he Pull up revision 1.62 (via patch, requested by jdolecek):
Make sure file descriptor is properly FILE_UNUSE()d in error case
of writev.
 1.48.4.2  24-Dec-2001  he Pull up revision 1.60 (requested by skrll):
Make poll(2) ignore negative file descriptors, which is in line
with the Single Unix Specification.
 1.48.4.1  13-Jul-2000  thorpej Pull up rev. 1.49:
When select(2)/poll(2) is awakened by a collision, recalculate the
timeout value for tsleep(). From Artur Grabowski <art@stacken.kth.se>.
 1.54.2.11  11-Dec-2002  thorpej Sync with HEAD.
 1.54.2.10  27-Aug-2002  nathanw Catch up to -current.
 1.54.2.9  13-Aug-2002  nathanw Catch up to -current.
 1.54.2.8  12-Jul-2002  nathanw No longer need to pull in lwp.h; proc.h pulls it in for us.
 1.54.2.7  29-May-2002  nathanw #include <sys/sa.h> before <sys/syscallargs.h>, to provide sa_upcall_t
now that <sys/param.h> doesn't include <sys/sa.h>.

(Behold the Power of Ed)
 1.54.2.6  01-Apr-2002  nathanw Catch up to -current.
(CVS: It's not just a program. It's an adventure!)
 1.54.2.5  08-Jan-2002  nathanw Catch up to -current.
 1.54.2.4  14-Nov-2001  nathanw Catch up to -current.
 1.54.2.3  24-Aug-2001  nathanw Catch up with -current.
 1.54.2.2  21-Jun-2001  nathanw Catch up to -current.
 1.54.2.1  05-Mar-2001  nathanw Initial commit of scheduler activations and lightweight process support.
 1.57.6.1  12-Nov-2001  thorpej Sync the thorpej-mips-cache branch with -current.
 1.57.4.1  07-Sep-2001  thorpej Commit my "devvp" changes to the thorpej-devvp branch. This
replaces the use of dev_t in most places with a struct vnode *.

This will form the basic infrastructure for real cloning device
support (besides being architecurally cleaner -- it'll be good
to get away from using numbers to represent objects).
 1.57.2.3  06-Sep-2002  jdolecek sync kqueue branch with HEAD
 1.57.2.2  23-Jun-2002  jdolecek catch up with -current on kqueue branch
 1.57.2.1  10-Jan-2002  thorpej Sync kqueue branch with -current.
 1.62.2.1  29-Aug-2002  gehenna catch up with -current.
 1.76.2.6  10-Nov-2005  skrll Sync with HEAD. Here we go again...
 1.76.2.5  04-Mar-2005  skrll Sync with HEAD.

Hi Perry!
 1.76.2.4  21-Sep-2004  skrll Fix the sync with head I botched.
 1.76.2.3  18-Sep-2004  skrll Sync with HEAD.
 1.76.2.2  03-Aug-2004  skrll Sync with HEAD
 1.76.2.1  02-Jul-2003  darrenr Apply the aborted ktrace-lwp changes to a specific branch. This is just for
others to review, I'm concerned that patch fuziness may have resulted in some
errant code being generated but I'll look at that later by comparing the diff
from the base to the branch with the file I attempt to apply to it. This will,
at the very least, put the changes in a better context for others to review
them and attempt to tinker with removing passing of 'struct lwp' through
the kernel.
 1.81.10.1  19-Mar-2005  yamt sync with head. xen and whitespace. xen part is not finished.
 1.81.8.1  29-Apr-2005  kent sync with -current
 1.83.2.9  24-Mar-2008  yamt sync with head.
 1.83.2.8  17-Mar-2008  yamt sync with head.
 1.83.2.7  21-Jan-2008  yamt sync with head
 1.83.2.6  07-Dec-2007  yamt sync with head
 1.83.2.5  27-Oct-2007  yamt sync with head.
 1.83.2.4  03-Sep-2007  yamt sync with head.
 1.83.2.3  26-Feb-2007  yamt sync with head.
 1.83.2.2  30-Dec-2006  yamt sync with head.
 1.83.2.1  21-Jun-2006  yamt sync with head.
 1.84.6.2  22-Apr-2006  simonb Sync with head.
 1.84.6.1  04-Feb-2006  simonb Adapt for timecounters: mostly use get*time() and use "time_second"
instead of "time.tv_sec".
 1.84.4.1  09-Sep-2006  rpaulo sync with head
 1.84.2.1  31-Dec-2005  yamt uio_segflg/uio_lwp -> uio_vmspace.
 1.85.8.1  19-Jun-2006  chap Sync with head.
 1.85.2.3  03-Sep-2006  yamt sync with head.
 1.85.2.2  11-Aug-2006  yamt sync with head
 1.85.2.1  26-Jun-2006  yamt sync with head.
 1.86.2.1  13-Jul-2006  gdamore Merge from HEAD.
 1.92.4.2  10-Dec-2006  yamt sync with head.
 1.92.4.1  22-Oct-2006  yamt sync with head
 1.92.2.7  01-Feb-2007  ad Sync with head.
 1.92.2.6  30-Jan-2007  ad Remove support for SA. Ok core@.
 1.92.2.5  12-Jan-2007  ad Sync with head.
 1.92.2.4  29-Dec-2006  ad Checkpoint work in progress.
 1.92.2.3  24-Oct-2006  ad Fix a locking botch.
 1.92.2.2  21-Oct-2006  ad Checkpoint work in progress on locking and per-LWP signals. Very much a
a work in progress and there is still a lot to do.
 1.92.2.1  11-Sep-2006  ad Grab proclist_mutex in a few more places.
 1.97.4.1  23-Sep-2007  wrstuden Sync with somewhat-recent netbsd-4.
 1.97.2.1  11-Sep-2007  xtraeme Pull up following revision(s) (requested by rmind in ticket #869):
sys/kern/sys_generic.c: revision 1.106 via patch

Fix various possible dereferences via uvmspace_free() of non-initialized *vm.
Also, error case might happen before proc_vmspace_getref() (hi <ad>!).
Thanks CID 4551 and 4552. This is serious, pullup will be requested.
OK by <wrstuden>.
 1.98.2.2  12-Mar-2007  rmind Sync with HEAD.
 1.98.2.1  27-Feb-2007  yamt - sync with head.
- move sched_changepri back to kern_synch.c as it doesn't know PPQ anymore.
 1.100.4.1  11-Jul-2007  mjf Sync with head.
 1.100.2.14  09-Oct-2007  ad Sync with head.
 1.100.2.13  03-Oct-2007  ad - Don't do proc_vmspace_getref() in dofileread() and friends. They only
ever access the caller's vmspace so it's not going to go away. Instead
just use curproc->p_vmspace. Fixes high lock contention during file I/O
by multithreaded processes. Don't pass in lwp_t *l, it's confusing.

- Drain cleaned vnodes from mountpoints just before checking to see
if there are danglers. Cleaned vnodes now stick around on mountpoint
lists until reused, as it's too expensive to pull them off earlier.
 1.100.2.12  25-Sep-2007  ad Update a comment.
 1.100.2.11  30-Aug-2007  ad Add selinit() and seldestroy(), and use with pipes. Occasionally an LWP
can still be waiting on a object after it has been destroyed.
 1.100.2.10  20-Aug-2007  ad Sync with HEAD.
 1.100.2.9  15-Jul-2007  ad Sync with head.
 1.100.2.8  15-Jul-2007  ad Sync with head.
 1.100.2.7  09-Jun-2007  ad Sync with head.
 1.100.2.6  28-Apr-2007  ad select/poll:

- Don't try to awaken LWPs more than once. Prevents unnecessary locking.
- Tidy slightly.
 1.100.2.5  13-Apr-2007  ad - Fix a (new) bug where vget tries to acquire freed vnodes' interlocks.
- Minor locking fixes.
 1.100.2.4  10-Apr-2007  ad Tidy slightly.
 1.100.2.3  10-Apr-2007  ad Changes to select/poll:

- Make them MP safe and decouple from the proc locks.
- selwakeup: don't call p_find, or traverse per-proc LWP lists (ouch).
- selwakeup: don't lock the sleep queue unless we need to.
 1.100.2.2  23-Mar-2007  ad Don't kmem_free() kernel stack.
 1.100.2.1  21-Mar-2007  ad - Replace more simple_locks, and fix up in a few places.
- Use condition variables.
- LOCK_ASSERT -> KASSERT.
 1.103.6.5  09-Dec-2007  jmcneill Sync with HEAD.
 1.103.6.4  26-Oct-2007  joerg Sync with HEAD.

Follow the merge of pmap.c on i386 and amd64 and move
pmap_init_tmp_pgtbl into arch/x86/x86/pmap.c. Modify the ACPI wakeup
code to restore CR4 before jumping back into kernel space as the large
page option might cover that.
 1.103.6.3  02-Oct-2007  joerg Sync with HEAD.
 1.103.6.2  03-Sep-2007  jmcneill Sync with HEAD.
 1.103.6.1  16-Aug-2007  jmcneill Sync with HEAD.
 1.103.2.2  10-Sep-2007  skrll Sync with HEAD.
 1.103.2.1  03-Sep-2007  skrll Sync with HEAD.
 1.105.2.3  23-Mar-2008  matt sync with HEAD
 1.105.2.2  09-Jan-2008  matt sync with HEAD
 1.105.2.1  06-Nov-2007  matt sync with HEAD
 1.106.2.2  14-Oct-2007  yamt sync with head.
 1.106.2.1  06-Oct-2007  yamt sync with head.
 1.108.6.2  26-Dec-2007  ad Sync with head.
 1.108.6.1  08-Dec-2007  ad Sync with head.
 1.108.4.3  18-Feb-2008  mjf Sync with HEAD.
 1.108.4.2  27-Dec-2007  mjf Sync with HEAD.
 1.108.4.1  08-Dec-2007  mjf Sync with HEAD.
 1.109.4.2  08-Jan-2008  bouyer Sync with HEAD
 1.109.4.1  02-Jan-2008  bouyer Sync with HEAD
 1.111.6.3  02-Jul-2008  mjf Sync with HEAD.
 1.111.6.2  02-Jun-2008  mjf Sync with HEAD.
 1.111.6.1  03-Apr-2008  mjf Sync with HEAD.
 1.111.2.1  24-Mar-2008  keiichi sync with head.
 1.117.2.1  18-May-2008  yamt sync with head.
 1.118.2.4  19-Aug-2009  yamt sync with head.
 1.118.2.3  20-Jun-2009  yamt sync with head
 1.118.2.2  04-May-2009  yamt sync with head.
 1.118.2.1  16-May-2008  yamt sync with head.
 1.119.4.1  03-Jul-2008  simonb Sync with head.
 1.119.2.3  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.119.2.2  14-May-2008  wrstuden Per discussion with ad, remove most of the #include <sys/sa.h> lines
as they were including sa.h just for the type(s) needed for syscallargs.h.

Instead, create a new file, sys/satypes.h, which contains just the
types needed for syscallargs.h. Yes, there's only one now, but that
may change and it's probably more likely to change if it'd be difficult
to handle. :-)

Per discussion with matt at n dot o, add an include of satypes.h to
sigtypes.h. Upcall handlers are kinda signal handlers, and signalling
is the header file that's already included for syscallargs.h that
closest matches SA.

This shaves about 3000 lines off of the diff of the branch relative
to the base. That also represents about 18% of the total before this
checkin.

I think this reduction is very good thing.
 1.119.2.1  10-May-2008  wrstuden Initial checkin of re-adding SA. Everything except kern_sa.c
compiles in GENERIC for i386. This is still a work-in-progress, but
this checkin covers most of the mechanical work (changing signalling
to be able to accomidate SA's process-wide signalling and re-adding
includes of sys/sa.h and savar.h). Subsequent changes will be much
more interesting.

Also, kern_sa.c has received partial cleanup. There's still more
to do, though.
 1.120.12.1  17-Jun-2009  bouyer branches: 1.120.12.1.2;
Pull up following revision(s) (requested by rmind in ticket #811):
sys/kern/sys_generic.c: revision 1.122 via patch
Updates to f_flag need to be made with atomics.
 1.120.12.1.2.1  21-Apr-2010  matt sync to netbsd-5
 1.120.10.1  23-Jul-2009  jym Sync with HEAD.
 1.120.6.1  17-Jun-2009  bouyer Pull up following revision(s) (requested by rmind in ticket #811):
sys/kern/sys_generic.c: revision 1.122 via patch
Updates to f_flag need to be made with atomics.
 1.124.6.1  06-Jun-2011  jruoho Sync with HEAD.
 1.124.4.2  21-Apr-2011  rmind sync with head
 1.124.4.1  05-Mar-2011  rmind sync with head
 1.127.6.1  18-Feb-2012  mrg merge to -current.
 1.127.2.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.127.2.1  17-Apr-2012  yamt sync with head
 1.128.6.2  03-Dec-2017  jdolecek update from HEAD
 1.128.6.1  23-Jun-2013  tls resync from head
 1.128.4.1  06-Dec-2012  matt Make sure ioctl stkbuf has a minimal alignment of (__ALIGNBYTES+1)
 1.128.2.1  20-Apr-2013  bouyer Pull up following revision(s) (requested by martin in ticket #865):
sys/arch/vax/include/disklabel.h: revision 1.7
sys/arch/vax/boot/xxboot/start.S: revision 1.5
sys/sys/bootblock.h: revision 1.55
sys/sys/disklabel.h: revision 1.113
usr.sbin/installboot/arch/vax.c: revision 1.14
usr.sbin/installboot/arch/vax.c: revision 1.15
sys/kern/sys_generic.c: revision 1.129
Revert VAX MAXPARTITION bump to 16, adjusting it to 12 instead. Fix bootblocks
and installboot for VAX 780 and other machines booting via VMB.EXE.
 1.130.2.1  28-Aug-2017  skrll Sync with HEAD

RSS XML Feed