+/*
+ * panic_with_options: wraps the panic call in a way that allows us to pass
+ * a bitmask of specific debugger options.
+ */
+#if !DEVELOPMENT && !DEBUG && !defined(__i386__) && !defined(__x86_64__)
+__attribute__((noreturn))
+#endif
+void
+panic_with_options(unsigned int reason, void *ctx, uint64_t debugger_options_mask, 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", debugger_options_mask);
+ panic_epilogue(s);
+}
+
+#if !DEVELOPMENT && !DEBUG && !defined(__i386__) && !defined(__x86_64__)
+__attribute__((noreturn))
+#endif