subr_trap.c (28df158b49a85dec14d5799b7c24e9ba5f810187) | subr_trap.c (03927d3c33689431ba2d9f74c15aa851d85bcb76) |
---|---|
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 * --- 31 unchanged lines hidden (view full) --- 40 41/* 42 * 386 Trap and System call handling 43 */ 44 45#include "opt_clock.h" 46#include "opt_cpu.h" 47#include "opt_ddb.h" | 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 * --- 31 unchanged lines hidden (view full) --- 40 41/* 42 * 386 Trap and System call handling 43 */ 44 45#include "opt_clock.h" 46#include "opt_cpu.h" 47#include "opt_ddb.h" |
48#include "opt_isa.h" |
|
48#include "opt_ktrace.h" 49#include "opt_npx.h" 50#include "opt_trap.h" 51 52#include <sys/param.h> 53#include <sys/bus.h> 54#include <sys/systm.h> 55#include <sys/proc.h> --- 37 unchanged lines hidden (view full) --- 93#include <sys/syslog.h> 94#include <machine/clock.h> 95#endif 96 97#include <machine/vm86.h> 98 99#include <ddb/ddb.h> 100 | 49#include "opt_ktrace.h" 50#include "opt_npx.h" 51#include "opt_trap.h" 52 53#include <sys/param.h> 54#include <sys/bus.h> 55#include <sys/systm.h> 56#include <sys/proc.h> --- 37 unchanged lines hidden (view full) --- 94#include <sys/syslog.h> 95#include <machine/clock.h> 96#endif 97 98#include <machine/vm86.h> 99 100#include <ddb/ddb.h> 101 |
101#include "isa.h" 102 | |
103#include <sys/sysctl.h> 104 105int (*pmath_emulate) __P((struct trapframe *)); 106 107extern void trap __P((struct trapframe frame)); 108extern int trapwrite __P((unsigned addr)); 109extern void syscall2 __P((struct trapframe frame)); 110extern void ast __P((struct trapframe frame)); --- 249 unchanged lines hidden (view full) --- 360 ucode = T_PAGEFLT; 361 break; 362 363 case T_DIVIDE: /* integer divide fault */ 364 ucode = FPE_INTDIV; 365 i = SIGFPE; 366 break; 367 | 102#include <sys/sysctl.h> 103 104int (*pmath_emulate) __P((struct trapframe *)); 105 106extern void trap __P((struct trapframe frame)); 107extern int trapwrite __P((unsigned addr)); 108extern void syscall2 __P((struct trapframe frame)); 109extern void ast __P((struct trapframe frame)); --- 249 unchanged lines hidden (view full) --- 359 ucode = T_PAGEFLT; 360 break; 361 362 case T_DIVIDE: /* integer divide fault */ 363 ucode = FPE_INTDIV; 364 i = SIGFPE; 365 break; 366 |
368#if NISA > 0 | 367#ifdef DEV_ISA |
369 case T_NMI: 370#ifdef POWERFAIL_NMI 371#ifndef TIMER_FREQ 372# define TIMER_FREQ 1193182 373#endif 374 mtx_enter(&Giant, MTX_DEF); 375 if (time_second - lastalert > 10) { 376 log(LOG_WARNING, "NMI: power fail\n"); --- 16 unchanged lines hidden (view full) --- 393 kdb_trap (type, 0, &frame); 394 } 395#endif /* DDB */ 396 goto out; 397 } else if (panic_on_nmi) 398 panic("NMI indicates hardware failure"); 399 break; 400#endif /* POWERFAIL_NMI */ | 368 case T_NMI: 369#ifdef POWERFAIL_NMI 370#ifndef TIMER_FREQ 371# define TIMER_FREQ 1193182 372#endif 373 mtx_enter(&Giant, MTX_DEF); 374 if (time_second - lastalert > 10) { 375 log(LOG_WARNING, "NMI: power fail\n"); --- 16 unchanged lines hidden (view full) --- 392 kdb_trap (type, 0, &frame); 393 } 394#endif /* DDB */ 395 goto out; 396 } else if (panic_on_nmi) 397 panic("NMI indicates hardware failure"); 398 break; 399#endif /* POWERFAIL_NMI */ |
401#endif /* NISA > 0 */ | 400#endif /* DEV_ISA */ |
402 403 case T_OFLOW: /* integer overflow fault */ 404 ucode = FPE_INTOVF; 405 i = SIGFPE; 406 break; 407 408 case T_BOUND: /* bounds check fault */ 409 ucode = FPE_FLTSUB; --- 203 unchanged lines hidden (view full) --- 613 */ 614#ifdef DDB 615 /* XXX Giant */ 616 if (kdb_trap (type, 0, &frame)) 617 goto out; 618#endif 619 break; 620 | 401 402 case T_OFLOW: /* integer overflow fault */ 403 ucode = FPE_INTOVF; 404 i = SIGFPE; 405 break; 406 407 case T_BOUND: /* bounds check fault */ 408 ucode = FPE_FLTSUB; --- 203 unchanged lines hidden (view full) --- 612 */ 613#ifdef DDB 614 /* XXX Giant */ 615 if (kdb_trap (type, 0, &frame)) 616 goto out; 617#endif 618 break; 619 |
621#if NISA > 0 | 620#ifdef DEV_ISA |
622 case T_NMI: 623#ifdef POWERFAIL_NMI 624 mtx_enter(&Giant, MTX_DEF); 625 if (time_second - lastalert > 10) { 626 log(LOG_WARNING, "NMI: power fail\n"); 627 sysbeep(TIMER_FREQ/880, hz); 628 lastalert = time_second; 629 } --- 13 unchanged lines hidden (view full) --- 643 kdb_trap (type, 0, &frame); 644 } 645#endif /* DDB */ 646 goto out; 647 } else if (panic_on_nmi == 0) 648 goto out; 649 /* FALL THROUGH */ 650#endif /* POWERFAIL_NMI */ | 621 case T_NMI: 622#ifdef POWERFAIL_NMI 623 mtx_enter(&Giant, MTX_DEF); 624 if (time_second - lastalert > 10) { 625 log(LOG_WARNING, "NMI: power fail\n"); 626 sysbeep(TIMER_FREQ/880, hz); 627 lastalert = time_second; 628 } --- 13 unchanged lines hidden (view full) --- 642 kdb_trap (type, 0, &frame); 643 } 644#endif /* DDB */ 645 goto out; 646 } else if (panic_on_nmi == 0) 647 goto out; 648 /* FALL THROUGH */ 649#endif /* POWERFAIL_NMI */ |
651#endif /* NISA > 0 */ | 650#endif /* DEV_ISA */ |
652 } 653 654 mtx_enter(&Giant, MTX_DEF); 655 trap_fatal(&frame, eva); 656 mtx_exit(&Giant, MTX_DEF); 657 goto out; 658 } 659 --- 656 unchanged lines hidden --- | 651 } 652 653 mtx_enter(&Giant, MTX_DEF); 654 trap_fatal(&frame, eva); 655 mtx_exit(&Giant, MTX_DEF); 656 goto out; 657 } 658 --- 656 unchanged lines hidden --- |