summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
Commit message (Collapse)AuthorAgeFilesLines
* Lock initproc when we send SIGINT to init during shutdown.jhb2001-03-071-0/+2
|
* RIP <machine/lock.h>.markm2001-02-111-1/+0
| | | | | | | Some things needed bits of <i386/include/lock.h> - cy.c now has its own (only) copy of the COM_(UN)LOCK() macros, and IMASK_(UN)LOCK() has been moved to <i386/include/apic.h> (AKA <machine/apic.h>). Reviewed by: jhb
* Change and clean the mutex lock interface.bmilekic2001-02-091-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mtx_enter(lock, type) becomes: mtx_lock(lock) for sleep locks (MTX_DEF-initialized locks) mtx_lock_spin(lock) for spin locks (MTX_SPIN-initialized) similarily, for releasing a lock, we now have: mtx_unlock(lock) for MTX_DEF and mtx_unlock_spin(lock) for MTX_SPIN. We change the caller interface for the two different types of locks because the semantics are entirely different for each case, and this makes it explicitly clear and, at the same time, it rids us of the extra `type' argument. The enter->lock and exit->unlock change has been made with the idea that we're "locking data" and not "entering locked code" in mind. Further, remove all additional "flags" previously passed to the lock acquire/release routines with the exception of two: MTX_QUIET and MTX_NOSWITCH The functionality of these flags is preserved and they can be passed to the lock/unlock routines by calling the corresponding wrappers: mtx_{lock, unlock}_flags(lock, flag(s)) and mtx_{lock, unlock}_spin_flags(lock, flag(s)) for MTX_DEF and MTX_SPIN locks, respectively. Re-inline some lock acq/rel code; in the sleep lock case, we only inline the _obtain_lock()s in order to ensure that the inlined code fits into a cache line. In the spin lock case, we inline recursion and actually only perform a function call if we need to spin. This change has been made with the idea that we generally tend to avoid spin locks and that also the spin locks that we do have and are heavily used (i.e. sched_lock) do recurse, and therefore in an effort to reduce function call overhead for some architectures (such as alpha), we inline recursion for this case. Create a new malloc type for the witness code and retire from using the M_DEV type. The new type is called M_WITNESS and is only declared if WITNESS is enabled. Begin cleaning up some machdep/mutex.h code - specifically updated the "optimized" inlined code in alpha/mutex.h and wrote MTX_LOCK_SPIN and MTX_UNLOCK_SPIN asm macros for the i386/mutex.h as we presently need those. Finally, caught up to the interface changes in all sys code. Contributors: jake, jhb, jasone (in no particular order)
* Fix typo: seperate -> separate.asmodai2001-02-061-1/+1
| | | | Seperate does not exist in the english language.
* Convert all simplelocks to mutexes and remove the simplelock implementations.jasone2001-01-241-1/+1
|
* Use PCPU_GET, PCPU_PTR and PCPU_SET to access all per-cpu variablesjake2001-01-101-2/+2
| | | | other then curproc.
* Stick the kthread API in a kthread_* namespace, and the specialized kprocjhb2000-12-151-2/+2
| | | | | | functions in a kproc_* namespace. Reviewed by: -arch
* Only print out APIC info on an SMP system during a panic if APIC_IO isjhb2000-11-291-0/+2
| | | | defined.
* Don't release and acquire Giant in mi_switch(). Instead, release andjhb2000-11-161-0/+2
| | | | | | | | acquire Giant as needed in functions that call mi_switch(). The releases need to be done outside of the sched_lock to avoid potential deadlocks from trying to acquire Giant while interrupts are disabled. Submitted by: witness
* Catch up to moving headers:jhb2000-10-201-1/+1
| | | | | - machine/ipl.h -> sys/ipl.h - machine/mutex.h -> sys/mutex.h
* Remove unneeded #include <machine/clock.h>phk2000-10-151-1/+0
|
* savectx() is now used exclusively by the crash dump system. Move thepeter2000-10-131-3/+0
| | | | | i386 specific gunk (copy %cr3 to the pcb) from the MI dumpsys() to the MD savectx().
* Do not allocate a callout for all crashdumps, not just when you panic.ps2000-10-131-1/+2
|
* Added used include of <sys/mutex.h> (don't depend on pollution inbde2000-09-171-0/+1
| | | | <sys/signalvar.h>).
* Fix some printf format string warnings due to sizeof(int) != sizeof(long) onjhb2000-09-111-4/+4
| | | | the alpha.
* Allow interrupt threads to run during shutdown. This should fix thejasone2000-09-101-2/+15
| | | | | | "dirty buffers during shutdown" problem introduced by the SMPng commit. Submitted by: tegge, cg
* Major update to the way synchronization is done in the kernel. Highlightsjasone2000-09-071-2/+7
| | | | | | | | | | | | | | | include: * Mutual exclusion is used instead of spl*(). See mutex(9). (Note: The alpha port is still in transition and currently uses both.) * Per-CPU idle processes. * Interrupts are run in their own separate kernel threads and can be preempted (i386 only). Partially contributed by: BSDi (BSD/OS) Submissions by (at least): cp, dfr, dillon, grog, jake, jhb, sheldonh
* kern_shutdown.c was more ANSI-C than K&R - remove the remnants of K&Rpeter2000-09-031-21/+12
| | | | support with extreme prejudice.
* gcc knows that savectx() is potentially a setjmp style dual-returnpeter2000-09-031-6/+5
| | | | | | | function which may lead to stack lossage and clobbered variables. This isn't the case here, but there is no way to tell gcc that. Work around this in a kinda bizzare way, but it shuts gcc up.
* Make it possible to pass boot()'s flags to shutdown_nice() so that themsmith2000-08-311-1/+8
| | | | | | kernel can instigate an orderly shutdown but still determine the form of that shutdown. Make it possible eg. to cleanly shutdown and power off the system under ACPI when the power button is pressed.
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.phk2000-07-041-1/+1
| | | | Pointed out by: bde
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:phk2000-07-031-1/+1
| | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS)
* Separate the struct bio related stuff out of <sys/buf.h> intophk2000-05-051-0/+1
| | | | | | | | | | | | | | | <sys/bio.h>. <sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes. Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data. Still a few bogus uses of struct buf to track down. Repocopy by: peter
* The SMP cleanup commit broke UP compiles. Make UP compiles work again.dillon2000-03-281-2/+0
|
* Seconds to ticks conversion was done at the wrong place.luoqi2000-01-121-2/+2
|
* Introduce a mechanism to suspend/resume system processes. Suspend syncerluoqi2000-01-071-0/+32
| | | | and bufdaemon prior to disk sync during system shutdown.
* Change the default poweroff delay from 0 to 5 seconds. This seems to bemsmith1999-12-071-1/+5
| | | | | | | | | adequate for the IDE disks that I have available for testing. Most seem to wait between 1 and 3 seconds before flushing their caches. Add the ability to override the delay at compile time via the undocumented option POWEROFF_DELAY. The delay can still be set via sysctl as it was originally implemented.
* I always forget to check before I reboot a system, and while itphk1999-12-061-0/+30
| | | | | | | | boots I try in vain to remember which month or even year this system was last booted in. Print out the uptime before rebooting, and give people like me less (or more as it may be) to think about while the systems boots.
* Convert dumpon to work on character devices instead of block devices.phk1999-11-281-2/+2
| | | | NB: You may need to change your /etc/rc.conf!
* struct mountlist and struct mount.mnt_list have no business beingphk1999-11-201-1/+1
| | | | | | | | | | a CIRCLEQ. Change them to TAILQ_HEAD and TAILQ_ENTRY respectively. This removes ugly mp != (void*)&mountlist comparisons. Requested by: phk Submitted by: Jake Burkholder jake@checker.org PR: 14967
* A little bit of nitpicking in the 'syncing disks...' end of a shutdown.phk1999-11-081-20/+13
|
* Trim unused options (or #ifdef for undoc options).peter1999-10-111-1/+0
| | | | Submitted by: phk
* Remove unneeded "maj" variable.phk1999-08-291-6/+8
| | | | | | Give up if we have already started dumping once before. Print name of dumpdev.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Use devtoname() to print dev_t's instead of casting them to long or u_longbde1999-08-231-3/+3
| | | | for misprinting in %lx format.
* Implement a new generic mechanism for attaching handler functions tomsmith1999-08-211-134/+55
| | | | | | | | | | | | | events, in order to pave the way for removing a number of the ad-hoc implementations currently in use. Retire the at_shutdown family of functions and replace them with new event handler lists. Rework kern_shutdown.c to take greater advantage of the use of event handlers. Reviewed by: green
* The bdevsw() and cdevsw() are now identical, so kill the former.phk1999-08-131-7/+7
|
* When doing a dump, if ENODEV is returned explain what happened to the user,alfred1999-08-111-3/+13
| | | | | | | | | "the device doesn't support a dump routine" Only print "dump succeeded" when 0 is returned, instead of when an unexpected error number is returned, print that error number. Reviewed by: Eivind
* Merge the cons.c and cons.h to the best of my ability. alpha may orphk1999-08-091-2/+2
| | | | may not compile, I can't test it.
* Make a dev2budev() function, and use it. This refixes pstat (working, broken,green1999-07-201-5/+2
| | | | | | | working, broken, working) and savecore (working, working, broken, working, working). Sorta Reviewed by: phk
* dev2udev() returns a CDEV udev_t, but we use block io in savecore. Savecoregreen1999-07-201-2/+5
| | | | | | | also gets the device by st_rdev, which is alright except for the fact that the sysctl kern.dumpdev passed out a char device. This is a workaround. Sorry for not committing the fix earlier, before people started having problems.
* Centralize dumpdev handling.phk1999-07-171-4/+57
|
* Fix a warning - the code is correct but gcc can't tell.peter1999-07-011-1/+2
|
* Convert buffer locking from using the B_BUSY and B_WANTED flags to usingmckusick1999-06-261-9/+10
| | | | | | | lockmgr locks. This commit should be functionally equivalent to the old semantics. That is, all buffer locking is done with LK_EXCLUSIVE requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will be done in future commits.
* Try an fix a couple of dev_t/major/minor etc nits.peter1999-05-121-2/+3
|
* I got tired of seeing all the cdevsw[major(foo)] all over the place.phk1999-05-081-4/+4
| | | | | | | | Made a new (inline) function devsw(dev_t dev) and substituted it. Changed to the BDEV variant to this format as well: bdevsw(dev_t dev) DEVFS will eventually benefit from this change too.
* Continue where Julian left off in July 1998:phk1999-05-071-4/+4
| | | | | | | | | | | | | | Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline) function. Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention to the order of the cmaj/bmaj arguments!) Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE (ditto!) (Next step will be to convert all bdev dev_t's to cdev dev_t's before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
* Add sufficient braces to keep egcs happy about potentially ambiguouspeter1999-05-061-3/+4
| | | | if/else nesting.
* Add sysctl descriptions to many SYSCTL_XXXsbillf1999-05-031-3/+4
| | | | | | | PR: kern/11197 Submitted by: Adrian Chadd <adrian@FreeBSD.org> Reviewed by: billf(spelling/style/minor nits) Looked at by: bde(style)
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
OpenPOWER on IntegriCloud