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