summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* do not include machine/cpu.h from a .c file; it is the responsibility ofderaadt2013-03-281-2/+1
| | | | | .h files to pull it in, if needed ok tedu
* reseed the random pool with 'dmesg' when more devices are attachedmarkus2013-03-251-1/+3
| | | | from hshoexer@; ok tedu@, "looks good" deraadt@
* copyright++;jasper2013-01-011-2/+2
|
* unifdef -D __HAVE_TIMECOUNTERmiod2012-11-051-5/+1
|
* Add __guard_local as a hidden symbol to ld.so, kernel, and everymatthew2012-08-281-1/+7
| | | | | | executable and DSO (via crtbegin.c/crtbeginS.c). Not used yet, but needed before GCC can start emitting -fstack-protector code that uses them instead of __guard.
* Expose reaperproc.ariane2012-06-131-2/+3
| | | | | | I need this for my diffs. ok guenther@
* Make rusage totals, itimers, and profile settings per-process insteadguenther2012-03-231-9/+3
| | | | | | | of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
* copyright++fgsch2012-01-011-2/+2
|
* Functions used in files other than where they are defined should beguenther2011-07-071-4/+1
| | | | | | | declared in .h files, not in each .c. Apply that rule to endtsleep(), scheduler_start(), updatepri(), and realitexpire() ok deraadt@ tedu@
* Clean up after P_BIGLOCK removal.art2011-07-061-3/+3
| | | | | | | KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK oga@ ok
* Recommit the reverted sigacts change now that the NFS use-after-freeguenther2011-07-051-2/+5
| | | | | | | | problem has been tracked down. This fixes the sharing of the signal handling state: shared bits go in sigacts, per-rthread bits goes in struct proc. ok deraadt@
* Revert the sigacts diff: NFS can apparently retain pointers to processesguenther2011-04-181-5/+2
| | | | | | until they're zombies and then send them signals (for intr mounts). Until that is untangled, the sigacts change is unsafe. sthen@ was the victim for this one
* Correct the sharing of the signal handling state: stuff that shouldguenther2011-04-151-2/+5
| | | | | | | | | | | | be shared (p_sigignore, p_sigcatch, P_NOCLDSTOP, P_NOCLDWAIT) moves to struct sigacts, wihle stuff that should be per rthread (ps_oldmask, SAS_OLDMASK, ps_sigstk) moves to struct proc. Treat the coredumping state bits (ps_sig, ps_code, ps_type, ps_sigval) as per-rthread until our locking around coredumping is better. Oh, and remove the old SunOS-compat ps_usertramp member. "I like the sound of this" tedu@
* The scheduling 'nice' value is per-process, not per-thread, so move itguenther2011-03-071-2/+2
| | | | | | into struct process. ok tedu@ deraadt@
* split randomattach into random_init() and random_start(), so that wederaadt2011-01-081-2/+5
| | | | | can make attempts to load 'entropy' into the RC4. ok miod ariane
* copyright++;deraadt2011-01-011-2/+2
|
* Convert netisr to a normal soft interrupt instead of hanving MD codeclaudio2010-12-211-1/+3
| | | | | | for it. This makes the netisr a real C function which will help further development. No noticable performance change on i386 and amd64. With input from kettenis@ and miod@ additional OKs mikeb@ and henning@
* Reintroduce most crypto/crypto.c r1.55:jsing2010-09-081-7/+3
| | | | | | | | | | | Move pool initialization to init_crypto and zap the crypto_pool_initialized variable. This way we don't have to check if the pool are initialized every time we do a crypto_getreq(). However, also perform the crypto initialisation earlier in init_main so that the crypto pools are initialised before they are used. ok mikeb@ thib@ deraadt@
* Correct the links between threads, processes, pgrps, and sessions,guenther2010-07-261-6/+7
| | | | | | | | | so that the process-level stuff is to/from struct process and not struct proc. This fixes a bunch of problem cases in rthreads. Based on earlier work by blambert and myself, but mostly written at c2k10. Tested by many: deraadt, sthen, krw, ray, and in snapshots
* Fix the naming of interfaces and variables for rdomains and rtablesguenther2010-07-031-3/+3
| | | | | | | | | | | | and make it possible to bind sockets (including listening sockets!) to rtables and not just rdomains. This changes the name of the system calls, socket option, and ioctl. After building with this you should remove the files /usr/share/man/cat2/[gs]etrdomain.0. Since this removes the existing [gs]etrdomain() system calls, the libc major is bumped. Written by claudio@, criticized^Wcritiqued by me
* We always copy struct pcred when creating a new process, so the referenceguenther2010-06-291-2/+1
| | | | | count was always one. That's pointless, so remove the member and the code. ok tedu@
* Make sure we initialize sched_lock before we try to use it.kettenis2010-05-141-1/+2
| | | | ok miod@, thib@, oga@, jsing@
* Since ifinit() is now safe to be called earlier, call it just beforederaadt2010-01-121-2/+4
| | | | | configure(), since some upcoming changes will require it. ok henning
* copyright++;miod2010-01-011-2/+2
|
* The process's rdomain should be, well, per-process and not per-rthread,guenther2009-12-231-4/+4
| | | | | | | | so put it in struct process instead of struct proc. While at it, move the p_emul member inside struct proc so that it gets copied automatically instead of requiring manual assignment. ok deraadt@
* Add setrdomain() and getrdomain() system calls. Committing now toguenther2009-11-271-1/+4
| | | | | | | | catch the libc major bump per request from deraadt@ Diff by reyk. ok guenther@
* uvm_scheduler() sounds important, but ``while(1) tsleep()'' is kinda lameblambert2009-08-111-3/+6
| | | | | | | | | | inline the loop in the one place it exists, and remove it from uvm adjust a comment mentioning it accordingly originally inspired by a diff fixing a comment from oga@ ok art@ beck@ miod@ oga@
* add mpath(4), a driver that steals paths to scsi devices if itdlg2009-08-091-1/+5
| | | | | | | | | | thinks they could be available via multiple paths. those stolen devices are then made available via mpath(4). this is the minimum amount of code to implement the stealing. it is generally broken and very brittle, so it is currently disabled. it is going in so i can work on it in the tree.
* Remove the VREF() macro and replaces all instances with a call to verf(),thib2009-07-091-3/+3
| | | | | | | | | | | which is exactly what the macro does. Macro's that are nothing more then: #define FUNCTION(arg) function(arg) are almost always pointless and should go away. OK blambert@ Agreed by many.
* Count number of cpus found (potentially not attached) and store thatderaadt2009-04-191-1/+2
| | | | in sysctl hw.ncpufound; ok miod kettenis
* Make ELF platforms generate ELF core dumps. Somewhat based on code fromkettenis2009-03-051-1/+3
| | | | | | NetBSD. ok kurt@, drahn@, miod@
* use nitems(); dunnoseriously@gmailderaadt2009-02-131-3/+3
|
* copyright_year++;miod2009-01-011-2/+2
|
* add vscsi(4), a virtual scsi controller that passes all scsi requests up todlg2008-12-031-1/+5
| | | | | | | | userland for handling. this is to scsi what tun(4) is for networks. this is going into the tree so i can work on some crazy scsi stuff, but its not being enabled since it is useless unless you're working on some crazy scsi stuff.
* make random(9) return per-cpu values (by saving the seed in the cpuinfo),deraadt2008-10-151-2/+2
| | | | | | | which are uniform for the profclock on each cpu in a SMP system (but using a different seed for each cpu). on all cpus, avoid seeding with a value out of the [0, 2^31-1] range (since that is not stable) ok kettenis drahn
* Back-in; problems were apparently elsewhere.guenther2008-10-141-1/+2
| | | | | | | | | Put a reference count in struct process to prevent use-after-free if the main thread reaches the reaper ahead of some other thread in the process. Use the reference count to update the user process count correctly when changin real uid. "please re-commit before something else nasty comes in" deraadt@
* backout; is causing some people difficultyderaadt2008-10-101-2/+1
|
* Put a reference count in struct process to prevent use-after-freeguenther2008-10-091-1/+2
| | | | | | | if the main thread reaches the reaper ahead of some other thread in the process. ok art@ tedu@
* 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