xref: /titanic_50/usr/src/uts/sun4/sys/scb.h (revision 2df1fe9ca32bb227b9158c67f5c00b54c20b10fd)
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 (c) 1991, by Sun Microsystems, Inc.
24  */
25 
26 #ifndef _SYS_SCB_H
27 #define	_SYS_SCB_H
28 
29 #pragma ident	"%Z%%M%	%I%	%E% SMI"
30 
31 #ifdef	__cplusplus
32 extern "C" {
33 #endif
34 
35 #define	VEC_MIN 0
36 #define	VEC_MAX 255
37 #define	AUTOBASE	16		/* base for autovectored ints */
38 
39 #ifndef _ASM
40 
41 typedef	struct trapvec {
42 	int	instr[8];
43 } trapvec;
44 
45 /*
46  * Sparc9 System control block layout
47  */
48 struct scb {
49 	trapvec	tl0_hwtraps[256];	/* 0 - 255 tl0 hw traps */
50 	trapvec	tl0_swtraps[256];	/* 256 - 511 tl0 sw traps */
51 	trapvec	tl1_hwtraps[256];	/* 512 - 767 tl>0 hw traps */
52 	/* we don't use tl>0 sw traps */
53 };
54 
55 #ifdef _KERNEL
56 extern	struct scb scb;
57 #endif /* _KERNEL */
58 
59 #endif /* _ASM */
60 
61 /*
62  * These defines are used by the TL1 tlb miss handlers to calculate
63  * the pc to jump to in the case the entry was not found in the TSB.
64  */
65 #define	WTRAP_ALIGN	0x7f	/* window handlers are 128 byte align */
66 #define	WTRAP_FAULTOFF	124	/* last instruction in handler */
67 
68 /* use the following defines to determine if trap was a fill or a spill */
69 #define	WTRAP_TTMASK	0x180
70 #define	WTRAP_TYPE	0x080
71 
72 
73 #ifdef	__cplusplus
74 }
75 #endif
76 
77 #endif	/* _SYS_SCB_H */
78