]>
git.saurik.com Git - apple/xnu.git/blob - osfmk/i386/tss.h
2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_OSREFERENCE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the
10 * License may not be used to create, or enable the creation or
11 * redistribution of, unlawful or unlicensed copies of an Apple operating
12 * system, or to circumvent, violate, or enable the circumvention or
13 * violation of, any terms of an Apple operating system software license
16 * Please obtain a copy of the License at
17 * http://www.opensource.apple.com/apsl/ and read it before using this
20 * The Original Code and all software distributed under the License are
21 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
22 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
23 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
25 * Please see the License for the specific language governing rights and
26 * limitations under the License.
28 * @APPLE_LICENSE_OSREFERENCE_HEADER_END@
34 * Mach Operating System
35 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
36 * All Rights Reserved.
38 * Permission to use, copy, modify and distribute this software and its
39 * documentation is hereby granted, provided that both the copyright
40 * notice and this permission notice appear in all copies of the
41 * software, derivative works or modified versions, and any portions
42 * thereof, and that both notices appear in supporting documentation.
44 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
45 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
46 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
48 * Carnegie Mellon requests users of this software to return to
50 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
51 * School of Computer Science
52 * Carnegie Mellon University
53 * Pittsburgh PA 15213-3890
55 * any improvements or extensions that they make and grant Carnegie Mellon
56 * the rights to redistribute these changes.
67 * i386 Task State Segment
70 uint32_t back_link
; /* segment number of previous task,
72 uint32_t esp0
; /* initial stack pointer ... */
73 uint32_t ss0
; /* and segment for ring 0 */
74 uint32_t esp1
; /* initial stack pointer ... */
75 uint32_t ss1
; /* and segment for ring 1 */
76 uint32_t esp2
; /* initial stack pointer ... */
77 uint32_t ss2
; /* and segment for ring 2 */
78 uint32_t cr3
; /* CR3 - page table directory
86 uint32_t esp
; /* current stack pointer */
92 uint32_t ss
; /* current stack segment */
96 uint32_t ldt
; /* local descriptor table segment */
97 uint16_t trace_trap
; /* trap on switch to this task */
98 uint16_t io_bit_map_offset
;
99 /* offset to start of IO permission
104 * Temporary stack used on kernel entry via the sysenter instruction.
105 * Its top points on to the PCB save area. It must contain space for
106 * a single interrupt stack frame in case of single-stepping over the sysenter.
107 * Although this is defined as a 64-bit stack, the space is also used in
108 * 32-bit legacy mode. For 64-bit the stack is 16-byte aligned.
110 struct sysenter_stack
{
111 uint64_t stack
[16]; /* Space for a 64-bit frame and some */
112 uint64_t top
; /* Top and pointer to ISS in PCS */
117 uint64_t rsp0
; /* stack pointer for CPL0 */
118 uint64_t rsp1
; /* stack pointer for CPL1 */
119 uint64_t rsp2
; /* stack pointer for CPL2 */
122 uint64_t ist1
; /* interrupt stack table 1 */
123 uint64_t ist2
; /* interrupt stack table 2 */
124 uint64_t ist3
; /* interrupt stack table 3 */
125 uint64_t ist4
; /* interrupt stack table 4 */
126 uint64_t ist5
; /* interrupt stack table 5 */
127 uint64_t ist6
; /* interrupt stack table 6 */
128 uint64_t ist7
; /* interrupt stack table 7 */
132 uint16_t io_bit_map_offset
;
133 /* offset to IO permission bit map */
135 #endif /* _I386_TSS_H_ */