xref: /openbsd/sys/arch/m88k/include/trap.h (revision f57a55ed)
1 /*	$OpenBSD: trap.h,v 1.12 2020/09/25 15:10:48 deraadt Exp $ */
2 /*
3  * Mach Operating System
4  * Copyright (c) 1992 Carnegie Mellon University
5  * All Rights Reserved.
6  *
7  * Permission to use, copy, modify and distribute this software and its
8  * documentation is hereby granted, provided that both the copyright
9  * notice and this permission notice appear in all copies of the
10  * software, derivative works or modified versions, and any portions
11  * thereof, and that both notices appear in supporting documentation.
12  *
13  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
14  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
15  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
16  *
17  * Carnegie Mellon requests users of this software to return to
18  *
19  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
20  *  School of Computer Science
21  *  Carnegie Mellon University
22  *  Pittsburgh PA 15213-3890
23  *
24  * any improvements or extensions that they make and grant Carnegie Mellon
25  * the rights to redistribute these changes.
26  */
27 #ifndef _M88K_TRAP_H_
28 #define _M88K_TRAP_H_
29 
30 /*
31  * Trap type values. These have no relation to the trap vector offsets in
32  * the VBR page.
33  */
34 #define	T_PRIVINFLT	0	/* privileged instruction fault */
35 #define	T_INSTFLT	1	/* instruction access exception */
36 #define	T_DATAFLT	2	/* data access exception */
37 #define	T_MISALGNFLT	3	/* misaligned access exception */
38 #define	T_ILLFLT	4	/* unimplemented opcode exception */
39 #define	T_BNDFLT	5	/* bounds check violation exception */
40 #define	T_ZERODIV	6	/* illegal divide exception */
41 #define	T_OVFFLT	7	/* integer overflow exception */
42 #define	T_FPEPFLT	8	/* floating point precise exception */
43 #define	T_FPEIFLT	9	/* floating point imprecise exception (88100) */
44 #define	T_KDB_ENTRY	10	/* force entry to kernel debugger */
45 #define	T_KDB_BREAK	11	/* break point hit */
46 #define	T_KDB_TRACE	12	/* trace */
47 #define	T_UNKNOWNFLT	13	/* unknown exception */
48 #define	T_SIGSYS	14	/* generate SIGSYS */
49 #define	T_STEPBPT	15	/* special breakpoint for single step */
50 #define	T_USERBPT	16	/* user set breakpoint (for debugger) */
51 #define	T_110_DRM	17	/* 88110 data read miss (sw table walk) */
52 #define	T_110_DWM	18	/* 88110 data write miss (sw table walk) */
53 #define	T_110_IAM	19	/* 88110 inst ATC miss (sw table walk) */
54 
55 #define	T_USER		0x40	/* or'd to trap code if user mode fault */
56 
57 #ifndef _LOCORE
58 
59 void	ast(struct trapframe *);
60 void	cache_flush(struct trapframe *);
61 void	interrupt(struct trapframe *);
62 int	nmi(struct trapframe *);
63 void	nmi_wrapup(struct trapframe *);
64 
65 void	m88100_syscall(register_t, struct trapframe *);
66 void	m88100_trap(u_int, struct trapframe *);
67 void	m88110_syscall(register_t, struct trapframe *);
68 void	m88110_trap(u_int, struct trapframe *);
69 
70 void	m88100_fpu_imprecise_exception(struct trapframe *);
71 void	m88100_fpu_precise_exception(struct trapframe *);
72 void	m88110_fpu_exception(struct trapframe *);
73 
74 #endif /* _LOCORE */
75 
76 #endif /* _M88K_TRAP_H_ */
77