Deleted Added
full compact
kern_shutdown.c (49558) kern_shutdown.c (49627)
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
1/*-
2 * Copyright (c) 1986, 1988, 1991, 1993
3 * The Regents of the University of California. All rights reserved.
4 * (c) UNIX System Laboratories, Inc.
5 * All or some portions of this file are derived from material licensed
6 * to the University of California by American Telephone and Telegraph
7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
8 * the permission of UNIX System Laboratories, Inc.

--- 22 unchanged lines hidden (view full) ---

31 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * SUCH DAMAGE.
37 *
38 * @(#)kern_shutdown.c 8.3 (Berkeley) 1/21/94
39 * $Id: kern_shutdown.c,v 1.57 1999/07/20 21:29:13 green Exp $
39 * $Id: kern_shutdown.c,v 1.58 1999/08/09 10:34:57 phk Exp $
40 */
41
42#include "opt_ddb.h"
43#include "opt_hw_wdog.h"
44#include "opt_panic.h"
45#include "opt_show_busybufs.h"
46
47#include <sys/param.h>

--- 373 unchanged lines hidden (view full) ---

421/*
422 * Doadump comes here after turning off memory management and
423 * getting on the dump stack, either when called above, or by
424 * the auto-restart code.
425 */
426static void
427dumpsys(void)
428{
40 */
41
42#include "opt_ddb.h"
43#include "opt_hw_wdog.h"
44#include "opt_panic.h"
45#include "opt_show_busybufs.h"
46
47#include <sys/param.h>

--- 373 unchanged lines hidden (view full) ---

421/*
422 * Doadump comes here after turning off memory management and
423 * getting on the dump stack, either when called above, or by
424 * the auto-restart code.
425 */
426static void
427dumpsys(void)
428{
429 int error;
429
430 if (!dodump)
431 return;
432 if (dumpdev == NODEV)
433 return;
434 if (!(bdevsw(dumpdev)))
435 return;
436 if (!(bdevsw(dumpdev)->d_dump))
437 return;
438 dumpsize = Maxmem;
439 printf("\ndumping to dev (%d,%d), offset %ld\n",
440 major(dumpdev), minor(dumpdev), dumplo);
441 printf("dump ");
430
431 if (!dodump)
432 return;
433 if (dumpdev == NODEV)
434 return;
435 if (!(bdevsw(dumpdev)))
436 return;
437 if (!(bdevsw(dumpdev)->d_dump))
438 return;
439 dumpsize = Maxmem;
440 printf("\ndumping to dev (%d,%d), offset %ld\n",
441 major(dumpdev), minor(dumpdev), dumplo);
442 printf("dump ");
442 switch ((*bdevsw(dumpdev)->d_dump)(dumpdev)) {
443 error = (*bdevsw(dumpdev)->d_dump)(dumpdev);
444 if (error == 0) {
445 printf("succeeded\n");
446 return;
447 }
448 printf("failed, reason: ");
449 switch (error) {
450 case ENODEV:
451 printf("device doesn't support a dump routine\n");
452 break;
443
444 case ENXIO:
445 printf("device bad\n");
446 break;
447
448 case EFAULT:
449 printf("device not ready\n");
450 break;

--- 6 unchanged lines hidden (view full) ---

457 printf("i/o error\n");
458 break;
459
460 case EINTR:
461 printf("aborted from console\n");
462 break;
463
464 default:
453
454 case ENXIO:
455 printf("device bad\n");
456 break;
457
458 case EFAULT:
459 printf("device not ready\n");
460 break;

--- 6 unchanged lines hidden (view full) ---

467 printf("i/o error\n");
468 break;
469
470 case EINTR:
471 printf("aborted from console\n");
472 break;
473
474 default:
465 printf("succeeded\n");
475 printf("unknown, error = %d\n", error);
466 break;
467 }
468}
469
470/*
471 * Panic is called on unresolvable fatal errors. It prints "panic: mesg",
472 * and then reboots. If we are called twice, then we avoid trying to sync
473 * the disks as this often leads to recursive panics.

--- 141 unchanged lines hidden ---
476 break;
477 }
478}
479
480/*
481 * Panic is called on unresolvable fatal errors. It prints "panic: mesg",
482 * and then reboots. If we are called twice, then we avoid trying to sync
483 * the disks as this often leads to recursive panics.

--- 141 unchanged lines hidden ---