summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_shutdown.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* Removed unused #includes.bde1997-09-021-6/+1
|
* Fixed options SHOW_BUSYBUFS and PANIC_REBOOT_WAIT_TIME which were brokenbde1997-08-311-1/+3
| | | | | | by incomplete cutting and pasting from machdep.c to kern_shutdown.c. PR: 3953
* Correct some things I forgot about until it was too late with smp_active.peter1997-08-261-5/+4
| | | | | | | smp_active = 1 used to indicate that the system had frozen previously started AP's, while smp_active = 0 was "AP's not yet started". I have split this into smp_started (which is set when the AP's come online), and smp_active is left for turning on/off AP scheduling.
* Fixed some formatting and style bugs.bde1997-08-261-7/+5
| | | | Fixed a gratuitous ANSIism.
* Teach both disk drivers how to cope with a hardware watchdogjulian1997-08-091-1/+3
| | | | | | | while dumping core.. I'm tired of getting 1/2 of a core-dump conditional on -DHW_WDOG for now this will migrate to 2.2 as that's where I need it.
* Use up 4 precious bytes to give the kernel a hook tojulian1997-08-091-1/+22
| | | | | support hardware watchdogs. The actual functions would be supplied in an LKM or a linked file, but they need to hang off something.
* Preliminary support for per-cpu data pages.peter1997-06-221-4/+7
| | | | | | | | | | | | | | | | This eliminates a lot of #ifdef SMP type code. Things like _curproc reside in a data page that is unique on each cpu, eliminating the expensive macros like: #define curproc (SMPcurproc[cpunumber()]) There are some unresolved bootstrap and address space sharing issues at present, but Steve is waiting on this for other work. There is still some strictly temporary code present that isn't exactly pretty. This is part of a larger change that has run into some bumps, this part is standalone so it should be safe. The temporary code goes away when the full idle cpu support is finished. Reviewed by: fsmp, dyson
* When APM is configured, turn off the power when halting for good.wollman1997-06-151-1/+2
|
* Move the printing of "cpu#%d" to AFTER the general panic argument string.fsmp1997-05-241-5/+4
| | | | | | | When a panic occurs early in the SMP boot process 'cpunumber()' hangs, causing the panic string to be lost. Now the system appears to hang in 'breakpoint()', but at least the user sees the panic string before the hang.
* Man the liferafts! Here comes the long awaited SMP -> -current merge!peter1997-04-261-1/+26
| | | | | | | | | | | | | | | | There are various options documented in i386/conf/LINT, there is more to come over the next few days. The kernel should run pretty much "as before" without the options to activate SMP mode. There are a handful of known "loose ends" that need to be fixed, but have been put off since the SMP kernel is in a moderately good condition at the moment. This commit is the result of the tinkering and testing over the last 14 months by many people. A special thanks to Steve Passe for implementing the APIC code!
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Reduced #include spam in <sys/sysproto.h> and fixed things that dependedbde1997-01-161-0/+1
| | | | | | | | | | | | | | on it. makesyscalls.sh: This parsed $Id$. Fixed(?) to parse $FreeBSD$. The output is wrong when the id is not expanded in the source file. syscalls.master: Fixed declaration of sigsuspend(). There are still some bogons and spam involving sigset_t. Use `struct foo *' instead of the equivalent `foo_t *' for some nfs and lfs syscalls so that <sys/sysproto.h> doesn't depend on <sys/mount.h>.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Further improved version of hadling a HALT when there is no console.julian1996-10-311-2/+8
|
* if there is no console, cngetc should act like getc and return -1julian1996-10-301-2/+2
| | | | make callers aware of this in those cases where it can occur.
* Changed cncheckc() interface so that it is 8-bit clean - return -1bde1996-09-141-2/+3
| | | | instead of 0 if there is no input.
* Don't use __dead in the kernel. It was an obfuscation for gcc >= 2.5bde1996-09-131-5/+2
| | | | and a no-op for gcc >= 2.6.
* Fixed two small leftovers form PHK's mega devconf removal commit..sos1996-09-071-2/+1
|
* Remove devconf, it never grew up to be of any use.phk1996-09-061-2/+1
|
OpenPOWER on IntegriCloud