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