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