xref: /titanic_50/usr/src/uts/sparc/v9/sys/machtrap.h (revision 4e8a0fa6fce12b5763c5ec0a8fdc66de5f4d8214)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_MACHTRAP_H
287c478bd9Sstevel@tonic-gate #define	_SYS_MACHTRAP_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
337c478bd9Sstevel@tonic-gate extern "C" {
347c478bd9Sstevel@tonic-gate #endif
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate /*
377c478bd9Sstevel@tonic-gate  * This file is machine specific as is.
387c478bd9Sstevel@tonic-gate  * Some trap types could be made common
397c478bd9Sstevel@tonic-gate  * for all sparcs, but that is a project
407c478bd9Sstevel@tonic-gate  * in and of itself.
417c478bd9Sstevel@tonic-gate  */
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate /*
447c478bd9Sstevel@tonic-gate  * Hardware traps.
457c478bd9Sstevel@tonic-gate  */
467c478bd9Sstevel@tonic-gate #define	T_POR			0x001
477c478bd9Sstevel@tonic-gate #define	T_WDR			0x002
487c478bd9Sstevel@tonic-gate #define	T_XIR			0x003
497c478bd9Sstevel@tonic-gate #define	T_SIR			0x004
507c478bd9Sstevel@tonic-gate #define	T_RED_EXCEPTION		0x005
517c478bd9Sstevel@tonic-gate #define	T_INSTR_EXCEPTION	0x008
527c478bd9Sstevel@tonic-gate #define	T_INSTR_MMU_MISS	0x009
537c478bd9Sstevel@tonic-gate #define	T_INSTR_ERROR		0x00A
547c478bd9Sstevel@tonic-gate #define	T_UNIMP_INSTR		0x010
557c478bd9Sstevel@tonic-gate #define	T_PRIV_INSTR		0x011
56*4e8a0fa6Swsm #define	T_UNIMP_LDD		0x012
57*4e8a0fa6Swsm #define	T_UNIMP_STD		0x013
587c478bd9Sstevel@tonic-gate #define	T_FP_DISABLED		0x020
597c478bd9Sstevel@tonic-gate #define	T_FP_EXCEPTION_IEEE	0x021
607c478bd9Sstevel@tonic-gate #define	T_FP_EXCEPTION_OTHER	0x022
617c478bd9Sstevel@tonic-gate #define	T_TAG_OVERFLOW		0x023
627c478bd9Sstevel@tonic-gate #define	T_CLEAN_WINDOW		0x024
637c478bd9Sstevel@tonic-gate #define	T_IDIV0			0x028
647c478bd9Sstevel@tonic-gate #define	T_DATA_EXCEPTION	0x030
657c478bd9Sstevel@tonic-gate #define	T_DATA_MMU_MISS		0x031
667c478bd9Sstevel@tonic-gate #define	T_DATA_ERROR		0x032
677c478bd9Sstevel@tonic-gate #define	T_DATA_PROT		0x033
687c478bd9Sstevel@tonic-gate #define	T_ALIGNMENT		0x034
697c478bd9Sstevel@tonic-gate #define	T_LDDF_ALIGN		0x035
707c478bd9Sstevel@tonic-gate #define	T_STDF_ALIGN		0x036
717c478bd9Sstevel@tonic-gate #define	T_PRIV_ACTION		0x037
727c478bd9Sstevel@tonic-gate #define	T_ASYNC_ERROR		0x040
737c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_1		0x041
747c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_2		0x042
757c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_3		0x043
767c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_4		0x044
777c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_5		0x045
787c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_6		0x046
797c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_7		0x047
807c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_8		0x048
817c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_9		0x049
827c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_10		0x04A
837c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_11		0x04B
847c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_12		0x04C
857c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_13		0x04D
867c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_14		0x04E
877c478bd9Sstevel@tonic-gate #define	T_INT_LEVEL_15		0x04F
887c478bd9Sstevel@tonic-gate #define	T_VECTORED_INT		0x060
897c478bd9Sstevel@tonic-gate #define	T_PA_WATCHPOINT		0x061
907c478bd9Sstevel@tonic-gate #define	T_VA_WATCHPOINT		0x062
917c478bd9Sstevel@tonic-gate #define	T_FAST_INSTR_MMU_MISS	0x064
927c478bd9Sstevel@tonic-gate #define	T_FAST_DATA_MMU_MISS	0x068
937c478bd9Sstevel@tonic-gate #define	T_FAST_DATA_MMU_PROT	0x06C
947c478bd9Sstevel@tonic-gate #define	T_WIN_OVERFLOW		0x080
957c478bd9Sstevel@tonic-gate #define	T_WIN_UNDERFLOW		0x0C0
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate /*
987c478bd9Sstevel@tonic-gate  * T_TL1 is the bit that is used to compute the trap vector address when the
997c478bd9Sstevel@tonic-gate  * trap is taken at TL>0.  This flag is for trap_table.s use, not trap.c use.
1007c478bd9Sstevel@tonic-gate  */
1017c478bd9Sstevel@tonic-gate #define	T_TL1			0x200
1027c478bd9Sstevel@tonic-gate 
1037c478bd9Sstevel@tonic-gate /*
1047c478bd9Sstevel@tonic-gate  * Software trap type values.
1057c478bd9Sstevel@tonic-gate  */
1067c478bd9Sstevel@tonic-gate #define	T_SOFTWARE_TRAP		0x100
1077c478bd9Sstevel@tonic-gate #define	T_ESOFTWARE_TRAP	0x1FF
1087c478bd9Sstevel@tonic-gate #define	T_OSYSCALL		(T_SOFTWARE_TRAP + ST_OSYSCALL)
1097c478bd9Sstevel@tonic-gate #define	T_BREAKPOINT		(T_SOFTWARE_TRAP + ST_BREAKPOINT)
1107c478bd9Sstevel@tonic-gate #define	T_DIV0			(T_SOFTWARE_TRAP + ST_DIV0)
1117c478bd9Sstevel@tonic-gate #define	T_FLUSH_WINDOWS		(T_SOFTWARE_TRAP + ST_FLUSH_WINDOWS)
1127c478bd9Sstevel@tonic-gate #define	T_CLEAN_WINDOWS		(T_SOFTWARE_TRAP + ST_CLEAN_WINDOWS)
1137c478bd9Sstevel@tonic-gate #define	T_RANGE_CHECK		(T_SOFTWARE_TRAP + ST_RANGE_CHECK)
1147c478bd9Sstevel@tonic-gate #define	T_FIX_ALIGN		(T_SOFTWARE_TRAP + ST_FIX_ALIGN)
1157c478bd9Sstevel@tonic-gate #define	T_INT_OVERFLOW		(T_SOFTWARE_TRAP + ST_INT_OVERFLOW)
1167c478bd9Sstevel@tonic-gate #define	T_SYSCALL		(T_SOFTWARE_TRAP + ST_SYSCALL)
1177c478bd9Sstevel@tonic-gate #define	T_GETCC			(T_SOFTWARE_TRAP + ST_GETCC)
1187c478bd9Sstevel@tonic-gate #define	T_SETCC			(T_SOFTWARE_TRAP + ST_SETCC)
1197c478bd9Sstevel@tonic-gate 
1207c478bd9Sstevel@tonic-gate #define	T_AST			0x200
1217c478bd9Sstevel@tonic-gate #define	T_FLUSH_PCB		(T_AST + 0x10)
1227c478bd9Sstevel@tonic-gate #define	T_SYS_RTT_PAGE		(T_AST + 0x20)
1237c478bd9Sstevel@tonic-gate #define	T_SYS_RTT_ALIGN		(T_AST + 0x30)
1247c478bd9Sstevel@tonic-gate #define	T_FLUSHW		(T_AST + 0x40)
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate /* user mode flag added to trap type */
1277c478bd9Sstevel@tonic-gate #define	T_USER			0x10000
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate 
1307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
1317c478bd9Sstevel@tonic-gate }
1327c478bd9Sstevel@tonic-gate #endif
1337c478bd9Sstevel@tonic-gate 
1347c478bd9Sstevel@tonic-gate #endif	/* _SYS_MACHTRAP_H */
135