1 /* $NetBSD: linux_machdep.h,v 1.10 2005/11/11 23:22:08 chs Exp $ */
4 * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Eric Haszlakiewicz.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 #ifndef _ALPHA_LINUX_MACHDEP_H
33 #define _ALPHA_LINUX_MACHDEP_H
35 #include <compat/linux/common/linux_types.h>
36 #include <compat/linux/common/linux_signal.h>
37 #include <compat/linux/common/linux_siginfo.h>
40 * The Linux sigcontext, pretty much a standard alpha trapframe.
42 struct linux_sigcontext
{
50 unsigned long sc_fpcr
;
51 unsigned long sc_fp_control
;
52 unsigned long sc_reserved1
, sc_reserved2
;
53 unsigned long sc_ssize
;
55 unsigned long sc_traparg_a0
;
56 unsigned long sc_traparg_a1
;
57 unsigned long sc_traparg_a2
;
58 unsigned long sc_fp_trap_pc
;
59 unsigned long sc_fp_trigger_sum
;
60 unsigned long sc_fp_trigger_inst
;
63 struct linux_ucontext
{
65 struct linux_ucontext
*uc_link
;
66 linux_old_sigset_t uc_osf_sigmask
;
67 linux_stack_t uc_stack
;
68 struct linux_sigcontext uc_mcontext
;
69 linux_sigset_t uc_sigmask
;
73 * We make the stack look like Linux expects it when calling a signal
74 * handler, but use the BSD way of calling the handler and sigreturn().
77 #define LINUX_INSN_MOV_R30_R16 0x47fe0410
78 #define LINUX_INSN_LDI_R0 0x201f0000
79 #define LINUX_INSN_CALLSYS 0x00000083
81 struct linux_sigframe
{
82 struct linux_sigcontext sf_sc
;
83 unsigned long extramask
[LINUX__NSIG_WORDS
-1];
84 unsigned int retcode
[3];
87 struct linux_rt_sigframe
{
88 struct linux_siginfo info
;
89 struct linux_ucontext uc
;
90 unsigned int retcode
[3];
95 void setup_linux_rt_sigframe(struct trapframe
*, int, const sigset_t
*);
96 void setup_linux_sigframe(struct trapframe
*, int, const sigset_t
*);
97 int linux_restore_sigcontext(struct lwp
*, struct linux_sigcontext
,
99 void linux_syscall_intern(struct proc
*);
101 #endif /* !_KERNEL */
103 #endif /* _ALPHA_LINUX_MACHDEP_H */