xref: /titanic_44/usr/src/uts/sparc/sys/trap.h (revision 5679c89fcd2facbb4334df8870d3d7a4d2b11673)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_SYS_TRAP_H
27 #define	_SYS_TRAP_H
28 
29 #ifdef	__cplusplus
30 extern "C" {
31 #endif
32 
33 
34 /*
35  * This file is machine specific as is.
36  * Some trap types could be made common
37  * for all sparcs, but that is a project
38  * in and of itself.
39  */
40 
41 /*
42  * Software traps (ticc instructions).
43  */
44 #define	ST_OSYSCALL		0x00
45 #define	ST_BREAKPOINT		0x01
46 #define	ST_DIV0			0x02
47 #define	ST_FLUSH_WINDOWS	0x03
48 #define	ST_CLEAN_WINDOWS	0x04
49 #define	ST_RANGE_CHECK		0x05
50 #define	ST_FIX_ALIGN		0x06
51 #define	ST_INT_OVERFLOW		0x07
52 #define	ST_SYSCALL		0x08
53 #define	ST_TRANSACTION_FAILURE	0x0F
54 
55 /*
56  * Software trap vectors 16 - 31 are reserved for use by the user
57  * and will not be usurped by Sun.
58  */
59 
60 #define	ST_GETCC		0x20
61 #define	ST_SETCC		0x21
62 #define	ST_GETPSR		0x22
63 #define	ST_SETPSR		0x23
64 #define	ST_GETHRTIME		0x24
65 #define	ST_GETHRVTIME		0x25
66 #define	ST_SELFXCALL		0x26
67 #define	ST_GETHRESTIME		0x27
68 #define	ST_SETV9STACK		0x28
69 #define	ST_GETLGRP		0x29
70 
71 /*
72  * DTrace traps used for user-land tracing.
73  */
74 #define	ST_DTRACE_PID		0x38
75 #define	ST_DTRACE_PROBE		0x39
76 #define	ST_DTRACE_RETURN	0x3a
77 
78 #define	ST_KMDB_TRAP		0x7d
79 #define	ST_KMDB_BREAKPOINT	0x7e
80 #define	ST_MON_BREAKPOINT	0x7f
81 
82 #ifdef	__cplusplus
83 }
84 #endif
85 
86 #endif	/* _SYS_TRAP_H */
87