138465Smsmith/* 2119483Sobrien * $NetBSD: panic.c,v 1.2 1997/03/22 01:48:36 thorpej Exp $ 338465Smsmith */ 4119483Sobrien/*- 538465Smsmith * Copyright (c) 1996 638465Smsmith * Matthias Drochner. All rights reserved. 738465Smsmith * 838465Smsmith * Redistribution and use in source and binary forms, with or without 938465Smsmith * modification, are permitted provided that the following conditions 1038465Smsmith * are met: 1138465Smsmith * 1. Redistributions of source code must retain the above copyright 1238465Smsmith * notice, this list of conditions and the following disclaimer. 1338465Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1438465Smsmith * notice, this list of conditions and the following disclaimer in the 1538465Smsmith * documentation and/or other materials provided with the distribution. 1638465Smsmith * 3. All advertising materials mentioning features or use of this software 1738465Smsmith * must display the following acknowledgement: 1838465Smsmith * This product includes software developed for the NetBSD Project 1938465Smsmith * by Matthias Drochner. 2038465Smsmith * 4. The name of the author may not be used to endorse or promote products 2138465Smsmith * derived from this software without specific prior written permission. 2238465Smsmith * 2338465Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2438465Smsmith * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2538465Smsmith * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2638465Smsmith * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2738465Smsmith * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2838465Smsmith * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2938465Smsmith * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3038465Smsmith * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3138465Smsmith * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 3238465Smsmith * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3338465Smsmith * 3438465Smsmith */ 3538465Smsmith 36119483Sobrien#include <sys/cdefs.h> 37119483Sobrien__FBSDID("$FreeBSD$"); 3838465Smsmith 3938465Smsmith#include <stand.h> 4038465Smsmith#include <machine/stdarg.h> 4138465Smsmith 42162815Sruextern void exit(int) __dead2; 43162815Sru 4439441Smsmithvoid 4538465Smsmithpanic(const char *fmt,...) 4638465Smsmith{ 4738465Smsmith va_list ap; 4838465Smsmith 4938465Smsmith printf("panic: "); 5038465Smsmith va_start(ap, fmt); 5139660Smsmith vprintf(fmt, ap); 5239660Smsmith va_end(ap); 5338465Smsmith printf("\n"); 5438465Smsmith 5587058Sdcs printf("--> Press a key on the console to reboot <--\n"); 5687058Sdcs getchar(); 5787058Sdcs printf("Rebooting...\n"); 5838465Smsmith exit(1); 5938465Smsmith} 60