changeset 13559:8413443ef603

1922 t_pcb of panic thread should be preserved on a panic Reviewed by: Gordon Ross <gordon.w.ross@gmail.com> Reviewed by: Richard Lowe <richlowe@richlowe.net> Approved by: Richard Lowe <richlowe@richlowe.net>
author Bryan Cantrill <bryan@joyent.com>
date Tue, 10 Jan 2012 20:32:59 -0500
parents 4fab5e00a936
children 61e2c882ccf8
files usr/src/uts/common/os/panic.c
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/uts/common/os/panic.c	Tue Jan 10 20:32:56 2012 -0500
+++ b/usr/src/uts/common/os/panic.c	Tue Jan 10 20:32:59 2012 -0500
@@ -23,6 +23,10 @@
  */
 
 /*
+ * Copyright (c) 2011, Joyent, Inc. All rights reserved.
+ */
+
+/*
  * When the operating system detects that it is in an invalid state, a panic
  * is initiated in order to minimize potential damage to user data and to
  * facilitate debugging.  There are three major tasks to be performed in
@@ -154,6 +158,7 @@
 kthread_t *panic_thread;		/* first thread to call panicsys() */
 cpu_t panic_cpu;			/* cpu from first call to panicsys() */
 label_t panic_regs;			/* setjmp label from panic_thread */
+label_t panic_pcb;			/* t_pcb at time of panic */
 struct regs *panic_reg;			/* regs struct from first panicsys() */
 char *volatile panicstr;		/* format string to first panicsys() */
 va_list panicargs;			/* arguments to first panicsys() */
@@ -213,6 +218,7 @@
 	ushort_t schedflag = t->t_schedflag;
 	cpu_t *bound_cpu = t->t_bound_cpu;
 	char preempt = t->t_preempt;
+	label_t pcb = t->t_pcb;
 
 	(void) setjmp(&t->t_pcb);
 	t->t_flag |= T_PANIC;
@@ -290,6 +296,7 @@
 		panic_schedflag = schedflag;
 		panic_bound_cpu = bound_cpu;
 		panic_preempt = preempt;
+		panic_pcb = pcb;
 
 		if (intr_stack != NULL) {
 			panic_cpu.cpu_intr_stack = intr_stack;