subr_trap.c (f3f0ca6051bef86fa8962f675d6eea17a29c2940) subr_trap.c (8a129caed5f1b834a2d3f825478f5f0273f9cb9d)
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.29 1994/08/18 22:34:43 wollman Exp $
38 * $Id: trap.c,v 1.30 1994/08/24 11:52:21 sos Exp $
39 */
40
41/*
42 * 386 Trap and System call handling
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

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

62#include <machine/cpu.h>
63#include <machine/psl.h>
64#include <machine/reg.h>
65#include <machine/eflags.h>
66#include <machine/trap.h>
67
68#include "isa.h"
69#include "npx.h"
39 */
40
41/*
42 * 386 Trap and System call handling
43 */
44
45#include <sys/param.h>
46#include <sys/systm.h>

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

62#include <machine/cpu.h>
63#include <machine/psl.h>
64#include <machine/reg.h>
65#include <machine/eflags.h>
66#include <machine/trap.h>
67
68#include "isa.h"
69#include "npx.h"
70#include "ddb.h"
71
72int trap_pfault __P((struct trapframe *, int));
73void trap_fatal __P((struct trapframe *));
74
75#define MAX_TRAP_MSG 27
76char *trap_msg[] = {
77 "reserved addressing fault", /* 0 T_RESADFLT */
78 "privileged instruction fault", /* 1 T_PRIVINFLT */

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

220
221 case T_DIVIDE: /* integer divide fault */
222 ucode = FPE_INTDIV_TRAP;
223 i = SIGFPE;
224 break;
225
226#if NISA > 0
227 case T_NMI:
70
71int trap_pfault __P((struct trapframe *, int));
72void trap_fatal __P((struct trapframe *));
73
74#define MAX_TRAP_MSG 27
75char *trap_msg[] = {
76 "reserved addressing fault", /* 0 T_RESADFLT */
77 "privileged instruction fault", /* 1 T_PRIVINFLT */

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

219
220 case T_DIVIDE: /* integer divide fault */
221 ucode = FPE_INTDIV_TRAP;
222 i = SIGFPE;
223 break;
224
225#if NISA > 0
226 case T_NMI:
228#if NDDB > 0
227#ifdef DDB
229 /* NMI can be hooked up to a pushbutton for debugging */
230 printf ("NMI ... going to debugger\n");
231 if (kdb_trap (type, 0, &frame))
232 return;
233#endif
234 /* machine/parity/power fail/"kitchen sink" faults */
235 if (isa_nmi(code) == 0) return;
236 panic("NMI indicates hardware failure");

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

281 case T_PROTFLT: /* general protection fault */
282 case T_SEGNPFLT: /* segment not present fault */
283 if (curpcb && curpcb->pcb_onfault) {
284 frame.tf_eip = (int)curpcb->pcb_onfault;
285 return;
286 }
287 break;
288
228 /* NMI can be hooked up to a pushbutton for debugging */
229 printf ("NMI ... going to debugger\n");
230 if (kdb_trap (type, 0, &frame))
231 return;
232#endif
233 /* machine/parity/power fail/"kitchen sink" faults */
234 if (isa_nmi(code) == 0) return;
235 panic("NMI indicates hardware failure");

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

280 case T_PROTFLT: /* general protection fault */
281 case T_SEGNPFLT: /* segment not present fault */
282 if (curpcb && curpcb->pcb_onfault) {
283 frame.tf_eip = (int)curpcb->pcb_onfault;
284 return;
285 }
286 break;
287
289#if NDDB > 0
288#ifdef DDB
290 case T_BPTFLT:
291 case T_TRCTRAP:
292 if (kdb_trap (type, 0, &frame))
293 return;
294 break;
295#else
296 case T_TRCTRAP: /* trace trap -- someone single stepping lcall's */
297 /* Q: how do we turn it on again? */
298 frame.tf_eflags &= ~PSL_T;
299 return;
300#endif
301
302#if NISA > 0
303 case T_NMI:
289 case T_BPTFLT:
290 case T_TRCTRAP:
291 if (kdb_trap (type, 0, &frame))
292 return;
293 break;
294#else
295 case T_TRCTRAP: /* trace trap -- someone single stepping lcall's */
296 /* Q: how do we turn it on again? */
297 frame.tf_eflags &= ~PSL_T;
298 return;
299#endif
300
301#if NISA > 0
302 case T_NMI:
304#if NDDB > 0
303#ifdef DDB
305 /* NMI can be hooked up to a pushbutton for debugging */
306 printf ("NMI ... going to debugger\n");
307 if (kdb_trap (type, 0, &frame))
308 return;
309#endif
310 /* machine/parity/power fail/"kitchen sink" faults */
311 if (isa_nmi(code) == 0) return;
312 /* FALL THROUGH */

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

500 if (cpl == 0)
501 printf("none");
502 printf("\n");
503
504#ifdef KDB
505 if (kdb_trap(&psl))
506 return;
507#endif
304 /* NMI can be hooked up to a pushbutton for debugging */
305 printf ("NMI ... going to debugger\n");
306 if (kdb_trap (type, 0, &frame))
307 return;
308#endif
309 /* machine/parity/power fail/"kitchen sink" faults */
310 if (isa_nmi(code) == 0) return;
311 /* FALL THROUGH */

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

499 if (cpl == 0)
500 printf("none");
501 printf("\n");
502
503#ifdef KDB
504 if (kdb_trap(&psl))
505 return;
506#endif
508#if NDDB > 0
507#ifdef DDB
509 if (kdb_trap (type, 0, frame))
510 return;
511#endif
512 if (type <= MAX_TRAP_MSG)
513 panic(trap_msg[type]);
514 else
515 panic("unknown/reserved trap");
516}

--- 173 unchanged lines hidden ---
508 if (kdb_trap (type, 0, frame))
509 return;
510#endif
511 if (type <= MAX_TRAP_MSG)
512 panic(trap_msg[type]);
513 else
514 panic("unknown/reserved trap");
515}

--- 173 unchanged lines hidden ---