summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/include/trap.h
blob: 1cd82a99237358cccdca4f1f5db24a56fa7f7ddc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/*	$OpenBSD: trap.h,v 1.11 2001/08/24 22:52:20 miod Exp $ */
/* 
 * Mach Operating System
 * Copyright (c) 1992 Carnegie Mellon University
 * All Rights Reserved.
 * 
 * Permission to use, copy, modify and distribute this software and its
 * documentation is hereby granted, provided that both the copyright
 * notice and this permission notice appear in all copies of the
 * software, derivative works or modified versions, and any portions
 * thereof, and that both notices appear in supporting documentation.
 * 
 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
 * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
 * 
 * Carnegie Mellon requests users of this software to return to
 * 
 *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
 *  School of Computer Science
 *  Carnegie Mellon University
 *  Pittsburgh PA 15213-3890
 * 
 * any improvements or extensions that they make and grant Carnegie Mellon 
 * the rights to redistribute these changes.
 */
/*
 * Trap codes 
 */
#ifndef __MACHINE_TRAP_H__
#define __MACHINE_TRAP_H__

/*
 * Trap type values
 */

#define T_RESADFLT	0	/* reserved addressing fault */
#define T_PRIVINFLT	1	/* privileged instruction fault */
#define T_RESOPFLT	2	/* reserved operand fault */

/* End of known constants */

#define T_INSTFLT	3	/* instruction access exception */
#define T_DATAFLT	4	/* data access exception */
#define T_MISALGNFLT	5	/* misaligned access exception */
#define T_ILLFLT	6	/* unimplemented opcode exception */
#define T_BNDFLT	7	/* bounds check violation exception */
#define T_ZERODIV	8	/* illegal divide exception */
#define T_OVFFLT	9	/* integer overflow exception */
#define T_ERRORFLT	10	/* error exception */
#define T_FPEPFLT	11	/* floating point precise exception */
#define T_FPEIFLT	12	/* floating point imprecise exception */
#define T_ASTFLT	13	/* software trap */
#if	DDB
#define	T_KDB_ENTRY	14	/* force entry to kernel debugger */
#define T_KDB_BREAK	15	/* break point hit */
#define T_KDB_TRACE	16	/* trace */
#endif /* DDB */
#define T_UNKNOWNFLT	17	/* unknown exception */
#define T_SIGTRAP	18	/* generate SIGTRAP */
#define T_SIGSYS	19	/* generate SIGSYS */
#define T_STEPBPT	20	/* special breakpoint for single step */
#define T_USERBPT	21	/* user set breakpoint (for debugger) */
#define T_SYSCALL	22	/* Syscall */
#define T_NON_MASK	23	/* MVME197 Non-Maskable Interrupt */
#if	DDB
#define	T_KDB_WATCH	24	/* watchpoint hit */
#endif /* DDB */
#define T_197_READ	25	/* MVME197 Data Read Miss (Software Table Searches) */
#define T_197_WRITE	26	/* MVME197 Data Write Miss (Software Table Searches) */
#define T_197_INST	27	/* MVME197 Inst ATC Miss (Software Table Searches) */
#define T_INT		28	/* interrupt exception */
#define T_USER		29	/* user mode fault */

#ifndef _LOCORE
void panictrap(int type, struct m88100_saved_state *frame);
void test_trap(struct m88100_saved_state *frame);
void error_fault(struct m88100_saved_state *frame);
void error_reset(struct m88100_saved_state *frame);
void child_return(struct proc *p);
unsigned ss_get_value(struct proc *p, unsigned addr, int size);
int ss_put_value(struct proc *p, unsigned addr, unsigned value, int size);
unsigned ss_branch_taken(unsigned inst, unsigned pc, 
			 unsigned (*func)(unsigned int, struct trapframe *),
			 struct trapframe *func_data);  /* 'opaque' */
unsigned ss_getreg_val(unsigned regno, struct trapframe *tf);
int ss_inst_branch(unsigned ins);
int ss_inst_delayed(unsigned ins);
unsigned ss_next_instr_address(struct proc *p, unsigned pc, unsigned delay_slot);
int cpu_singlestep(register struct proc *p);

#if defined(MVME187) || defined(MVME188)
void syscall(register_t code, struct m88100_saved_state *tf);
void trap18x(unsigned type, struct m88100_saved_state *frame);
#endif /* defined(MVME187) || defined(MVME188) */
#ifdef MVME197
void m197_syscall(register_t code, struct m88100_saved_state *tf);
void trap197(unsigned type, struct m88100_saved_state *frame);
#endif /* MVME197 */

#endif /* _LOCORE */

#endif /* __MACHINE_TRAP_H__ */