linux_machdep.h revision 1.10 1 1.10 chs /* $NetBSD: linux_machdep.h,v 1.10 2005/11/11 23:22:08 chs Exp $ */
2 1.1 erh
3 1.1 erh /*-
4 1.4 mycroft * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
5 1.1 erh * All rights reserved.
6 1.1 erh *
7 1.1 erh * This code is derived from software contributed to The NetBSD Foundation
8 1.1 erh * by Eric Haszlakiewicz.
9 1.1 erh *
10 1.1 erh * Redistribution and use in source and binary forms, with or without
11 1.1 erh * modification, are permitted provided that the following conditions
12 1.1 erh * are met:
13 1.1 erh * 1. Redistributions of source code must retain the above copyright
14 1.1 erh * notice, this list of conditions and the following disclaimer.
15 1.1 erh * 2. Redistributions in binary form must reproduce the above copyright
16 1.1 erh * notice, this list of conditions and the following disclaimer in the
17 1.1 erh * documentation and/or other materials provided with the distribution.
18 1.1 erh * 3. All advertising materials mentioning features or use of this software
19 1.1 erh * must display the following acknowledgement:
20 1.1 erh * This product includes software developed by the NetBSD
21 1.1 erh * Foundation, Inc. and its contributors.
22 1.1 erh * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.1 erh * contributors may be used to endorse or promote products derived
24 1.1 erh * from this software without specific prior written permission.
25 1.1 erh *
26 1.1 erh * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.1 erh * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.1 erh * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.1 erh * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.1 erh * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.1 erh * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.1 erh * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.1 erh * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.1 erh * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.1 erh * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.1 erh * POSSIBILITY OF SUCH DAMAGE.
37 1.1 erh */
38 1.1 erh
39 1.1 erh #ifndef _ALPHA_LINUX_MACHDEP_H
40 1.1 erh #define _ALPHA_LINUX_MACHDEP_H
41 1.1 erh
42 1.10 chs #include <compat/linux/common/linux_types.h>
43 1.6 christos #include <compat/linux/common/linux_signal.h>
44 1.10 chs #include <compat/linux/common/linux_siginfo.h>
45 1.6 christos
46 1.1 erh /*
47 1.1 erh * The Linux sigcontext, pretty much a standard alpha trapframe.
48 1.1 erh */
49 1.1 erh struct linux_sigcontext {
50 1.1 erh long sc_onstack;
51 1.1 erh long sc_mask;
52 1.1 erh long sc_pc;
53 1.1 erh long sc_ps;
54 1.1 erh long sc_regs[32];
55 1.1 erh long sc_ownedfp;
56 1.1 erh long sc_fpregs[32];
57 1.1 erh unsigned long sc_fpcr;
58 1.1 erh unsigned long sc_fp_control;
59 1.1 erh unsigned long sc_reserved1, sc_reserved2;
60 1.1 erh unsigned long sc_ssize;
61 1.1 erh char * sc_sbase;
62 1.1 erh unsigned long sc_traparg_a0;
63 1.1 erh unsigned long sc_traparg_a1;
64 1.1 erh unsigned long sc_traparg_a2;
65 1.1 erh unsigned long sc_fp_trap_pc;
66 1.1 erh unsigned long sc_fp_trigger_sum;
67 1.1 erh unsigned long sc_fp_trigger_inst;
68 1.1 erh };
69 1.1 erh
70 1.1 erh struct linux_ucontext {
71 1.1 erh u_long uc_flags;
72 1.1 erh struct linux_ucontext *uc_link;
73 1.1 erh linux_old_sigset_t uc_osf_sigmask;
74 1.1 erh linux_stack_t uc_stack;
75 1.1 erh struct linux_sigcontext uc_mcontext;
76 1.1 erh linux_sigset_t uc_sigmask;
77 1.1 erh };
78 1.1 erh
79 1.1 erh /*
80 1.1 erh * We make the stack look like Linux expects it when calling a signal
81 1.1 erh * handler, but use the BSD way of calling the handler and sigreturn().
82 1.1 erh */
83 1.1 erh
84 1.1 erh #define LINUX_INSN_MOV_R30_R16 0x47fe0410
85 1.1 erh #define LINUX_INSN_LDI_R0 0x201f0000
86 1.1 erh #define LINUX_INSN_CALLSYS 0x00000083
87 1.1 erh
88 1.1 erh struct linux_sigframe {
89 1.1 erh struct linux_sigcontext sf_sc;
90 1.1 erh unsigned long extramask[LINUX__NSIG_WORDS-1];
91 1.1 erh unsigned int retcode[3];
92 1.1 erh };
93 1.1 erh
94 1.1 erh struct linux_rt_sigframe {
95 1.1 erh struct linux_siginfo info;
96 1.1 erh struct linux_ucontext uc;
97 1.1 erh unsigned int retcode[3];
98 1.1 erh };
99 1.1 erh
100 1.1 erh #ifdef _KERNEL
101 1.1 erh __BEGIN_DECLS
102 1.9 matt void setup_linux_rt_sigframe(struct trapframe *, int, const sigset_t *);
103 1.9 matt void setup_linux_sigframe(struct trapframe *, int, const sigset_t *);
104 1.9 matt int linux_restore_sigcontext(struct lwp *, struct linux_sigcontext,
105 1.9 matt sigset_t *);
106 1.9 matt void linux_syscall_intern(struct proc *);
107 1.1 erh __END_DECLS
108 1.1 erh #endif /* !_KERNEL */
109 1.1 erh
110 1.1 erh #endif /* _ALPHA_LINUX_MACHDEP_H */
111