linux_machdep.h revision 1.6 1 1.6 christos /* $NetBSD: linux_machdep.h,v 1.6 2002/02/15 16:47:58 christos 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.6 christos #include <compat/linux/common/linux_signal.h>
43 1.6 christos
44 1.1 erh /*
45 1.1 erh * The Linux sigcontext, pretty much a standard alpha trapframe.
46 1.1 erh */
47 1.1 erh struct linux_sigcontext {
48 1.1 erh long sc_onstack;
49 1.1 erh long sc_mask;
50 1.1 erh long sc_pc;
51 1.1 erh long sc_ps;
52 1.1 erh long sc_regs[32];
53 1.1 erh long sc_ownedfp;
54 1.1 erh long sc_fpregs[32];
55 1.1 erh unsigned long sc_fpcr;
56 1.1 erh unsigned long sc_fp_control;
57 1.1 erh unsigned long sc_reserved1, sc_reserved2;
58 1.1 erh unsigned long sc_ssize;
59 1.1 erh char * sc_sbase;
60 1.1 erh unsigned long sc_traparg_a0;
61 1.1 erh unsigned long sc_traparg_a1;
62 1.1 erh unsigned long sc_traparg_a2;
63 1.1 erh unsigned long sc_fp_trap_pc;
64 1.1 erh unsigned long sc_fp_trigger_sum;
65 1.1 erh unsigned long sc_fp_trigger_inst;
66 1.1 erh };
67 1.1 erh
68 1.1 erh struct linux_ucontext {
69 1.1 erh u_long uc_flags;
70 1.1 erh struct linux_ucontext *uc_link;
71 1.1 erh linux_old_sigset_t uc_osf_sigmask;
72 1.1 erh linux_stack_t uc_stack;
73 1.1 erh struct linux_sigcontext uc_mcontext;
74 1.1 erh linux_sigset_t uc_sigmask;
75 1.1 erh };
76 1.1 erh
77 1.1 erh /*
78 1.1 erh * We make the stack look like Linux expects it when calling a signal
79 1.1 erh * handler, but use the BSD way of calling the handler and sigreturn().
80 1.1 erh */
81 1.1 erh
82 1.1 erh #define LINUX_INSN_MOV_R30_R16 0x47fe0410
83 1.1 erh #define LINUX_INSN_LDI_R0 0x201f0000
84 1.1 erh #define LINUX_INSN_CALLSYS 0x00000083
85 1.1 erh
86 1.1 erh struct linux_sigframe {
87 1.1 erh struct linux_sigcontext sf_sc;
88 1.1 erh unsigned long extramask[LINUX__NSIG_WORDS-1];
89 1.1 erh unsigned int retcode[3];
90 1.1 erh };
91 1.1 erh
92 1.1 erh struct linux_rt_sigframe {
93 1.1 erh struct linux_siginfo info;
94 1.1 erh struct linux_ucontext uc;
95 1.1 erh unsigned int retcode[3];
96 1.1 erh };
97 1.1 erh
98 1.1 erh #ifdef _KERNEL
99 1.1 erh __BEGIN_DECLS
100 1.1 erh void setup_linux_rt_sigframe __P((struct trapframe *, int, sigset_t *));
101 1.1 erh void setup_linux_sigframe __P((struct trapframe *, int, sigset_t *));
102 1.2 erh int linux_restore_sigcontext __P((struct proc *, struct linux_sigcontext,
103 1.2 erh sigset_t *));
104 1.5 mycroft void linux_syscall_intern __P((struct proc *));
105 1.1 erh __END_DECLS
106 1.1 erh #endif /* !_KERNEL */
107 1.1 erh
108 1.1 erh #endif /* _ALPHA_LINUX_MACHDEP_H */
109