summaryrefslogtreecommitdiff
path: root/sys/kern/init_main.c
AgeCommit message (Collapse)Author
2014-01-20Threads can't be zombies, only processes, so change zombproc to zombprocess,Philip Guenther
make it a list of processes, and change P_NOZOMBIE and P_STOPPED from thread flags to process flags. Add allprocess list for the code that just wants to see processes. ok tedu@
2014-01-19Refactor rnd startup so arc4random/arc4random_buf can create a chacha stateTheo de Raadt
on first call, very early on, from boot-supplied entropy, then feed from that. Later when we have more subsystems ready, the main() can properly initialize the entropy-driven model. Lots of discussion with mikeb. ok kettenis markus mikeb
2014-01-19insane typoTheo de Raadt
2014-01-19oops, forgotten partTheo de Raadt
Initialize ci_randseed better using arc4random() + a trick. Remove the libkern srandom() API since it is not suitable for this use. ok kettenis miod
2014-01-19With the earlier initialization of the random subsystem, random_hostseed()Theo de Raadt
is no longer providing significant value. The random subsystem is in pretty good state, and moments later userland will feed the dmesg. ok jsing
2014-01-19We can call random_start() immediately after cpu_startup, that is theTheo de Raadt
point at which everything it does is safe, including msg buffer access. ok kettenis jsing
2014-01-01copyright++Federico G. Schwindt
2013-12-28oops, the fallback stack protector code must handle 64-bit guardsTheo de Raadt
spotted by kettenis
2013-12-28change the stack protector guard into a long word (removing the old legacyTheo de Raadt
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.
2013-12-28We can initialize the srandom/random system earlier from arc4random,Theo de Raadt
and do not need microtime.
2013-12-28We can random_start() earlier (not that it does too much) and callTheo de Raadt
arc4random() much earlier. Leading to random pids for anything besides 0 and 1.
2013-12-01Change 'mountlist' from CIRCLEQ to TAILQ. Be paranoid andKenneth R Westerback
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@
2013-10-29introduce tasks and taskqs as an alternative to workqs.David Gwynne
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.
2013-08-26move attach mpath before any hardware. the benefits being:David Gwynne
- 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@
2013-06-03Convert some internal APIs to use timespecs instead of timevalsPhilip Guenther
ok matthew@ deraadt@
2013-03-28do not include machine/cpu.h from a .c file; it is the responsibility ofTheo de Raadt
.h files to pull it in, if needed ok tedu
2013-03-25reseed the random pool with 'dmesg' when more devices are attachedMarkus Friedl
from hshoexer@; ok tedu@, "looks good" deraadt@
2013-01-01copyright++;Jasper Lievisse Adriaanse
2012-11-05unifdef -D __HAVE_TIMECOUNTERMiod Vallat
2012-08-28Add __guard_local as a hidden symbol to ld.so, kernel, and everyMatthew Dempsky
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.
2012-06-13Expose reaperproc.Ariane van der Steldt
I need this for my diffs. ok guenther@
2012-03-23Make rusage totals, itimers, and profile settings per-process insteadPhilip Guenthe
of per-rthread. Handling of per-thread tick and runtime counters inspired by how FreeBSD does it. ok kettenis@
2012-01-01copyright++Federico G. Schwindt
2011-07-07Functions used in files other than where they are defined should bePhilip Guenthe
declared in .h files, not in each .c. Apply that rule to endtsleep(), scheduler_start(), updatepri(), and realitexpire() ok deraadt@ tedu@
2011-07-06Clean up after P_BIGLOCK removal.Artur Grabowski
KERNEL_PROC_LOCK -> KERNEL_LOCK KERNEL_PROC_UNLOCK -> KERNEL_UNLOCK oga@ ok
2011-07-05Recommit the reverted sigacts change now that the NFS use-after-freePhilip Guenthe
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@
2011-04-18Revert the sigacts diff: NFS can apparently retain pointers to processesPhilip Guenthe
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
2011-04-15Correct the sharing of the signal handling state: stuff that shouldPhilip Guenthe
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@
2011-03-07The scheduling 'nice' value is per-process, not per-thread, so move itPhilip Guenthe
into struct process. ok tedu@ deraadt@
2011-01-08split randomattach into random_init() and random_start(), so that weTheo de Raadt
can make attempts to load 'entropy' into the RC4. ok miod ariane
2011-01-01copyright++;Theo de Raadt
2010-12-21Convert netisr to a normal soft interrupt instead of hanving MD codeClaudio Jeker
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@
2010-09-08Reintroduce most crypto/crypto.c r1.55:Joel Sing
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@
2010-07-26Correct the links between threads, processes, pgrps, and sessions,Philip Guenthe
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
2010-07-03Fix the naming of interfaces and variables for rdomains and rtablesPhilip Guenthe
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
2010-06-29We always copy struct pcred when creating a new process, so the referencePhilip Guenthe
count was always one. That's pointless, so remove the member and the code. ok tedu@
2010-05-14Make sure we initialize sched_lock before we try to use it.Mark Kettenis
ok miod@, thib@, oga@, jsing@
2010-01-12Since ifinit() is now safe to be called earlier, call it just beforeTheo de Raadt
configure(), since some upcoming changes will require it. ok henning
2010-01-01copyright++;Miod Vallat
2009-12-23The process's rdomain should be, well, per-process and not per-rthread,Philip Guenthe
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@
2009-11-27Add setrdomain() and getrdomain() system calls. Committing now toPhilip Guenthe
catch the libc major bump per request from deraadt@ Diff by reyk. ok guenther@
2009-08-11uvm_scheduler() sounds important, but ``while(1) tsleep()'' is kinda lameBret Lambert
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@
2009-08-09add mpath(4), a driver that steals paths to scsi devices if itDavid Gwynne
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.
2009-07-09Remove the VREF() macro and replaces all instances with a call to verf(),Thordur I. Bjornsson
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.
2009-04-19Count number of cpus found (potentially not attached) and store thatTheo de Raadt
in sysctl hw.ncpufound; ok miod kettenis
2009-03-05Make ELF platforms generate ELF core dumps. Somewhat based on code fromMark Kettenis
NetBSD. ok kurt@, drahn@, miod@
2009-02-13use nitems(); dunnoseriously@gmailTheo de Raadt
2009-01-01copyright_year++;Miod Vallat
2008-12-03add vscsi(4), a virtual scsi controller that passes all scsi requests up toDavid Gwynne
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.
2008-10-15make random(9) return per-cpu values (by saving the seed in the cpuinfo),Theo de Raadt
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