frame.h revision 1.12 1 1.12 uwe /* $NetBSD: frame.h,v 1.12 2003/11/23 23:13:11 uwe Exp $ */
2 1.11 agc
3 1.11 agc /*-
4 1.11 agc * Copyright (c) 1990 The Regents of the University of California.
5 1.11 agc * All rights reserved.
6 1.11 agc *
7 1.11 agc * This code is derived from software contributed to Berkeley by
8 1.11 agc * William Jolitz.
9 1.11 agc *
10 1.11 agc * Redistribution and use in source and binary forms, with or without
11 1.11 agc * modification, are permitted provided that the following conditions
12 1.11 agc * are met:
13 1.11 agc * 1. Redistributions of source code must retain the above copyright
14 1.11 agc * notice, this list of conditions and the following disclaimer.
15 1.11 agc * 2. Redistributions in binary form must reproduce the above copyright
16 1.11 agc * notice, this list of conditions and the following disclaimer in the
17 1.11 agc * documentation and/or other materials provided with the distribution.
18 1.11 agc * 3. Neither the name of the University nor the names of its contributors
19 1.11 agc * may be used to endorse or promote products derived from this software
20 1.11 agc * without specific prior written permission.
21 1.11 agc *
22 1.11 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 1.11 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 1.11 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 1.11 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 1.11 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 1.11 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 1.11 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 1.11 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 1.11 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 1.11 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 1.11 agc * SUCH DAMAGE.
33 1.11 agc *
34 1.11 agc * @(#)frame.h 5.2 (Berkeley) 1/18/91
35 1.11 agc */
36 1.1 itojun
37 1.1 itojun /*-
38 1.4 uch * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
39 1.1 itojun * Copyright (c) 1995 Charles M. Hannum. All rights reserved.
40 1.1 itojun *
41 1.1 itojun * This code is derived from software contributed to Berkeley by
42 1.1 itojun * William Jolitz.
43 1.1 itojun *
44 1.1 itojun * Redistribution and use in source and binary forms, with or without
45 1.1 itojun * modification, are permitted provided that the following conditions
46 1.1 itojun * are met:
47 1.1 itojun * 1. Redistributions of source code must retain the above copyright
48 1.1 itojun * notice, this list of conditions and the following disclaimer.
49 1.1 itojun * 2. Redistributions in binary form must reproduce the above copyright
50 1.1 itojun * notice, this list of conditions and the following disclaimer in the
51 1.1 itojun * documentation and/or other materials provided with the distribution.
52 1.1 itojun * 3. All advertising materials mentioning features or use of this software
53 1.1 itojun * must display the following acknowledgement:
54 1.1 itojun * This product includes software developed by the University of
55 1.1 itojun * California, Berkeley and its contributors.
56 1.1 itojun * 4. Neither the name of the University nor the names of its contributors
57 1.1 itojun * may be used to endorse or promote products derived from this software
58 1.1 itojun * without specific prior written permission.
59 1.1 itojun *
60 1.1 itojun * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
61 1.1 itojun * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
62 1.1 itojun * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
63 1.1 itojun * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
64 1.1 itojun * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
65 1.1 itojun * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
66 1.1 itojun * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
67 1.1 itojun * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
68 1.1 itojun * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
69 1.1 itojun * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
70 1.1 itojun * SUCH DAMAGE.
71 1.1 itojun *
72 1.1 itojun * @(#)frame.h 5.2 (Berkeley) 1/18/91
73 1.1 itojun */
74 1.1 itojun
75 1.1 itojun #ifndef _SH3_FRAME_H_
76 1.7 uch #define _SH3_FRAME_H_
77 1.1 itojun
78 1.1 itojun #include <sys/signal.h>
79 1.10 thorpej #include <sys/sa.h>
80 1.1 itojun
81 1.1 itojun /*
82 1.5 uch * Exception Stack Frame
83 1.1 itojun */
84 1.1 itojun struct trapframe {
85 1.3 uch /* software member */
86 1.8 uch int tf_expevt;
87 1.2 tsubai int tf_ubc;
88 1.3 uch /* hardware registers */
89 1.1 itojun int tf_spc;
90 1.1 itojun int tf_ssr;
91 1.1 itojun int tf_macl;
92 1.1 itojun int tf_mach;
93 1.1 itojun int tf_pr;
94 1.1 itojun int tf_r13;
95 1.1 itojun int tf_r12;
96 1.1 itojun int tf_r11;
97 1.1 itojun int tf_r10;
98 1.1 itojun int tf_r9;
99 1.1 itojun int tf_r8;
100 1.1 itojun int tf_r7;
101 1.1 itojun int tf_r6;
102 1.1 itojun int tf_r5;
103 1.1 itojun int tf_r4;
104 1.1 itojun int tf_r3;
105 1.1 itojun int tf_r2;
106 1.1 itojun int tf_r1;
107 1.1 itojun int tf_r0;
108 1.1 itojun int tf_r15;
109 1.4 uch int tf_r14;
110 1.1 itojun };
111 1.1 itojun
112 1.1 itojun /*
113 1.1 itojun * Stack frame inside cpu_switch()
114 1.1 itojun */
115 1.1 itojun struct switchframe {
116 1.4 uch int sf_r15;
117 1.1 itojun int sf_r14;
118 1.1 itojun int sf_r13;
119 1.1 itojun int sf_r12;
120 1.1 itojun int sf_r11;
121 1.1 itojun int sf_r10;
122 1.1 itojun int sf_r9;
123 1.1 itojun int sf_r8;
124 1.1 itojun int sf_pr;
125 1.4 uch int sf_r6_bank;
126 1.6 uch int sf_sr;
127 1.8 uch int sf_r7_bank;
128 1.1 itojun };
129 1.1 itojun
130 1.1 itojun /*
131 1.12 uwe * Signal frame.
132 1.12 uwe *
133 1.12 uwe * NB: The order of sf_uc and sf_si is different from what other ports
134 1.12 uwe * use (siginfo at the top of the stack), because we want to avoid
135 1.12 uwe * wasting two instructions in __sigtramp_siginfo_2 to skip to the
136 1.12 uwe * ucontext. Not that this order really matters, but I think this
137 1.12 uwe * inconsistency deserves an explanation.
138 1.12 uwe */
139 1.12 uwe struct sigframe_siginfo {
140 1.12 uwe #if 0 /* in registers on entry to signal trampoline */
141 1.12 uwe int sf_signum; /* r4 - "signum" argument for handler */
142 1.12 uwe siginfo_t *sf_sip; /* r5 - "sip" argument for handler */
143 1.12 uwe ucontext_t *sf_ucp; /* r6 - "ucp" argument for handler */
144 1.12 uwe #endif
145 1.12 uwe ucontext_t sf_uc; /* actual saved ucontext */
146 1.12 uwe siginfo_t sf_si; /* actual saved siginfo */
147 1.12 uwe };
148 1.12 uwe
149 1.12 uwe #if defined(COMPAT_16) && defined(_KERNEL)
150 1.12 uwe /*
151 1.12 uwe * Old signal frame format.
152 1.1 itojun */
153 1.12 uwe struct sigframe_sigcontext {
154 1.12 uwe #if 0 /* in registers on entry to signal trampoline */
155 1.12 uwe int sf_signum; /* r4 - "signum" argument for handler */
156 1.12 uwe int sf_code; /* r5 - "code" argument for handler */
157 1.12 uwe struct sigcontext *sf_scp; /* r6 - "scp" argument for handler */
158 1.12 uwe #endif
159 1.12 uwe struct sigcontext sf_sc; /* actual saved context */
160 1.10 thorpej };
161 1.12 uwe #endif
162 1.10 thorpej
163 1.10 thorpej /*
164 1.10 thorpej * Scheduler activations upcall frame
165 1.10 thorpej */
166 1.10 thorpej struct saframe {
167 1.10 thorpej #if 0 /* in registers on entry to upcallcode */
168 1.10 thorpej int sa_type; /* r4 */
169 1.10 thorpej struct sa_t ** sa_sas; /* r5 */
170 1.10 thorpej int sa_events; /* r6 */
171 1.10 thorpej int sa_interrupted; /* r7 */
172 1.10 thorpej #endif
173 1.10 thorpej void * sa_arg;
174 1.1 itojun };
175 1.1 itojun
176 1.1 itojun #endif /* !_SH3_FRAME_H_ */
177