1 /* $NetBSD: frame.h,v 1.7 2005/12/11 12:16:16 christos Exp $ */
4 * Copyright (c) 1994, 1995 Carnegie-Mellon University.
7 * Author: Chris G. Demetriou
9 * Permission to use, copy, modify and distribute this software and
10 * its documentation is hereby granted, provided that both the copyright
11 * notice and this permission notice appear in all copies of the
12 * software, derivative works or modified versions, and any portions
13 * thereof, and that both notices appear in supporting documentation.
15 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
16 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
17 * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
19 * Carnegie Mellon requests users of this software to return to
21 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
22 * School of Computer Science
23 * Carnegie Mellon University
24 * Pittsburgh PA 15213-3890
26 * any improvements or extensions that they make and grant Carnegie the
27 * rights to redistribute these changes.
30 #ifndef _ALPHA_FRAME_H_
31 #define _ALPHA_FRAME_H_
33 #include <machine/alpha_cpu.h>
34 #include <sys/signal.h>
37 * Software trap, exception, and syscall frame.
39 * Includes "hardware" (PALcode) frame.
41 * PALcode puts ALPHA_HWFRAME_* fields on stack. We have to add
42 * all of the general-purpose registers except for zero, for sp
43 * (which is automatically saved in the PCB's USP field for entries
44 * from user mode, and which is implicitly saved and restored by the
45 * calling conventions for entries from kernel mode), and (on traps
46 * and exceptions) for a0, a1, and a2 (which are saved by PALcode).
49 /* Quadword offsets of the registers to be saved. */
78 #define FRAME_SW_SIZE (FRAME_SP + 1)
79 #define FRAME_HW_OFFSET FRAME_SW_SIZE
81 #define FRAME_PS (FRAME_HW_OFFSET + ALPHA_HWFRAME_PS)
82 #define FRAME_PC (FRAME_HW_OFFSET + ALPHA_HWFRAME_PC)
83 #define FRAME_GP (FRAME_HW_OFFSET + ALPHA_HWFRAME_GP)
84 #define FRAME_A0 (FRAME_HW_OFFSET + ALPHA_HWFRAME_A0)
85 #define FRAME_A1 (FRAME_HW_OFFSET + ALPHA_HWFRAME_A1)
86 #define FRAME_A2 (FRAME_HW_OFFSET + ALPHA_HWFRAME_A2)
88 #define FRAME_HW_SIZE ALPHA_HWFRAME_SIZE
89 #define FRAME_SIZE (FRAME_HW_OFFSET + FRAME_HW_SIZE)
92 unsigned long tf_regs
[FRAME_SIZE
]; /* See above */
95 #if (defined(COMPAT_16) || defined(COMPAT_OSF1)) && defined(_KERNEL)
96 struct sigframe_sigcontext
{
97 /* ra address of trampoline */
98 /* a0 signum for handler */
99 /* a1 code for handler */
100 /* a2 struct sigcontext for handler */
101 struct sigcontext sf_sc
; /* actual saved context */
105 struct sigframe_siginfo
{
106 /* ra address of trampoline */
107 /* a0 signal number arg for handler */
108 /* a1 siginfo_t * arg for handler */
109 /* a2 ucontext_t * arg for handler */
110 siginfo_t sf_si
; /* actual saved siginfo */
111 ucontext_t sf_uc
; /* actual saved ucontext */
115 void *getframe(const struct lwp
*, int, int *);
116 void buildcontext(struct lwp
*, const void *, const void *, const void *);
117 void sendsig_siginfo(const ksiginfo_t
*, const sigset_t
*);
118 #if defined(COMPAT_16) || defined(COMPAT_OSF1)
119 void sendsig_sigcontext(const ksiginfo_t
*, const sigset_t
*);
123 #endif /* _ALPHA_FRAME_H_ */