Deleted Added
full compact
subr_trap.c (2660) subr_trap.c (3258)
1/*-
2 * Copyright (C) 1994, David Greenman
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the University of Utah, and William Jolitz.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
1/*-
2 * Copyright (C) 1994, David Greenman
3 * Copyright (c) 1990, 1993
4 * The Regents of the University of California. All rights reserved.
5 *
6 * This code is derived from software contributed to Berkeley by
7 * the University of Utah, and William Jolitz.
8 *

--- 21 unchanged lines hidden (view full) ---

30 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
31 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
32 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
33 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
34 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 * SUCH DAMAGE.
36 *
37 * from: @(#)trap.c 7.4 (Berkeley) 5/13/91
38 * $Id: trap.c,v 1.33 1994/09/08 11:48:52 bde Exp $
38 * $Id: trap.c,v 1.34 1994/09/11 11:26:18 davidg Exp $
39 */
40
41/*
42 * 386 Trap and System call handling
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

--- 407 unchanged lines hidden (view full) ---

454 return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
455}
456
457void
458trap_fatal(frame)
459 struct trapframe *frame;
460{
461 int code, type, eva;
39 */
40
41/*
42 * 386 Trap and System call handling
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

--- 407 unchanged lines hidden (view full) ---

454 return((rv == KERN_PROTECTION_FAILURE) ? SIGBUS : SIGSEGV);
455}
456
457void
458trap_fatal(frame)
459 struct trapframe *frame;
460{
461 int code, type, eva;
462 struct soft_segment_descriptor softseg;
462
463 code = frame->tf_err;
464 type = frame->tf_trapno;
465 eva = rcr2();
463
464 code = frame->tf_err;
465 type = frame->tf_trapno;
466 eva = rcr2();
467 sdtossd(gdt + IDXSEL(frame->tf_cs & 0xffff), &softseg);
466
467 if (type <= MAX_TRAP_MSG)
468 printf("\n\nFatal trap %d: %s while in %s mode\n",
469 type, trap_msg[type],
470 ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
471 if (type == T_PAGEFLT) {
472 printf("fault virtual address = 0x%x\n", eva);
473 printf("fault code = %s %s, %s\n",
474 code & PGEX_U ? "user" : "supervisor",
475 code & PGEX_W ? "write" : "read",
476 code & PGEX_P ? "protection violation" : "page not present");
477 }
468
469 if (type <= MAX_TRAP_MSG)
470 printf("\n\nFatal trap %d: %s while in %s mode\n",
471 type, trap_msg[type],
472 ISPL(frame->tf_cs) == SEL_UPL ? "user" : "kernel");
473 if (type == T_PAGEFLT) {
474 printf("fault virtual address = 0x%x\n", eva);
475 printf("fault code = %s %s, %s\n",
476 code & PGEX_U ? "user" : "supervisor",
477 code & PGEX_W ? "write" : "read",
478 code & PGEX_P ? "protection violation" : "page not present");
479 }
478 printf("instruction pointer = 0x%x\n", frame->tf_eip);
480 printf("instruction pointer = 0x%x:0x%x\n", frame->tf_cs & 0xffff, frame->tf_eip);
481 printf("code segment = base 0x%x, limit 0x%x, type 0x%x\n",
482 softseg.ssd_base, softseg.ssd_limit, softseg.ssd_type);
483 printf(" = DPL %d, pres %d, def32 %d, gran %d\n",
484 softseg.ssd_dpl, softseg.ssd_p, softseg.ssd_def32, softseg.ssd_gran);
479 printf("processor eflags = ");
480 if (frame->tf_eflags & PSL_T)
481 printf("trace/trap, ");
482 if (frame->tf_eflags & PSL_I)
483 printf("interrupt enabled, ");
484 if (frame->tf_eflags & PSL_NT)
485 printf("nested task, ");
486 if (frame->tf_eflags & PSL_RF)

--- 209 unchanged lines hidden ---
485 printf("processor eflags = ");
486 if (frame->tf_eflags & PSL_T)
487 printf("trace/trap, ");
488 if (frame->tf_eflags & PSL_I)
489 printf("interrupt enabled, ");
490 if (frame->tf_eflags & PSL_NT)
491 printf("nested task, ");
492 if (frame->tf_eflags & PSL_RF)

--- 209 unchanged lines hidden ---