summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* rename arc4random_bytes => arc4random_buf to match libc's nicer name;djm2008-06-091-2/+2
| | | | ok deraadt@
* retire vfs_mountroot();thib2008-05-061-3/+3
| | | | | | | | | setroot() is now (and has been) responsible for setting the mountroot function pointer "to the right thing", or failing todo that, to ffs_mountroot; based on a discussion/diff from deraadt@. OK deraadt@
* Welcome to the jungle of 2008.miod2008-01-011-2/+2
|
* convert crypto thread to workq. add WQ_DIRECTOK flag to workq.tedu2007-11-251-13/+3
| | | | | | combined, this lets us use crypto before the thread is running and therefore cryptoraid can attach nice and early. ok/testing deraadt mbalmer marco
* more remove unneeded declarations that shadows existing vars; ok by many.fgsch2007-10-161-2/+1
|
* Make context switching much more MI:art2007-10-101-2/+4
| | | | | | | | | | | | | | | | | | | | - Move the functionality of choosing a process from cpu_switch into a much simpler function: cpu_switchto. Instead of having the locore code walk the run queues, let the MI code choose the process we want to run and only implement the context switching itself in MD code. - Let MD context switching run without worrying about spls or locks. - Instead of having the idle loop implemented with special contexts in MD code, implement one idle proc for each cpu. make the idle loop MI with MD hooks. - Change the proc lists from the old style vax queues to TAILQs. - Change the sleep queue from vax queues to TAILQs. This makes wakeup() go from O(n^2) to O(n) there will be some MD fallout, but it will be fixed shortly. There's also a few cleanups to be done after this. deraadt@, kettenis@ ok
* Introduce a md pmap hook, pmap_remove_holes(), which is supposed to markmiod2007-09-101-2/+2
| | | | | | | | | | | | | | | the holes a MMU may have from a given vm_map. This will be automagically invoked for newly created vmspaces. On platforms with MMU holes (e.g. sun4, sun4c and vax), this prevents mmap(2) hints which would end up being in the hole to be accepted as valid, causing unexpected signals when the process tries to access the hole (since pmap can not fill the hole anyway). Unfortunately, the logic mmap() uses to pick a valid address for anonymous mappings needs work, as it will only try to find an address higher than the hint, which causes all mmap() with a hint in the hole to fail on vax. This will be improved later.
* Back out the tracking of procs in struct selinfo. There's one seriousart2007-07-251-3/+1
| | | | | | | bug in the code, but as soon as I try to fix it, it seems to trigger some other bugs. Instead of trying to figure out what's going on while everyone suffers, it's better to back out and figure out the bugs outside the tree.
* some architectures called setroot() from cpu_configure(), *way* before somederaadt2007-06-011-4/+2
| | | | | | | subsystems were enabled. others used a *md_diskconf -> diskconf() method to make sure init_main could "do late setroot". Change all architectures to have diskconf(), use it directly & late. tested by todd and myself on most architectures, ok miod too
* add an interface for work queues run from a kernel thread.dlg2007-05-311-1/+6
| | | | | | | | this type of code is implemented many times already in the kernel, this is a generic version of all those replicated code bases. originally from tedu@ ok tedu@ tom@ deraadt@
* The world of __HAVEs and __HAVE_NOTs is reducing. All architecturesart2007-05-161-14/+1
| | | | | | have cpu_info now, so kill the option. eyeballed by jsg@ and grange@
* move p_limit and p_cred into struct processtedu2007-04-121-2/+2
| | | | | leave macros behind for now to keep the commit small ok art beck miod pedro
* Start moving state that is shared among threads in a process intoart2007-04-031-4/+8
| | | | | | | | | | | a new struct. Instead of doing a huge rename and deal with the fallout for weeks, like other projects that need no mention, we will slowly and carefully move things out of struct proc into a new struct process. - Create struct process and the infrastructure to create and remove them. - Move threads in a process into struct process. deraadt@, tedu@ ok
* Kill the horrible hack of storing the pid in struct selinfo.art2007-03-241-1/+3
| | | | | | | | Instead, keep the proc pointer in it and put the selinfo on a list in struct proc in selrecord. Then clean up the list when leaving sys_select and sys_poll. miod@ ok, testing by many, including Bobs spamd boxes.
* attach softraid to the root of the device tree in a machine independantdlg2007-03-191-1/+7
| | | | | | | | way, rather than requiring some glue in each machines mainbus probe. it is still commented out. based on a discussion with miod@ ok marco@ deraadt@
* Since p_flag is often manipulated in interrupts and without biglockart2007-03-151-2/+2
| | | | | | | | | | | | it's a good idea to use atomic.h operations on it. This mechanic change updates all bit operations on p_flag to atomic_{set,clear}bits_int. Only exception is that P_OWEUPC is set by MI code before calling need_proftick and it's automatically cleared by ADDUPC. There's no reason for MD handling of that flag since everyone handles it the same way. kettenis@ ok
* Switch some lockmgr locks to rwlocks.art2007-01-121-4/+1
| | | | | | | | | | | In this commit: - gdt lock on amd64 - sysctl lock - malloc sysctl lock - disk sysctl lock - swap syscall lock miod@, pedro@ ok (and "looks good" others@)
* 2007drahn2007-01-021-2/+2
|
* Kernel stack can be swapped. This means that stuff that's on the stackmiod2006-11-291-2/+2
| | | | | | | | | | should never be referenced outside the context of the process to which this stack belongs unless we do the PHOLD/PRELE dance. Loads of code doesn't follow the rules here. Instead of trying to track down all offenders and fix this hairy situation, it makes much more sense to not swap kernel stacks. From art@, tested by many some time ago.
* grammar, spelling, and style fixes from bret lambert;jmc2006-11-141-2/+2
| | | | kern_descrip.c change ok deraadt
* initialize the propolice cookie more carefully so -fstack-protector-allderaadt2006-05-061-2/+10
| | | | will work; ok miod
* With the exception of two other small uncommited diffs this movesbrad2006-03-041-2/+2
| | | | | | the remainder of the network stack from splimp to splnet. ok miod@
* 2006miod2006-01-011-2/+2
|
* fix memory leak conditions in thrsleep and significantly simplifytedu2005-12-221-2/+1
|
* kernel support for threaded processes (rthreads).tedu2005-12-031-1/+5
| | | | | | | | uses rfork(RFTHREAD) to create threads, which are presently processes that are a little more tightly bound together. several new syscalls added to facilitate a userland thread library. all conditional on RTHREADS, currently disabled. ok deraadt
* ansi. No binary change.jsg2005-11-121-15/+8
|
* Typo in comment, from Giorgos Keramidas, keramida (at) ceid (dot)tom2005-07-181-2/+2
| | | | upatras (dot) gr. Thanks.
* 2005mickey2005-01-011-2/+2
|
* Use list and queue macros where applicable to make the code easier to read;miod2004-12-261-2/+2
| | | | no change in compiler assembly output.
* mountroothooks are called after the root filesystem is mounted.deraadt2004-11-281-1/+3
|
* Create the init process earlier, before the root filesystem is mounted,miod2004-11-231-22/+66
| | | | | | | | | | | and have it stall on a semaphore. This allows all kthread creations which could have been requested during autoconf to be processed before root is mounted as well. This causes umass devices attached to any usb with flags 1 (such as on macppc) to configure properly instead of panicing the kernel at mountroot time. From NetBSD; tested by various.
* This touches only MI code, and adds new time keeping code. Thetholo2004-07-281-3/+7
| | | | | | | | | | | | | | | code is all conditionalized on __HAVE_TIMECOUNTER, and not enabled on any platforms. adjtime(2) support exists, courtesy of nordin@, sysctl(2) support and a concept of quality for each time source attached exists. High quality time sources exists for PIIX4 ACPI timer as well as some AMD power management chips. This will have to be redone once we actually add ACPI support (at that time we need to use the ACPI interfaces to get at these clocks). ok art@ ken@ miod@ jmc@ and many more
* protect printf with a mutex instead of SIMPLELOCK.art2004-07-201-4/+1
|
* This moves access to wall and uptime variables in MI code,tholo2004-06-241-2/+3
| | | | | | | | | | | | | | encapsulating all such access into wall-defined functions that makes sure locking is done as needed. It also cleans up some uses of wall time vs. uptime some places, but there is sure to be more of these needed as well, particularily in MD code. Also, many current calls to microtime() should probably be changed to getmicrotime(), or to the {,get}microuptime() versions. ok art@ deraadt@ aaron@ matthieu@ beck@ sturm@ millert@ others "Oh, that is not your problem!" from miod@
* debranch SMP, have funniklas2004-06-131-7/+23
|
* Merge in a piece of the SMP branch into HEAD.art2004-06-091-2/+13
| | | | | | | | | | | 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@
* pull ncpus support from smp tree into main branch.marc2004-06-081-1/+2
| | | | | remove alpha specific definition of ncpus. OK (and tested on alpha) deraadt@
* init kqueues normally, from pedro martellettotedu2004-04-011-2/+8
|
* nicer printf for copyright. from Pedro Martellettotedu2004-03-141-3/+2
|
* call timeout_startup early, so timeouts are available. report from sam smithtedu2004-01-211-6/+6
| | | | ok art deraadt
* Get rid of M_LOCKF and use pool for allocating lockf structures.grange2004-01-141-1/+5
| | | | | | From NetBSD. Tested by many people, ok art@.
* 2004deraadt2004-01-011-2/+2
|
* use arc4random_bytestedu2003-11-031-6/+2
|
* match syscallargs comments with realityhenning2003-09-011-4/+4
| | | | | from Patrick Latifi <patrick.l@hermes.usherb.ca> ok jason@ tedu@
* emulation is now controlled by sysctl. changes:tedu2003-08-211-1/+7
| | | | | | | | | add e_flags to struct emul. this stores on/off and native flags. check for emul enabled in check_exec(). gather all the emuls into a emulsw so a sysctl can find them. create sysctl. move maxhdrsiz calcualation into init_main so it cleans up sys_execve codepath. teach sysctl utility to grok kern.emul hierarchy. requested and ok deraadt@ some comments from mickey@
* Remove the advertising clause in the UCB license which Berkeleymillert2003-06-021-6/+2
| | | | rescinded 22 July 1999. Proofed by myself and Theo.
* Add option NO_PROPOLICE, which explicitely disables the use of the propolicemiod2003-05-131-1/+7
| | | | | | | | stack protection when building kernels. Intended to be used on installation media, with tight space constraints - currently, only added where SMALL_KERNEL was already defined. Not thoroughly tested, but requested by deraadt.
* support for propolice in the kernel.tedu2003-05-131-1/+9
| | | | | | some style input itojun@ tdeval@ toby@ tested, mostly by deraadt, on i386, macppc, vax, sparc64 ok deraadt@ miod@
* Don't map the fake arg list for init with X permissions.art2003-05-091-2/+2
| | | | niklas@ tdeval@ ok
* move cpu_configre() lower after the proc0 is more completely initialized.mickey2003-03-061-14/+14
| | | | | still calculate the memory limits for proc0 at after the autoconf is done. miod@ testing on everything; art@ ok