summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_subr.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* In hash{free,init}(), there's no need to calculate the size of the hash table ifanton2018-04-291-5/+11
| | | | | | the given number of elements already is a power of 2. ok visa@, "seems like a good plan" deraadt@
* Convert most of the manual checks for CPU hogging to sched_pause().mpi2017-02-141-4/+2
| | | | | | | | The distinction between preempt() and yield() stays as it is usueful to know if a thread decided to yield by itself or if the kernel told him to go away. ok tedu@, guenther@
* introduce hashfree() function to free hash tables, with sizes.tedu2016-09-241-1/+15
| | | | ok guenther
* Remove now unused legacy uiomovei() function.stefan2016-03-151-10/+1
| | | | | | | All its callers got reviewed and converted to use uiomove() properly. ok deraadt@
* Make sure uiomove does not copy more than uio_resid bytes, as the manualstefan2016-02-111-6/+8
| | | | | | says. Move code belonging to diagnostics in the #ifdef DIAGNOSTIC part and add a KASSERT that makes sure that we do not run beyond uio_iov. Diff from Martin Natano.
* Replace mountroothook_establish(9) by config_mountroot(9) a narrower APImpi2015-12-111-4/+2
| | | | | | similar to config_defer(9). ok mikeb@, deraadt@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* First step towards making uiomove() take a size_t size argument:miod2015-02-101-2/+11
| | | | | | | - rename uiomove() to uiomovei() and update all its users. - introduce uiomove(), which is similar to uiomovei() but with a size_t. - rewrite uiomovei() as an uiomove() wrapper. ok kettenis@
* retire shutdown hooks; ok deraadt, krwmikeb2014-12-101-4/+2
|
* add a few sizes to freetedu2014-11-011-3/+3
|
* trim some caststedu2014-07-131-2/+2
|
* use mallocarray where arguments are multipled. ok deraadttedu2014-07-131-2/+2
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-3/+3
| | | | after discussions with beck deraadt kettenis.
* When hooks are called, allow them to disestablish themselves by usingreyk2013-10-191-3/+3
| | | | | | the safe version to traverse the TAILQ list. ok deraadt@
* Correct the handling of I/O of >=2^32 bytes and the ktracing there ofguenther2013-09-141-6/+4
| | | | | | by using size_t/ssize_t instead of int/u_int to handle I/O lengths in uiomove(), vn_fsizechk(), and ktrgenio(). Eliminate the always-zero 'error' argument to ktrgenio() at the same time.
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-3/+5
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* remove the powerhook code. All architectures now use the ca_activate treederaadt2010-09-071-71/+1
| | | | | traversal code to suspend/resume ok oga kettenis blambert
* All PWR_{SUSPEND,RESUME} can now be replaced by DVACT_{SUSPEND,RESUME}deraadt2010-09-061-2/+2
|
* Remove silly panic when disestablish cookie doesnt existmarco2008-06-121-2/+2
| | | | ok art
* The world of __HAVEs and __HAVE_NOTs is reducing. All architecturesart2007-05-161-5/+1
| | | | | | have cpu_info now, so kill the option. eyeballed by jsg@ and grange@
* ansi/deregister.jsg2005-11-281-28/+12
| | | | 'go for it' deraadt@
* mountroothooks are called after the root filesystem is mounted.deraadt2004-11-281-1/+3
|
* debranch SMP, have funniklas2004-06-131-1/+2
|
* Merge in a piece of the SMP branch into HEAD.art2004-06-091-1/+6
| | | | | | | | | | | Introduce the cpu_info structure, p_cpu field in struct proc and global scheduling context and various changed code to deal with this. At the moment no architecture uses this stuff yet, but it will allow us slow and controlled migration to the new APIs. All new code is ifdef:ed out. ok deraadt@ niklas@
* allocate at least as much elements as requested in hashinitmarkus2003-10-311-6/+4
| | | | | fixes pr 3537, based on patch from daniel@nofsk.nofsk.au.eu.org ok millert@, deraadt@, tedu@
* remove caddr_t casts. it's just silly to cast something when the functiontedu2003-07-211-3/+3
| | | | takes a void *. convert uiomove to take a void * as well. ok deraadt@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Remove fetch(9) and store(9) functions from the kernel, and replace the fewmiod2003-01-091-2/+6
| | | | | | remaining instances of them with appropriate copy(9) usage. ok art@, tested on all arches unless my memory is non-ECC
* - Add a flags argument to dohooks.art2002-07-121-9/+18
| | | | | | | | | | | | | | | | The flag can be either HOOK_REMOVE or HOOK_REMOVE|HOOK_FREE. o HOOK_REMOVE removes the hook from the list before executing it. o HOOK_FREE frees the hook after that. - Let dostartuphooks use HOOK_REMOVE|HOOK_FREE so we can reclaim the memory. - Let doshutdownhooks use HOOK_REMOVE so that when some shutdown hook panics (they do that all the #@$%! time these days) we don't loop for ever. Don't HOOK_FREE, it doesn't matter and I don't want to add another possible panic condition for shutdown hooks. - Actually free the pointer we're throwing away in hook_disestablish (I wonder how much memory this has leaked over the years).
* First round of __P removal in sysmillert2002-03-141-4/+4
|
* Startup hooks. Can be used for providing root/swap devices from deviceniklas2001-07-271-38/+37
| | | | | | systems which want configuration to finish late, like I2O. Implemented via a general hooks mechanism which the shutdown hooks have been converted to use as well. It even has manpages!
* remove old vmart2001-06-271-9/+1
|
* Appease gcc by not using void pointers in arithmetic operations; art@ okaaron2001-06-261-3/+3
|
* Since malloc in hashinit can get M_NOWAIT flags, we shouldart2001-06-231-1/+3
| | | | check the return value.
* On resume run the powerhook in installation order.art2000-09-071-3/+9
| | | | (the powerhooks were always run in reverse order).
* Put powerhooks on a CIRCLEQ instead of LIST.art2000-09-071-10/+9
| | | | Use FOREACH macros instead of walking the list manually.
* Run powerhooks at splhigh.art2000-09-071-2/+2
|
* Wrap power hooks in splimp(), fixes WaveLAN suspend problem; thanks art@aaron2000-09-051-1/+4
|
* Remove the roundrobin_attempts hack and replace it with per-process schedulingart2000-04-191-21/+3
| | | | | | | flags (much nicer for future smp work). Add two generic functions yield() and preempt(). Use preepmt() in uio when we are told to yield. Based on my idea, code written by Jason Thorpe from NetBSD.
* If we attempted reschedule two times without suceeding, uiomove will yield,art2000-03-031-3/+28
| | | | | | | | | | giving other processes a chance to run. A process feeding a huge buffer to {read,write}{,v} on a file that doesn't need to wait for I/O, could have hogged a lot of cpu in the kernel, blocking all userland activity. Based on a similiar fix in FreeBSD.
* add APM powerhooks.provos1999-11-071-1/+67
| | | | | | | | from NetBSD, Sat Jun 26 08:25:25 1999 UTC by augustss: Add powerhooks, i.e., the ability to register a function that will be called when the machine does a suspend or resume. XXX Will go away when Jason's kevents come to life.
* zap the newhashinit hack.art1999-04-281-10/+2
| | | | | Add an extra flag to hashinit telling if it should wait in malloc. update all calls to hashinit.
* uvm uses kcopy when uiomoving from sysspaceart1999-02-261-1/+10
|
* Add newhashinit(), which is identical to hashinit() except it takes a flagsmillert1999-02-261-2/+10
| | | | | | arg for passing to malloc() (hashinit always uses M_WAITOK which is not always what you want). Everything that uses hashinit should really get converted to newhashinit and then newhashinit can be renamed.
* Return EINVAL when msg_iovlen or iovcnt <= 0; Make uio_resid unsigned (size_t) and don't return EINVAL if it is < 0 in sys_{read,write}. Remove check for uio_resid < 0 uiomove() now that uio_resid is unsigned and brack remaining panics with #ifdef DIAGNOSTIC. vn_rdwr() must now take a size_t * ↵millert1998-07-281-3/+11
| | | | as its 9th argument so change that and clean up uses of vn_rdwr(). Fixes 549 + more
* compile if iov_base is void *deraadt1998-05-111-2/+2
|
* OpenBSD tagsniklas1997-02-241-0/+1
|
* partial sync with netbsd 960418, more to comederaadt1996-04-211-1/+1
|
* Removed vax ifdefed function from kern_subr.c (from NetBSD).mickey1996-04-171-43/+0
| | | | | Do sync in the order of umount (vfs_syscals.c), as it was pointed by someone in NetBSD's lists.
* initial import of NetBSD treederaadt1995-10-181-0/+276