xref: /freebsd/sys/i386/include/tss.h (revision 51369649b03ece2aed3eb61b0c8214b9aa5b2fa2)
15b81b6b3SRodney W. Grimes /*-
2*51369649SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
3*51369649SPedro F. Giffuni  *
45b81b6b3SRodney W. Grimes  * Copyright (c) 1990 The Regents of the University of California.
55b81b6b3SRodney W. Grimes  * All rights reserved.
65b81b6b3SRodney W. Grimes  *
75b81b6b3SRodney W. Grimes  * This code is derived from software contributed to Berkeley by
85b81b6b3SRodney W. Grimes  * William Jolitz.
95b81b6b3SRodney W. Grimes  *
105b81b6b3SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
115b81b6b3SRodney W. Grimes  * modification, are permitted provided that the following conditions
125b81b6b3SRodney W. Grimes  * are met:
135b81b6b3SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
145b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
155b81b6b3SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
165b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
175b81b6b3SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
18fbbd9655SWarner Losh  * 3. Neither the name of the University nor the names of its contributors
195b81b6b3SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
205b81b6b3SRodney W. Grimes  *    without specific prior written permission.
215b81b6b3SRodney W. Grimes  *
225b81b6b3SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
235b81b6b3SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
245b81b6b3SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
255b81b6b3SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
265b81b6b3SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
275b81b6b3SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
285b81b6b3SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
295b81b6b3SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
305b81b6b3SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
315b81b6b3SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
325b81b6b3SRodney W. Grimes  * SUCH DAMAGE.
335b81b6b3SRodney W. Grimes  *
3434a8ed1bSRodney W. Grimes  *	from: @(#)tss.h	5.4 (Berkeley) 1/18/91
35c3aac50fSPeter Wemm  * $FreeBSD$
365b81b6b3SRodney W. Grimes  */
375b81b6b3SRodney W. Grimes 
386e393973SGarrett Wollman #ifndef _MACHINE_TSS_H_
396e393973SGarrett Wollman #define _MACHINE_TSS_H_ 1
406e393973SGarrett Wollman 
415b81b6b3SRodney W. Grimes /*
425b81b6b3SRodney W. Grimes  * Intel 386 Context Data Type
435b81b6b3SRodney W. Grimes  */
445b81b6b3SRodney W. Grimes 
455b81b6b3SRodney W. Grimes struct i386tss {
465b81b6b3SRodney W. Grimes 	int	tss_link;	/* actually 16 bits: top 16 bits must be zero */
476c5e9bbdSMike Pritchard 	int	tss_esp0; 	/* kernel stack pointer privilege level 0 */
485b81b6b3SRodney W. Grimes 	int	tss_ss0;	/* actually 16 bits: top 16 bits must be zero */
496c5e9bbdSMike Pritchard 	int	tss_esp1; 	/* kernel stack pointer privilege level 1 */
505b81b6b3SRodney W. Grimes 	int	tss_ss1;	/* actually 16 bits: top 16 bits must be zero */
516c5e9bbdSMike Pritchard 	int	tss_esp2; 	/* kernel stack pointer privilege level 2 */
525b81b6b3SRodney W. Grimes 	int	tss_ss2;	/* actually 16 bits: top 16 bits must be zero */
535b81b6b3SRodney W. Grimes 	int	tss_cr3; 	/* page table directory */
545b81b6b3SRodney W. Grimes 	int	tss_eip; 	/* program counter */
555b81b6b3SRodney W. Grimes 	int	tss_eflags; 	/* program status longword */
565b81b6b3SRodney W. Grimes 	int	tss_eax;
575b81b6b3SRodney W. Grimes 	int	tss_ecx;
585b81b6b3SRodney W. Grimes 	int	tss_edx;
595b81b6b3SRodney W. Grimes 	int	tss_ebx;
605b81b6b3SRodney W. Grimes 	int	tss_esp; 	/* user stack pointer */
615b81b6b3SRodney W. Grimes 	int	tss_ebp; 	/* user frame pointer */
625b81b6b3SRodney W. Grimes 	int	tss_esi;
635b81b6b3SRodney W. Grimes 	int	tss_edi;
645b81b6b3SRodney W. Grimes 	int	tss_es;		/* actually 16 bits: top 16 bits must be zero */
655b81b6b3SRodney W. Grimes 	int	tss_cs;		/* actually 16 bits: top 16 bits must be zero */
665b81b6b3SRodney W. Grimes 	int	tss_ss;		/* actually 16 bits: top 16 bits must be zero */
675b81b6b3SRodney W. Grimes 	int	tss_ds;		/* actually 16 bits: top 16 bits must be zero */
685b81b6b3SRodney W. Grimes 	int	tss_fs;		/* actually 16 bits: top 16 bits must be zero */
695b81b6b3SRodney W. Grimes 	int	tss_gs;		/* actually 16 bits: top 16 bits must be zero */
705b81b6b3SRodney W. Grimes 	int	tss_ldt;	/* actually 16 bits: top 16 bits must be zero */
715b81b6b3SRodney W. Grimes 	int	tss_ioopt;	/* options & io offset bitmap: currently zero */
725b81b6b3SRodney W. Grimes 				/* XXX unimplemented .. i/o permission bitmap */
735b81b6b3SRodney W. Grimes };
745206bca1SLuoqi Chen 
756e393973SGarrett Wollman #endif /* _MACHINE_TSS_H_ */
76