+void
+panic(const char *str, ...)
+{
+ va_list listp;
+ spl_t s;
+
+ /* panic_caller is initialized to 0. If set, don't change it */
+ if ( ! panic_caller )
+ panic_caller = (unsigned long)(char *)__builtin_return_address(0);
+
+ s = panic_prologue(str);
+ kdb_printf("panic(cpu %d caller 0x%lx): ", (unsigned) paniccpu, panic_caller);
+ if (str) {
+ va_start(listp, str);
+ _doprnt(str, &listp, consdebug_putc, 0);
+ va_end(listp);
+ }
+ kdb_printf("\n");
+
+ /*
+ * Release panicwait indicator so that other cpus may call Debugger().
+ */
+ panicwait = 0;
+ Debugger("panic");
+ panic_epilogue(s);
+}
+
+void
+panic_context(unsigned int reason, void *ctx, const char *str, ...)
+{
+ va_list listp;
+ spl_t s;
+
+ /* panic_caller is initialized to 0. If set, don't change it */
+ if ( ! panic_caller )
+ panic_caller = (unsigned long)(char *)__builtin_return_address(0);
+
+ s = panic_prologue(str);
+ kdb_printf("panic(cpu %d caller 0x%lx): ", (unsigned) paniccpu, panic_caller);
+ if (str) {
+ va_start(listp, str);
+ _doprnt(str, &listp, consdebug_putc, 0);
+ va_end(listp);
+ }
+ kdb_printf("\n");
+
+ /*
+ * Release panicwait indicator so that other cpus may call Debugger().
+ */
+ panicwait = 0;
+ DebuggerWithContext(reason, ctx, "panic");
+ panic_epilogue(s);
+}
+