utrap.h revision 106050
1/*-
2 * Copyright (c) 2001 Jake Burkholder.
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 *    notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 *    notice, this list of conditions and the following disclaimer in the
12 *    documentation and/or other materials provided with the distribution.
13 *
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
26 * $FreeBSD: head/sys/sparc64/include/utrap.h 106050 2002-10-27 17:22:43Z jake $
27 */
28
29#ifndef	_MACHINE_UTRAP_H_
30#define	_MACHINE_UTRAP_H_
31
32#define	UT_INSTRUCTION_EXCEPTION	1
33#define	UT_INSTRUCTION_ERROR		2
34#define	UT_INSTRUCTION_PROTECTION	3
35#define	UT_ILLTRAP_INSTRUCTION		4
36#define	UT_ILLEGAL_INSTRUCTION		5
37#define	UT_PRIVILEGED_OPCODE		6
38#define	UT_FP_DISABLED			7
39#define	UT_FP_EXCEPTION_IEEE_754	8
40#define	UT_FP_EXCEPTION_OTHER		9
41#define	UT_TAG_OFERFLOW			10
42#define	UT_DIVISION_BY_ZERO		11
43#define	UT_DATA_EXCEPTION		12
44#define	UT_DATA_ERROR			13
45#define	UT_DATA_PROTECTION		14
46#define	UT_MEM_ADDRESS_NOT_ALIGNED	15
47#define	UT_PRIVILEGED_ACTION		16
48#define	UT_ASYNC_DATA_ERROR		17
49#define	UT_TRAP_INSTRUCTION_16		18
50#define	UT_TRAP_INSTRUCTION_17		19
51#define	UT_TRAP_INSTRUCTION_18		20
52#define	UT_TRAP_INSTRUCTION_19		21
53#define	UT_TRAP_INSTRUCTION_20		22
54#define	UT_TRAP_INSTRUCTION_21		23
55#define	UT_TRAP_INSTRUCTION_22		24
56#define	UT_TRAP_INSTRUCTION_23		25
57#define	UT_TRAP_INSTRUCTION_24		26
58#define	UT_TRAP_INSTRUCTION_25		27
59#define	UT_TRAP_INSTRUCTION_26		28
60#define	UT_TRAP_INSTRUCTION_27		29
61#define	UT_TRAP_INSTRUCTION_28		30
62#define	UT_TRAP_INSTRUCTION_29		31
63#define	UT_TRAP_INSTRUCTION_30		32
64#define	UT_TRAP_INSTRUCTION_31		33
65#define	UT_MAX				34
66
67#define	ST_SUNOS_SYSCALL		0
68#define	ST_BREAKPOINT			1
69#define	ST_DIVISION_BY_ZERO		2
70#define	ST_FLUSH_WINDOWS		3	/* XXX implement! */
71#define	ST_CLEAN_WINDOW			4
72#define	ST_RANGE_CHECK			5
73#define	ST_FIX_ALIGNMENT		6
74#define	ST_INTEGER_OVERFLOW		7
75/* 8 is 32-bit ABI syscall (old solaris syscall?) */
76#define	ST_BSD_SYSCALL			9
77#define	ST_FP_RESTORE			10
78/* 11-15 are available */
79/* 16 is linux 32 bit syscall (but supposed to be reserved, grr) */
80/* 17 is old linux 64 bit syscall (but supposed to be reserved, grr) */
81/* 16-31 are reserved for user applications (utraps) */
82#define	ST_GETCC			32	/* XXX implement! */
83#define	ST_SETCC			33	/* XXX implement! */
84#define	ST_GETPSR			34	/* XXX implement! */
85#define	ST_SETPSR			35	/* XXX implement! */
86/* 36-63 are available */
87#define	ST_SOLARIS_SYSCALL		64
88#define	ST_SYSCALL			65
89#define	ST_SYSCALL32			66
90/* 67 is reserved to OS source licensee */
91/* 68 is return from deferred trap (not supported) */
92/* 69-95 are reserved to SPARC international */
93/* 96-108 are available */
94/* 109 is linux 64 bit syscall */
95/* 110 is linux 64 bit getcontext (?) */
96/* 111 is linux 64 bit setcontext (?) */
97/* 112-255 are available */
98
99#define	UTH_NOCHANGE			(-1)
100
101#ifndef __ASM__
102
103typedef	int utrap_entry_t;
104typedef void *utrap_handler_t;
105
106#endif
107
108#endif
109