frame.h revision 1.12 1 1.12 mycroft /* $NetBSD: frame.h,v 1.12 1995/10/11 04:20:08 mycroft Exp $ */
2 1.10 cgd
3 1.1 cgd /*-
4 1.12 mycroft * Copyright (c) 1995 Charles M. Hannum. All rights reserved.
5 1.1 cgd * Copyright (c) 1990 The Regents of the University of California.
6 1.1 cgd * All rights reserved.
7 1.1 cgd *
8 1.1 cgd * This code is derived from software contributed to Berkeley by
9 1.1 cgd * William Jolitz.
10 1.1 cgd *
11 1.1 cgd * Redistribution and use in source and binary forms, with or without
12 1.1 cgd * modification, are permitted provided that the following conditions
13 1.1 cgd * are met:
14 1.1 cgd * 1. Redistributions of source code must retain the above copyright
15 1.1 cgd * notice, this list of conditions and the following disclaimer.
16 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
17 1.1 cgd * notice, this list of conditions and the following disclaimer in the
18 1.1 cgd * documentation and/or other materials provided with the distribution.
19 1.1 cgd * 3. All advertising materials mentioning features or use of this software
20 1.1 cgd * must display the following acknowledgement:
21 1.1 cgd * This product includes software developed by the University of
22 1.1 cgd * California, Berkeley and its contributors.
23 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
24 1.1 cgd * may be used to endorse or promote products derived from this software
25 1.1 cgd * without specific prior written permission.
26 1.1 cgd *
27 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 1.1 cgd * SUCH DAMAGE.
38 1.1 cgd *
39 1.10 cgd * @(#)frame.h 5.2 (Berkeley) 1/18/91
40 1.1 cgd */
41 1.1 cgd
42 1.6 brezak #include <sys/signal.h>
43 1.6 brezak
44 1.1 cgd /*
45 1.1 cgd * System stack frames.
46 1.1 cgd */
47 1.1 cgd
48 1.1 cgd /*
49 1.1 cgd * Exception/Trap Stack Frame
50 1.1 cgd */
51 1.1 cgd struct trapframe {
52 1.1 cgd int tf_es;
53 1.1 cgd int tf_ds;
54 1.1 cgd int tf_edi;
55 1.1 cgd int tf_esi;
56 1.1 cgd int tf_ebp;
57 1.1 cgd int tf_ebx;
58 1.1 cgd int tf_edx;
59 1.1 cgd int tf_ecx;
60 1.1 cgd int tf_eax;
61 1.1 cgd int tf_trapno;
62 1.1 cgd /* below portion defined in 386 hardware */
63 1.1 cgd int tf_err;
64 1.1 cgd int tf_eip;
65 1.1 cgd int tf_cs;
66 1.1 cgd int tf_eflags;
67 1.11 mycroft /* below used when transitting rings (e.g. user to kernel) */
68 1.1 cgd int tf_esp;
69 1.1 cgd int tf_ss;
70 1.11 mycroft /* below used when switching out of VM86 mode */
71 1.11 mycroft int tf_vm86_es;
72 1.11 mycroft int tf_vm86_ds;
73 1.11 mycroft int tf_vm86_fs;
74 1.11 mycroft int tf_vm86_gs;
75 1.1 cgd };
76 1.1 cgd
77 1.12 mycroft /*
78 1.12 mycroft * Interrupt stack frame
79 1.12 mycroft */
80 1.1 cgd struct intrframe {
81 1.1 cgd int if_ppl;
82 1.1 cgd int if_es;
83 1.1 cgd int if_ds;
84 1.1 cgd int if_edi;
85 1.1 cgd int if_esi;
86 1.1 cgd int if_ebp;
87 1.1 cgd int if_ebx;
88 1.1 cgd int if_edx;
89 1.1 cgd int if_ecx;
90 1.1 cgd int if_eax;
91 1.1 cgd int :32; /* for compat with trap frame - trapno */
92 1.1 cgd int :32; /* for compat with trap frame - err */
93 1.1 cgd /* below portion defined in 386 hardware */
94 1.1 cgd int if_eip;
95 1.1 cgd int if_cs;
96 1.1 cgd int if_eflags;
97 1.1 cgd /* below only when transitting rings (e.g. user to kernel) */
98 1.1 cgd int if_esp;
99 1.1 cgd int if_ss;
100 1.12 mycroft };
101 1.12 mycroft
102 1.12 mycroft /*
103 1.12 mycroft * Stack frame inside cpu_switch()
104 1.12 mycroft */
105 1.12 mycroft struct switchframe {
106 1.12 mycroft int sf_ppl;
107 1.12 mycroft int sf_edi;
108 1.12 mycroft int sf_esi;
109 1.12 mycroft int sf_ebx;
110 1.12 mycroft int sf_eip;
111 1.1 cgd };
112 1.5 brezak
113 1.5 brezak /*
114 1.5 brezak * Signal frame
115 1.5 brezak */
116 1.5 brezak struct sigframe {
117 1.5 brezak int sf_signum;
118 1.5 brezak int sf_code;
119 1.5 brezak struct sigcontext *sf_scp;
120 1.5 brezak sig_t sf_handler;
121 1.5 brezak struct sigcontext sf_sc;
122 1.7 mycroft };
123