summaryrefslogtreecommitdiffstats
path: root/sys/kern/init_main.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* change the stack protector guard into a long word (removing the old legacyderaadt2013-12-281-14/+6
| | | | | | compat pointed out by miod), and place it inside the ELF .openbsd.randomdata segment. Inside main(), only re-initialize the guard if the bootblocks failed to initialize it for us.
* We can initialize the srandom/random system earlier from arc4random,deraadt2013-12-281-7/+1
| | | | and do not need microtime.
* We can random_start() earlier (not that it does too much) and callderaadt2013-12-281-3/+6
| | | | | arc4random() much earlier. Leading to random pids for anything besides 0 and 1.
* Change 'mountlist' from CIRCLEQ to TAILQ. Be paranoid andkrw2013-12-011-3/+3
| | | | | | | | | use TAILQ_*_SAFE more than might be needed. Bulk ports build by sthen@ showed nobody sticking their fingers so deep into the kernel. Feedback and suggestions from millert@. ok jsing@
* introduce tasks and taskqs as an alternative to workqs.dlg2013-10-291-1/+4
| | | | | | | | | | | | | | | | | | tasks are modelled on the timeout api, so users familiar with timeout_set, timeout_add, and timeout_del will already know what to expect from task_set, task_add, and task_del. i wrote this because workq_add_task can fail in the place you actually need it, and there arent any good ways of recovering at that point. workq_queue_task was added to try and help, but required external state to be stored for users of that api to know whether something was already queued or not. workqs also didnt provide a way to cancel or remove work. this has been percolating with a bunch of people. putting it in as i wrote it so i can apply their feedback to the code with the history kept in cvs.
* move attach mpath before any hardware. the benefits being:dlg2013-08-261-4/+6
| | | | | | | | | | | | | | | | | | - the mpath hooks path drivers call dont have to parse autoconf structures to tell if mpath may attach in the future. it now either has already attached or never will, which is simpler to check. - i can get rid of the global mpath target array by moving it into the mpath softc because of the above. - makes reasoning about state transitions (especially around when to attach) when groups of paths are implemented a lot simpler the only real caveat is dmesg feng shui may be ruined. i can come back and look at this after i move mpath itself forward though. discussed with deraadt@ miod@ ok todd@ matthew@ krw@
* Convert some internal APIs to use timespecs instead of timevalsguenther2013-06-031-5/+5
| | | | ok matthew@ deraadt@
* 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
|