frame.h revision 21673
1139804Simp/*- 23332Sphk * Copyright (c) 1990 The Regents of the University of California. 33332Sphk * All rights reserved. 493149Sphk * 53332Sphk * This code is derived from software contributed to Berkeley by 63332Sphk * William Jolitz. 73332Sphk * 8139804Simp * Redistribution and use in source and binary forms, with or without 9139804Simp * modification, are permitted provided that the following conditions 10139804Simp * are met: 113332Sphk * 1. Redistributions of source code must retain the above copyright 123784Sphk * notice, this list of conditions and the following disclaimer. 133332Sphk * 2. Redistributions in binary form must reproduce the above copyright 143332Sphk * notice, this list of conditions and the following disclaimer in the 153332Sphk * documentation and/or other materials provided with the distribution. 163332Sphk * 3. All advertising materials mentioning features or use of this software 173332Sphk * must display the following acknowledgement: 183332Sphk * This product includes software developed by the University of 193332Sphk * California, Berkeley and its contributors. 203332Sphk * 4. Neither the name of the University nor the names of its contributors 21249583Sgabor * may be used to endorse or promote products derived from this software 223332Sphk * without specific prior written permission. 233332Sphk * 24116182Sobrien * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25116182Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26116182Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 273784Sphk * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 283332Sphk * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 293332Sphk * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 303332Sphk * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 313332Sphk * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 3276166Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 333507Scsgr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 3476166Smarkm * SUCH DAMAGE. 3515494Sbde * 36220373Strasz * from: @(#)frame.h 5.2 (Berkeley) 1/18/91 373507Scsgr * $FreeBSD: head/sys/amd64/include/frame.h 21673 1997-01-14 07:20:47Z jkh $ 383332Sphk */ 393507Scsgr 4015494Sbde#ifndef _MACHINE_FRAME_H_ 413784Sphk#define _MACHINE_FRAME_H_ 1 423332Sphk 433332Sphk#include <sys/signal.h> 4412662Sdg 4512662Sdg/* 4612662Sdg * System stack frames. 473332Sphk */ 4812662Sdg 493332Sphk/* 503784Sphk * Exception/Trap Stack Frame 513784Sphk */ 523784Sphk 533784Sphkstruct trapframe { 5448079Shoek int tf_es; 553784Sphk int tf_ds; 563784Sphk int tf_edi; 573784Sphk int tf_esi; 583784Sphk int tf_ebp; 593784Sphk int tf_isp; 603784Sphk int tf_ebx; 613784Sphk int tf_edx; 623784Sphk int tf_ecx; 633784Sphk int tf_eax; 6492723Salfred int tf_trapno; 6592723Salfred /* below portion defined in 386 hardware */ 6692723Salfred int tf_err; 6792723Salfred int tf_eip; 683784Sphk int tf_cs; 6912568Sbde int tf_eflags; 7012130Sdg /* below only when crossing rings (e.g. user to kernel) */ 7112130Sdg int tf_esp; 723332Sphk int tf_ss; 73231885Skib}; 7417974Sbde 753784Sphk/* Interrupt stack frame */ 763784Sphk 7717386Sphkstruct intrframe { 783332Sphk int if_vec; 793348Sphk int if_ppl; 803784Sphk int if_es; 813784Sphk int if_ds; 823784Sphk int if_edi; 833784Sphk int if_esi; 843784Sphk int if_ebp; 853784Sphk int :32; 863784Sphk int if_ebx; 873784Sphk int if_edx; 883332Sphk int if_ecx; 893784Sphk int if_eax; 903784Sphk int :32; /* for compat with trap frame - trapno */ 913784Sphk int :32; /* for compat with trap frame - err */ 923348Sphk /* below portion defined in 386 hardware */ 933784Sphk int if_eip; 943784Sphk int if_cs; 953332Sphk int if_eflags; 963348Sphk /* below only when crossing rings (e.g. user to kernel) */ 973784Sphk int if_esp; 983784Sphk int if_ss; 993348Sphk}; 1003784Sphk 1013784Sphk/* frame of clock (same as interrupt frame) */ 1023784Sphk 1033784Sphkstruct clockframe { 1043784Sphk int cf_vec; 1053332Sphk int cf_ppl; 10612130Sdg int cf_es; 1073784Sphk int cf_ds; 1083353Sphk int cf_edi; 1093784Sphk int cf_esi; 1103784Sphk int cf_ebp; 1113784Sphk int :32; 1123784Sphk int cf_ebx; 1133348Sphk int cf_edx; 1143784Sphk int cf_ecx; 1153784Sphk int cf_eax; 1163784Sphk int :32; /* for compat with trap frame - trapno */ 1173784Sphk int :32; /* for compat with trap frame - err */ 1183348Sphk /* below portion defined in 386 hardware */ 11917386Sphk int cf_eip; 1203332Sphk int cf_cs; 1213784Sphk int cf_eflags; 1223348Sphk /* below only when crossing rings (e.g. user to kernel) */ 12348079Shoek int cf_esp; 12448079Shoek int cf_ss; 12548079Shoek}; 12648079Shoek 12748079Shoek/* 12848079Shoek * Signal frame 12948079Shoek */ 13017386Sphkstruct sigframe { 13117386Sphk int sf_signum; 13217386Sphk int sf_code; 13317386Sphk struct sigcontext *sf_scp; 13417386Sphk char *sf_addr; 13517386Sphk sig_t sf_handler; 13617386Sphk struct sigcontext sf_sc; 13717386Sphk}; 13817386Sphk 139231885Skibint kdb_trap __P((int, int, struct trapframe *)); 140231885Skibextern int (*pmath_emulate) __P((struct trapframe *)); 141231885Skib 1423784Sphk#endif /* _MACHINE_FRAME_H_ */ 143231885Skib