frame.h revision 1.21 1 1.21 cl /* $NetBSD: frame.h,v 1.21 2003/09/22 14:18:37 cl Exp $ */
2 1.8 cgd
3 1.1 cgd /*
4 1.6 mycroft * Copyright (c) 1982, 1990, 1993
5 1.6 mycroft * The Regents of the University of California. All rights reserved.
6 1.20 agc *
7 1.20 agc * This code is derived from software contributed to Berkeley by
8 1.20 agc * the Systems Programming Group of the University of Utah Computer
9 1.20 agc * Science Department.
10 1.20 agc *
11 1.20 agc * Redistribution and use in source and binary forms, with or without
12 1.20 agc * modification, are permitted provided that the following conditions
13 1.20 agc * are met:
14 1.20 agc * 1. Redistributions of source code must retain the above copyright
15 1.20 agc * notice, this list of conditions and the following disclaimer.
16 1.20 agc * 2. Redistributions in binary form must reproduce the above copyright
17 1.20 agc * notice, this list of conditions and the following disclaimer in the
18 1.20 agc * documentation and/or other materials provided with the distribution.
19 1.20 agc * 3. Neither the name of the University nor the names of its contributors
20 1.20 agc * may be used to endorse or promote products derived from this software
21 1.20 agc * without specific prior written permission.
22 1.20 agc *
23 1.20 agc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 1.20 agc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 1.20 agc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 1.20 agc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 1.20 agc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 1.20 agc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 1.20 agc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 1.20 agc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 1.20 agc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 1.20 agc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33 1.20 agc * SUCH DAMAGE.
34 1.20 agc *
35 1.20 agc * from: Utah $Hdr: frame.h 1.8 92/12/20$
36 1.20 agc *
37 1.20 agc * @(#)frame.h 8.1 (Berkeley) 6/10/93
38 1.20 agc */
39 1.20 agc /*
40 1.20 agc * Copyright (c) 1988 University of Utah.
41 1.1 cgd *
42 1.1 cgd * This code is derived from software contributed to Berkeley by
43 1.1 cgd * the Systems Programming Group of the University of Utah Computer
44 1.1 cgd * Science Department.
45 1.1 cgd *
46 1.1 cgd * Redistribution and use in source and binary forms, with or without
47 1.1 cgd * modification, are permitted provided that the following conditions
48 1.1 cgd * are met:
49 1.1 cgd * 1. Redistributions of source code must retain the above copyright
50 1.1 cgd * notice, this list of conditions and the following disclaimer.
51 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
52 1.1 cgd * notice, this list of conditions and the following disclaimer in the
53 1.1 cgd * documentation and/or other materials provided with the distribution.
54 1.1 cgd * 3. All advertising materials mentioning features or use of this software
55 1.1 cgd * must display the following acknowledgement:
56 1.1 cgd * This product includes software developed by the University of
57 1.1 cgd * California, Berkeley and its contributors.
58 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
59 1.1 cgd * may be used to endorse or promote products derived from this software
60 1.1 cgd * without specific prior written permission.
61 1.1 cgd *
62 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
63 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
64 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
65 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
66 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
67 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
68 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
69 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
70 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
71 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
72 1.1 cgd * SUCH DAMAGE.
73 1.1 cgd *
74 1.6 mycroft * from: Utah $Hdr: frame.h 1.8 92/12/20$
75 1.6 mycroft *
76 1.8 cgd * @(#)frame.h 8.1 (Berkeley) 6/10/93
77 1.1 cgd */
78 1.9 chopps
79 1.13 gwr #ifndef _M68K_FRAME_H_
80 1.13 gwr #define _M68K_FRAME_H_
81 1.13 gwr
82 1.21 cl #include <m68k/cpuframe.h>
83 1.21 cl #include <m68k/signal.h>
84 1.1 cgd
85 1.21 cl #if defined(COMPAT_16) || !defined(_KERNEL)
86 1.11 is /*
87 1.21 cl * Stack frame layout when delivering a signal.
88 1.11 is */
89 1.21 cl struct sigframe_sigcontext {
90 1.21 cl int sf_ra; /* handler return address */
91 1.21 cl int sf_signum; /* signal number for handler */
92 1.21 cl int sf_code; /* additional info for handler */
93 1.21 cl struct sigcontext *sf_scp; /* context pointer for handler */
94 1.21 cl struct sigcontext sf_sc; /* actual context */
95 1.21 cl struct sigstate sf_state; /* state of the hardware */
96 1.1 cgd };
97 1.21 cl #endif
98 1.1 cgd
99 1.21 cl struct sigframe_siginfo {
100 1.21 cl int sf_ra; /* return address for handler */
101 1.21 cl int sf_signum; /* "signum" argument for handler */
102 1.21 cl siginfo_t *sf_sip; /* "sip" argument for handler */
103 1.21 cl ucontext_t *sf_ucp; /* "ucp" argument for handler */
104 1.21 cl siginfo_t sf_si; /* actual saved siginfo */
105 1.21 cl ucontext_t sf_uc; /* actual saved ucontext */
106 1.11 is };
107 1.16 kleink
108 1.16 kleink #if defined(_KERNEL)
109 1.16 kleink /*
110 1.16 kleink * Utility function to relocate the initial frame, make room to restore an
111 1.16 kleink * exception frame and reenter the syscall.
112 1.16 kleink */
113 1.16 kleink void reenter_syscall __P((struct frame *, int)) __attribute__((__noreturn__));
114 1.19 thorpej
115 1.19 thorpej /*
116 1.19 thorpej * Create an FPU "idle" frame for use by cpu_setmcontext()
117 1.19 thorpej */
118 1.19 thorpej extern void m68k_make_fpu_idle_frame(void);
119 1.19 thorpej extern struct fpframe m68k_cached_fpu_idle_frame;
120 1.21 cl
121 1.21 cl void *getframe(struct lwp *, int, int *);
122 1.21 cl void buildcontext(struct lwp *, void *, void *);
123 1.21 cl #ifdef COMPAT_16
124 1.21 cl void sendsig_sigcontext(ksiginfo_t *, sigset_t *);
125 1.21 cl #endif
126 1.21 cl
127 1.19 thorpej #endif /* _KERNEL */
128 1.13 gwr
129 1.13 gwr #endif /* _M68K_FRAME_H_ */
130