xref: /titanic_53/usr/src/uts/intel/sys/tss.h (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1*7c478bd9Sstevel@tonic-gate /*
2*7c478bd9Sstevel@tonic-gate  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
3*7c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
4*7c478bd9Sstevel@tonic-gate  */
5*7c478bd9Sstevel@tonic-gate 
6*7c478bd9Sstevel@tonic-gate #ifndef	_SYS_TSS_H
7*7c478bd9Sstevel@tonic-gate #define	_SYS_TSS_H
8*7c478bd9Sstevel@tonic-gate 
9*7c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
10*7c478bd9Sstevel@tonic-gate 
11*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
12*7c478bd9Sstevel@tonic-gate extern "C" {
13*7c478bd9Sstevel@tonic-gate #endif
14*7c478bd9Sstevel@tonic-gate 
15*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1990, 1991 UNIX System Laboratories, Inc.	*/
16*7c478bd9Sstevel@tonic-gate /*	Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T	*/
17*7c478bd9Sstevel@tonic-gate /*	  All Rights Reserved  	*/
18*7c478bd9Sstevel@tonic-gate 
19*7c478bd9Sstevel@tonic-gate /*
20*7c478bd9Sstevel@tonic-gate  * Copyright (c) 1990 The Regents of the University of California.
21*7c478bd9Sstevel@tonic-gate  * All rights reserved.
22*7c478bd9Sstevel@tonic-gate  *
23*7c478bd9Sstevel@tonic-gate  * This code is derived from software contributed to Berkeley by
24*7c478bd9Sstevel@tonic-gate  * William Jolitz.
25*7c478bd9Sstevel@tonic-gate  *
26*7c478bd9Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
27*7c478bd9Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
28*7c478bd9Sstevel@tonic-gate  * are met:
29*7c478bd9Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
30*7c478bd9Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
31*7c478bd9Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
32*7c478bd9Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in the
33*7c478bd9Sstevel@tonic-gate  *    documentation and/or other materials provided with the distribution.
34*7c478bd9Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this software
35*7c478bd9Sstevel@tonic-gate  *    must display the following acknowledgement:
36*7c478bd9Sstevel@tonic-gate  *	This product includes software developed by the University of
37*7c478bd9Sstevel@tonic-gate  *	California, Berkeley and its contributors.
38*7c478bd9Sstevel@tonic-gate  * 4. Neither the name of the University nor the names of its contributors
39*7c478bd9Sstevel@tonic-gate  *    may be used to endorse or promote products derived from this software
40*7c478bd9Sstevel@tonic-gate  *    without specific prior written permission.
41*7c478bd9Sstevel@tonic-gate  *
42*7c478bd9Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
43*7c478bd9Sstevel@tonic-gate  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
44*7c478bd9Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
45*7c478bd9Sstevel@tonic-gate  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
46*7c478bd9Sstevel@tonic-gate  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
47*7c478bd9Sstevel@tonic-gate  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
48*7c478bd9Sstevel@tonic-gate  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
49*7c478bd9Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
50*7c478bd9Sstevel@tonic-gate  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
51*7c478bd9Sstevel@tonic-gate  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
52*7c478bd9Sstevel@tonic-gate  * SUCH DAMAGE.
53*7c478bd9Sstevel@tonic-gate  *
54*7c478bd9Sstevel@tonic-gate  *	from: @(#)tss.h	5.4 (Berkeley) 1/18/91
55*7c478bd9Sstevel@tonic-gate  * $FreeBSD: src/sys/i386/include/tss.h,v 1.13 2002/09/23 05:04:05 peter Exp $
56*7c478bd9Sstevel@tonic-gate  */
57*7c478bd9Sstevel@tonic-gate 
58*7c478bd9Sstevel@tonic-gate /*
59*7c478bd9Sstevel@tonic-gate  * Maximum I/O address that will be in TSS bitmap
60*7c478bd9Sstevel@tonic-gate  */
61*7c478bd9Sstevel@tonic-gate #define	MAXTSSIOADDR	0x3ff	/* XXX - needs to support 64K I/O space */
62*7c478bd9Sstevel@tonic-gate 
63*7c478bd9Sstevel@tonic-gate #ifndef _ASM
64*7c478bd9Sstevel@tonic-gate 
65*7c478bd9Sstevel@tonic-gate /*
66*7c478bd9Sstevel@tonic-gate  * Task state segment (tss). Holds the processor state assoicated with
67*7c478bd9Sstevel@tonic-gate  * a task.
68*7c478bd9Sstevel@tonic-gate  */
69*7c478bd9Sstevel@tonic-gate 
70*7c478bd9Sstevel@tonic-gate #if defined(__amd64)
71*7c478bd9Sstevel@tonic-gate 
72*7c478bd9Sstevel@tonic-gate #pragma	pack(4)
73*7c478bd9Sstevel@tonic-gate struct tss {
74*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_rsvd0;	/* reserved, ignored */
75*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_rsp0; 	/* stack pointer CPL = 0 */
76*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_rsp1; 	/* stack pointer CPL = 1 */
77*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_rsp2; 	/* stack pointer CPL = 2 */
78*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_rsvd1;	/* reserved, ignored */
79*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist1;	/* Interrupt stack table 1 */
80*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist2;	/* Interrupt stack table 2 */
81*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist3;	/* Interrupt stack table 3 */
82*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist4;	/* Interrupt stack table 4 */
83*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist5;	/* Interrupt stack table 5 */
84*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist6;	/* Interrupt stack table 6 */
85*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_ist7;	/* Interrupt stack table 7 */
86*7c478bd9Sstevel@tonic-gate 	uint64_t	tss_rsvd2;	/* reserved, ignored */
87*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd3;	/* reserved, ignored */
88*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_bitmapbase;	/* io permission bitmap base address */
89*7c478bd9Sstevel@tonic-gate };
90*7c478bd9Sstevel@tonic-gate #pragma	pack()
91*7c478bd9Sstevel@tonic-gate 
92*7c478bd9Sstevel@tonic-gate #elif defined(__i386)
93*7c478bd9Sstevel@tonic-gate 
94*7c478bd9Sstevel@tonic-gate struct tss {
95*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_link;	/* 16-bit prior TSS selector */
96*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd0;	/* reserved, ignored */
97*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_esp0;
98*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_ss0;
99*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd1;	/* reserved, ignored */
100*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_esp1;
101*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_ss1;
102*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd2;	/* reserved, ignored */
103*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_esp2;
104*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_ss2;
105*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd3;	/* reserved, ignored */
106*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_cr3;
107*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_eip;
108*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_eflags;
109*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_eax;
110*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_ecx;
111*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_edx;
112*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_ebx;
113*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_esp;
114*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_ebp;
115*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_esi;
116*7c478bd9Sstevel@tonic-gate 	uint32_t	tss_edi;
117*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_es;
118*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd4;	/* reserved, ignored */
119*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_cs;
120*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd5;	/* reserved, ignored */
121*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_ss;
122*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd6;	/* reserved, ignored */
123*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_ds;
124*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd7;	/* reserved, ignored */
125*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_fs;
126*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd8;	/* reserved, ignored */
127*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_gs;
128*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd9;	/* reserved, ignored */
129*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_ldt;
130*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd10;	/* reserved, ignored */
131*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_rsvd11;	/* reserved, ignored */
132*7c478bd9Sstevel@tonic-gate 	uint16_t	tss_bitmapbase;	/* io permission bitmap base address */
133*7c478bd9Sstevel@tonic-gate };
134*7c478bd9Sstevel@tonic-gate 
135*7c478bd9Sstevel@tonic-gate #endif	/* __i386 */
136*7c478bd9Sstevel@tonic-gate 
137*7c478bd9Sstevel@tonic-gate #endif	/* !_ASM */
138*7c478bd9Sstevel@tonic-gate 
139*7c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
140*7c478bd9Sstevel@tonic-gate }
141*7c478bd9Sstevel@tonic-gate #endif
142*7c478bd9Sstevel@tonic-gate 
143*7c478bd9Sstevel@tonic-gate #endif	/* _SYS_TSS_H */
144