xref: /freebsd/sys/amd64/include/frame.h (revision 5b81b6b301437eb9a6df491c829475bd29ae5d6c)
15b81b6b3SRodney W. Grimes /*-
25b81b6b3SRodney W. Grimes  * Copyright (c) 1990 The Regents of the University of California.
35b81b6b3SRodney W. Grimes  * All rights reserved.
45b81b6b3SRodney W. Grimes  *
55b81b6b3SRodney W. Grimes  * This code is derived from software contributed to Berkeley by
65b81b6b3SRodney W. Grimes  * William Jolitz.
75b81b6b3SRodney W. Grimes  *
85b81b6b3SRodney W. Grimes  * Redistribution and use in source and binary forms, with or without
95b81b6b3SRodney W. Grimes  * modification, are permitted provided that the following conditions
105b81b6b3SRodney W. Grimes  * are met:
115b81b6b3SRodney W. Grimes  * 1. Redistributions of source code must retain the above copyright
125b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer.
135b81b6b3SRodney W. Grimes  * 2. Redistributions in binary form must reproduce the above copyright
145b81b6b3SRodney W. Grimes  *    notice, this list of conditions and the following disclaimer in the
155b81b6b3SRodney W. Grimes  *    documentation and/or other materials provided with the distribution.
165b81b6b3SRodney W. Grimes  * 3. All advertising materials mentioning features or use of this software
175b81b6b3SRodney W. Grimes  *    must display the following acknowledgement:
185b81b6b3SRodney W. Grimes  *	This product includes software developed by the University of
195b81b6b3SRodney W. Grimes  *	California, Berkeley and its contributors.
205b81b6b3SRodney W. Grimes  * 4. Neither the name of the University nor the names of its contributors
215b81b6b3SRodney W. Grimes  *    may be used to endorse or promote products derived from this software
225b81b6b3SRodney W. Grimes  *    without specific prior written permission.
235b81b6b3SRodney W. Grimes  *
245b81b6b3SRodney W. Grimes  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
255b81b6b3SRodney W. Grimes  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
265b81b6b3SRodney W. Grimes  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
275b81b6b3SRodney W. Grimes  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
285b81b6b3SRodney W. Grimes  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
295b81b6b3SRodney W. Grimes  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
305b81b6b3SRodney W. Grimes  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
315b81b6b3SRodney W. Grimes  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
325b81b6b3SRodney W. Grimes  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
335b81b6b3SRodney W. Grimes  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
345b81b6b3SRodney W. Grimes  * SUCH DAMAGE.
355b81b6b3SRodney W. Grimes  *
365b81b6b3SRodney W. Grimes  *	@(#)frame.h	5.2 (Berkeley) 1/18/91
375b81b6b3SRodney W. Grimes  */
385b81b6b3SRodney W. Grimes 
395b81b6b3SRodney W. Grimes /*
405b81b6b3SRodney W. Grimes  * System stack frames.
415b81b6b3SRodney W. Grimes  */
425b81b6b3SRodney W. Grimes 
435b81b6b3SRodney W. Grimes /*
445b81b6b3SRodney W. Grimes  * Exception/Trap Stack Frame
455b81b6b3SRodney W. Grimes  */
465b81b6b3SRodney W. Grimes 
475b81b6b3SRodney W. Grimes struct trapframe {
485b81b6b3SRodney W. Grimes 	int	tf_es;
495b81b6b3SRodney W. Grimes 	int	tf_ds;
505b81b6b3SRodney W. Grimes 	int	tf_edi;
515b81b6b3SRodney W. Grimes 	int	tf_esi;
525b81b6b3SRodney W. Grimes 	int	tf_ebp;
535b81b6b3SRodney W. Grimes 	int	tf_isp;
545b81b6b3SRodney W. Grimes 	int	tf_ebx;
555b81b6b3SRodney W. Grimes 	int	tf_edx;
565b81b6b3SRodney W. Grimes 	int	tf_ecx;
575b81b6b3SRodney W. Grimes 	int	tf_eax;
585b81b6b3SRodney W. Grimes 	int	tf_trapno;
595b81b6b3SRodney W. Grimes 	/* below portion defined in 386 hardware */
605b81b6b3SRodney W. Grimes 	int	tf_err;
615b81b6b3SRodney W. Grimes 	int	tf_eip;
625b81b6b3SRodney W. Grimes 	int	tf_cs;
635b81b6b3SRodney W. Grimes 	int	tf_eflags;
645b81b6b3SRodney W. Grimes 	/* below only when transitting rings (e.g. user to kernel) */
655b81b6b3SRodney W. Grimes 	int	tf_esp;
665b81b6b3SRodney W. Grimes 	int	tf_ss;
675b81b6b3SRodney W. Grimes };
685b81b6b3SRodney W. Grimes 
695b81b6b3SRodney W. Grimes /* Interrupt stack frame */
705b81b6b3SRodney W. Grimes 
715b81b6b3SRodney W. Grimes struct intrframe {
725b81b6b3SRodney W. Grimes 	int	if_vec;
735b81b6b3SRodney W. Grimes 	int	if_ppl;
745b81b6b3SRodney W. Grimes 	int	if_es;
755b81b6b3SRodney W. Grimes 	int	if_ds;
765b81b6b3SRodney W. Grimes 	int	if_edi;
775b81b6b3SRodney W. Grimes 	int	if_esi;
785b81b6b3SRodney W. Grimes 	int	if_ebp;
795b81b6b3SRodney W. Grimes 	int	:32;
805b81b6b3SRodney W. Grimes 	int	if_ebx;
815b81b6b3SRodney W. Grimes 	int	if_edx;
825b81b6b3SRodney W. Grimes 	int	if_ecx;
835b81b6b3SRodney W. Grimes 	int	if_eax;
845b81b6b3SRodney W. Grimes 	int	:32;		/* for compat with trap frame - trapno */
855b81b6b3SRodney W. Grimes 	int	:32;		/* for compat with trap frame - err */
865b81b6b3SRodney W. Grimes 	/* below portion defined in 386 hardware */
875b81b6b3SRodney W. Grimes 	int	if_eip;
885b81b6b3SRodney W. Grimes 	int	if_cs;
895b81b6b3SRodney W. Grimes 	int	if_eflags;
905b81b6b3SRodney W. Grimes 	/* below only when transitting rings (e.g. user to kernel) */
915b81b6b3SRodney W. Grimes 	int	if_esp;
925b81b6b3SRodney W. Grimes 	int	if_ss;
935b81b6b3SRodney W. Grimes };
945b81b6b3SRodney W. Grimes 
955b81b6b3SRodney W. Grimes /*
965b81b6b3SRodney W. Grimes  * Call Gate/System Call Stack Frame
975b81b6b3SRodney W. Grimes  */
985b81b6b3SRodney W. Grimes 
995b81b6b3SRodney W. Grimes struct syscframe {
1005b81b6b3SRodney W. Grimes 	int	sf_edi;
1015b81b6b3SRodney W. Grimes 	int	sf_esi;
1025b81b6b3SRodney W. Grimes 	int	sf_ebp;
1035b81b6b3SRodney W. Grimes 	int	:32;		/* redundant save of isp */
1045b81b6b3SRodney W. Grimes 	int	sf_ebx;
1055b81b6b3SRodney W. Grimes 	int	sf_edx;
1065b81b6b3SRodney W. Grimes 	int	sf_ecx;
1075b81b6b3SRodney W. Grimes 	int	sf_eax;
1085b81b6b3SRodney W. Grimes 	int	sf_eflags;
1095b81b6b3SRodney W. Grimes 	/* below portion defined in 386 hardware */
1105b81b6b3SRodney W. Grimes /*	int	sf_args[N]; 	/* if call gate copy args enabled!*/
1115b81b6b3SRodney W. Grimes 	int	sf_eip;
1125b81b6b3SRodney W. Grimes 	int	sf_cs;
1135b81b6b3SRodney W. Grimes 	/* below only when transitting rings (e.g. user to kernel) */
1145b81b6b3SRodney W. Grimes 	int	sf_esp;
1155b81b6b3SRodney W. Grimes 	int	sf_ss;
1165b81b6b3SRodney W. Grimes };
117