panic.c revision 1.2.2.2 1 1.2.2.2 simonb /*
2 1.2.2.2 simonb * $NetBSD: panic.c,v 1.2.2.2 2006/04/22 11:37:38 simonb Exp $
3 1.2.2.2 simonb */
4 1.2.2.2 simonb /*-
5 1.2.2.2 simonb * Copyright (c) 1996
6 1.2.2.2 simonb * Matthias Drochner. All rights reserved.
7 1.2.2.2 simonb *
8 1.2.2.2 simonb * Redistribution and use in source and binary forms, with or without
9 1.2.2.2 simonb * modification, are permitted provided that the following conditions
10 1.2.2.2 simonb * are met:
11 1.2.2.2 simonb * 1. Redistributions of source code must retain the above copyright
12 1.2.2.2 simonb * notice, this list of conditions and the following disclaimer.
13 1.2.2.2 simonb * 2. Redistributions in binary form must reproduce the above copyright
14 1.2.2.2 simonb * notice, this list of conditions and the following disclaimer in the
15 1.2.2.2 simonb * documentation and/or other materials provided with the distribution.
16 1.2.2.2 simonb * 3. All advertising materials mentioning features or use of this software
17 1.2.2.2 simonb * must display the following acknowledgement:
18 1.2.2.2 simonb * This product includes software developed for the NetBSD Project
19 1.2.2.2 simonb * by Matthias Drochner.
20 1.2.2.2 simonb * 4. The name of the author may not be used to endorse or promote products
21 1.2.2.2 simonb * derived from this software without specific prior written permission.
22 1.2.2.2 simonb *
23 1.2.2.2 simonb * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
24 1.2.2.2 simonb * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
25 1.2.2.2 simonb * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
26 1.2.2.2 simonb * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
27 1.2.2.2 simonb * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
28 1.2.2.2 simonb * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
29 1.2.2.2 simonb * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
30 1.2.2.2 simonb * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
31 1.2.2.2 simonb * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
32 1.2.2.2 simonb * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 1.2.2.2 simonb *
34 1.2.2.2 simonb */
35 1.2.2.2 simonb
36 1.2.2.2 simonb #include <sys/cdefs.h>
37 1.2.2.2 simonb
38 1.2.2.2 simonb #include <lib/libsa/stand.h>
39 1.2.2.2 simonb #include <machine/stdarg.h>
40 1.2.2.2 simonb
41 1.2.2.2 simonb void
42 1.2.2.2 simonb panic(const char *fmt,...)
43 1.2.2.2 simonb {
44 1.2.2.2 simonb va_list ap;
45 1.2.2.2 simonb
46 1.2.2.2 simonb printf("panic: ");
47 1.2.2.2 simonb va_start(ap, fmt);
48 1.2.2.2 simonb vprintf(fmt, ap);
49 1.2.2.2 simonb va_end(ap);
50 1.2.2.2 simonb printf("\n");
51 1.2.2.2 simonb
52 1.2.2.2 simonb printf("--> Press a key on the console to reboot <--\n");
53 1.2.2.2 simonb getchar();
54 1.2.2.2 simonb printf("Rebooting...\n");
55 1.2.2.2 simonb exit(1);
56 1.2.2.2 simonb }
57