summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* An error in the last commit; the changes were submitted by, not reviewed by,msmith1999-01-301-1/+1
| | | | "D. Rock" <rock@cs.uni-sb.de>
* Add a new sysctl node kern.shutdown, off which shutdown-related thingsmsmith1999-01-301-4/+30
| | | | | | | | | | | | | can be hung. Add a tunable delay at the beginning of the SHUTDOWN_FINAL at_shutdown queue, allowing time to settle before we launch into the list of things that are expected to turn the system off. Fix a bug in at_shutdown_pri() where the second insertion always put the item in second position in the queue. Reviewed by: "D. Rock" <rock@cs.uni-sb.de>
* Improved DDB_UNATTENDED behaviour. From the submitter:msmith1998-12-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | There's something that's been bugging me for a while, so I decided to fix it. FreeBSD now will DTRT WRT DDB and DDB_UNATTENDED (!debugger_on_panic), at least in my opinion. The behavior change is such that: 1. Nothing changes when debugger_on_panic != 0. 2. When DDB_UNATTENDED (!debugger_on_panic), if a panic occurs, the machine will reboot. Also, if a trap occurs, the machine will panic and reboot, unlike how it broke to DDB before. HOWEVER, a trap inside DDB will not cause a panic, allowing full use of DDB without having to worry about the machine being stuck at a DDB prompt if something goes wrong during the day. Patches for this behavior follow my signature, and it would be a boon to anyone (like me) who uses DDB_UNATTENDED, but actually wants the machine to panic on a trap (otherwise, what's the use, if the machine causes a fatal trap rather than a true panic, of debugger_on_panic?). The changes cause no adverse behavior, but do involve two symbols becoming global Submitted by: Brian Feldman <green@unixhelp.org>
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-2/+2
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* Don't count non-local dirty buffers as outstanding when shutting down.msmith1998-11-131-1/+17
| | | | | | | | | | | | | | | This avoids the fsck-on-reboot symptoms if you're shutting down with a hung or unreachable NFS server mounted. Also remove non-local filesystems from the mount list to prevent the system hanging when it tries to unmount them (for the same reason). Drew points out that there's a good argument for forcibly removing all "non syncable" filesystems from the mount list (eg. NFS mounts, disks that aren't responding, etc.) as this then allows you to sync and cleanly unmount their parents. No such change is included in this patch. Submitted by: Andrew Gallatin <gallatin@cs.duke.edu>
* Add the ability to specify where on the at_shutdown queue a handler ismsmith1998-10-301-5/+33
| | | | | | | | | installed. Remove cpu_power_down, and replace it with an entry at the end of the SHUTDOWN_FINAL queue in the only place it's used (APM). Submitted by: Some ideas from Bruce Walter <walter@fortean.com>
* Fix precedence bug, so that kernel dump works.dt1998-09-201-2/+2
|
* Add a new at_shutdown queue, SHUTDOWN_FINAL. This queue is run atgibbs1998-09-151-84/+67
| | | | | | | splhigh() after any system dumps have completed. SHUTDOWN_POST_SYNC isn't quite late enough for disk controllers. Converted at_shutdown queues to use the queue(3) macros.
* Store formatted panic string in static buffer to make it available laterache1998-09-061-5/+6
| | | | | for savecore. Previous code give only panic format to savecore
* Don't check minor number of dump device at all.des1998-08-231-6/+1
| | | | Discussed-with: Jörg Wunsch
* Include opt_devfs.h which defines SLICE, to make previous commitdes1998-08-191-1/+2
| | | | | | meaningful. Pointed out by: Luoqi Chen
* Enable kernel dumps on SLICE systems.des1998-08-161-1/+3
|
* Fixed printf format errors.bde1998-07-111-3/+7
|
* This commit fixes various 64bit portability problems required fordfr1998-06-071-1/+3
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Add forwarding of roundrobin to other cpus. This gives a more regulartegge1998-05-171-16/+1
| | | | | | | | | | | update of cpu usage as shown by top when one process is cpu bound (no system calls) while the system is otherwise idle (except for top). Don't attempt to switch to the BSP in boot(). If the system was idle when an interrupt caused a panic, this won't work. Instead, switch to the BSP in cpu_reset. Remove some spurious forward_statclock/forward_hardclock warnings.
* Backed out previous commit. It is invalid to call d_ioctl() onbde1998-05-121-8/+3
| | | | | | | | | | | | possibly non-open devices, and we don't want to restrict dumping to swap devices anwyay. It is especially invalid to call d_ioctl() in non-process context for panics. d_psize() can be called on non-open devices, at least on non-SLICED ones that support d_dump(), and setdumpdev() has depended on this for a long time although it is probably wrong, but even d_psize() can't be called in non-process context - that's why dumpsys() depends on previously computed values although these values may be stale. The historical restriction to devices with dkpart(dev) == SWAP_PART should go away.
* Add dump support to the DEVFS/slice code.julian1998-05-061-3/+8
| | | | | | now we can actually catch our crashes :-) Submitted by: Luoqi Chen <luoqi@chen.ml.org> (the man who's everywhere)
* Reviewed by: dyson@freebsd.org (john Dyson), dg@root.com (david greenman)julian1998-03-081-2/+12
| | | | | Submitted by: Kirk McKusick (mcKusick@mckusick.com) Obtained from: WHistle development tree
* Add HW_WDOG to LINT, and turn it into a new-style option.eivind1998-02-161-1/+2
|
* Shift a few SYSINT() calls around.julian1997-11-251-1/+11
| | | | | | | | | | this results in a few functions becoming static, and the SYSINITs being close to the code they are related to. setting up the dump device is with dumpsys() and kicking off the scheduler is with the scheduler. Mounting root is with the code that does it. Reviewed by: phk
* Get buffer stuff by #including <sys/buf.h> instead of <sys/vnode.h>.bde1997-11-181-5/+5
| | | | | | Staticized boot(). Fixed a gratuitous ANSIism.
* Move the "retval" (3rd) parameter from all syscall functions and putphk1997-11-061-4/+3
| | | | | | | | | | | | it in struct proc instead. This fixes a boatload of compiler warning, and removes a lot of cruft from the sources. I have not removed the /*ARGSUSED*/, they will require some looking at. libkvm, ps and other userland struct proc frobbing programs will need recompiled.
* Cosmetic adjustment for the trap/double fault/panic cpu id listing.peter1997-09-051-2/+5
| | | | It now prints the apic id in hex rather than decimal.
OpenPOWER on IntegriCloud