linux_machdep.h revision 1.2.6.4 1 1.2.6.4 nathanw /* $NetBSD: linux_machdep.h,v 1.2.6.4 2001/10/08 20:10:50 nathanw Exp $ */
2 1.2.6.2 nathanw
3 1.2.6.2 nathanw /*-
4 1.2.6.2 nathanw * Copyright (c) 1995, 2000, 2001 The NetBSD Foundation, Inc.
5 1.2.6.2 nathanw * All rights reserved.
6 1.2.6.2 nathanw *
7 1.2.6.2 nathanw * This code is derived from software contributed to The NetBSD Foundation
8 1.2.6.2 nathanw * by Frank van der Linden and Emmanuel Dreyfus.
9 1.2.6.2 nathanw *
10 1.2.6.2 nathanw * Redistribution and use in source and binary forms, with or without
11 1.2.6.2 nathanw * modification, are permitted provided that the following conditions
12 1.2.6.2 nathanw * are met:
13 1.2.6.2 nathanw * 1. Redistributions of source code must retain the above copyright
14 1.2.6.2 nathanw * notice, this list of conditions and the following disclaimer.
15 1.2.6.2 nathanw * 2. Redistributions in binary form must reproduce the above copyright
16 1.2.6.2 nathanw * notice, this list of conditions and the following disclaimer in the
17 1.2.6.2 nathanw * documentation and/or other materials provided with the distribution.
18 1.2.6.2 nathanw * 3. All advertising materials mentioning features or use of this software
19 1.2.6.2 nathanw * must display the following acknowledgement:
20 1.2.6.2 nathanw * This product includes software developed by the NetBSD
21 1.2.6.2 nathanw * Foundation, Inc. and its contributors.
22 1.2.6.2 nathanw * 4. Neither the name of The NetBSD Foundation nor the names of its
23 1.2.6.2 nathanw * contributors may be used to endorse or promote products derived
24 1.2.6.2 nathanw * from this software without specific prior written permission.
25 1.2.6.2 nathanw *
26 1.2.6.2 nathanw * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
27 1.2.6.2 nathanw * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
28 1.2.6.2 nathanw * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 1.2.6.2 nathanw * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
30 1.2.6.2 nathanw * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
31 1.2.6.2 nathanw * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
32 1.2.6.2 nathanw * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
33 1.2.6.2 nathanw * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
34 1.2.6.2 nathanw * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
35 1.2.6.2 nathanw * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
36 1.2.6.2 nathanw * POSSIBILITY OF SUCH DAMAGE.
37 1.2.6.2 nathanw */
38 1.2.6.2 nathanw
39 1.2.6.2 nathanw #ifndef _MIPS_LINUX_MACHDEP_H
40 1.2.6.2 nathanw #define _MIPS_LINUX_MACHDEP_H
41 1.2.6.2 nathanw
42 1.2.6.2 nathanw #include <compat/linux/common/linux_signal.h>
43 1.2.6.2 nathanw
44 1.2.6.2 nathanw #if defined(ELFSIZE) && (ELFSIZE == 64)
45 1.2.6.3 nathanw /*
46 1.2.6.3 nathanw * From Linux's include/asm-mips64/sigcontext.h
47 1.2.6.3 nathanw */
48 1.2.6.2 nathanw struct linux_sigcontext {
49 1.2.6.2 nathanw unsigned long long sc_regs[32];
50 1.2.6.2 nathanw unsigned long long sc_fpregs[32];
51 1.2.6.2 nathanw unsigned long long sc_mdhi;
52 1.2.6.2 nathanw unsigned long long sc_mdlo;
53 1.2.6.2 nathanw unsigned long long sc_pc;
54 1.2.6.2 nathanw unsigned int sc_status;
55 1.2.6.2 nathanw unsigned int sc_ownedfp;
56 1.2.6.2 nathanw unsigned int sc_fpc_csr;
57 1.2.6.2 nathanw unsigned int sc_fpc_eir;
58 1.2.6.2 nathanw unsigned int sc_cause;
59 1.2.6.2 nathanw unsigned int sc_badvaddr;
60 1.2.6.2 nathanw }
61 1.2.6.2 nathanw #else
62 1.2.6.2 nathanw /*
63 1.2.6.3 nathanw * From Linux's include/asm-mips/sigcontext.h
64 1.2.6.2 nathanw */
65 1.2.6.2 nathanw struct linux_sigcontext {
66 1.2.6.2 nathanw unsigned int lsc_regmask; /* Unused */
67 1.2.6.2 nathanw unsigned int lsc_status;
68 1.2.6.2 nathanw unsigned long long lsc_pc;
69 1.2.6.2 nathanw unsigned long long lsc_regs[32];
70 1.2.6.2 nathanw unsigned long long lsc_fpregs[32]; /* Unused */
71 1.2.6.2 nathanw unsigned int lsc_ownedfp;
72 1.2.6.2 nathanw unsigned int lsc_fpc_csr; /* Unused */
73 1.2.6.2 nathanw unsigned int lsc_fpc_eir; /* Unused */
74 1.2.6.2 nathanw unsigned int lsc_ssflags; /* Unused */
75 1.2.6.2 nathanw unsigned long long lsc_mdhi;
76 1.2.6.2 nathanw unsigned long long lsc_mdlo;
77 1.2.6.2 nathanw unsigned int lsc_cause; /* Unused */
78 1.2.6.2 nathanw unsigned int lsc_badvaddr; /* Unused */
79 1.2.6.2 nathanw unsigned long lsc_sigset[4]; /* kernel's sigset_t */
80 1.2.6.2 nathanw };
81 1.2.6.2 nathanw #endif
82 1.2.6.2 nathanw
83 1.2.6.2 nathanw /*
84 1.2.6.2 nathanw * From Linux's include/asm-mips/elf.h
85 1.2.6.2 nathanw */
86 1.2.6.2 nathanw #define LINUX_ELF_NGREG 45
87 1.2.6.2 nathanw #define LINUX_ELF_NFPREG 33
88 1.2.6.2 nathanw typedef unsigned long linux_elf_greg_t;
89 1.2.6.2 nathanw typedef linux_elf_greg_t linux_elf_gregset_t[LINUX_ELF_NGREG];
90 1.2.6.2 nathanw
91 1.2.6.2 nathanw /*
92 1.2.6.2 nathanw * From Linux's arch/mips/kernel/signal.c
93 1.2.6.2 nathanw */
94 1.2.6.2 nathanw struct linux_sigframe {
95 1.2.6.2 nathanw unsigned int lsf_ass[4];
96 1.2.6.2 nathanw unsigned int lsf_code[2];
97 1.2.6.2 nathanw struct linux_sigcontext lsf_sc;
98 1.2.6.3 nathanw linux_sigset_t lsf_mask;
99 1.2.6.2 nathanw };
100 1.2.6.2 nathanw
101 1.2.6.2 nathanw /*
102 1.2.6.2 nathanw * From Linux's include/asm-mips/ucontext.h
103 1.2.6.2 nathanw */
104 1.2.6.2 nathanw struct linux_ucontext {
105 1.2.6.2 nathanw unsigned long luc_flags;
106 1.2.6.2 nathanw struct linux_ucontext *luc_link;
107 1.2.6.2 nathanw linux_stack_t luc_stack;
108 1.2.6.2 nathanw struct linux_sigcontext luc_mcontext;
109 1.2.6.2 nathanw linux_sigset_t luc_sigmask;
110 1.2.6.2 nathanw };
111 1.2.6.2 nathanw
112 1.2.6.2 nathanw /*
113 1.2.6.3 nathanw * From Linux's arch/mips/kernel/signal.c
114 1.2.6.2 nathanw */
115 1.2.6.2 nathanw struct linux_rt_sigframe
116 1.2.6.2 nathanw {
117 1.2.6.2 nathanw unsigned int lrs_ass[4];
118 1.2.6.2 nathanw unsigned int lrs_code[2];
119 1.2.6.2 nathanw struct linux_siginfo lrs_info;
120 1.2.6.2 nathanw struct linux_ucontext lrs_uc;
121 1.2.6.2 nathanw };
122 1.2.6.2 nathanw
123 1.2.6.4 nathanw /*
124 1.2.6.4 nathanw * From Linux's include/asm-mips/sysmips.h
125 1.2.6.4 nathanw */
126 1.2.6.4 nathanw #define LINUX_SETNAME 1 /* set hostname */
127 1.2.6.4 nathanw #define LINUX_FLUSH_CACHE 3 /* writeback and invalidate caches */
128 1.2.6.4 nathanw #define LINUX_MIPS_FIXADE 7 /* control address error fixing */
129 1.2.6.4 nathanw #define LINUX_MIPS_RDNVRAM 10 /* read NVRAM */
130 1.2.6.4 nathanw #define LINUX_MIPS_ATOMIC_SET 2001 /* atomically set variable */
131 1.2.6.4 nathanw
132 1.2.6.4 nathanw /*
133 1.2.6.4 nathanw * From Linux's include/linux/utsname.h
134 1.2.6.4 nathanw */
135 1.2.6.4 nathanw #define LINUX___NEW_UTS_LEN 64
136 1.2.6.4 nathanw
137 1.2.6.2 nathanw #ifdef _KERNEL
138 1.2.6.2 nathanw __BEGIN_DECLS
139 1.2.6.2 nathanw void linux_sendsig __P((sig_t, int, sigset_t *, u_long));
140 1.2.6.2 nathanw dev_t linux_fakedev __P((dev_t));
141 1.2.6.2 nathanw __END_DECLS
142 1.2.6.2 nathanw #endif /* _KERNEL */
143 1.2.6.2 nathanw
144 1.2.6.2 nathanw /*
145 1.2.6.2 nathanw * Major device numbers of VT device on both Linux and NetBSD. Used in
146 1.2.6.2 nathanw * ugly patch to fake device numbers.
147 1.2.6.2 nathanw *
148 1.2.6.2 nathanw * LINUX_CONS_MAJOR is from Linux's include/linux/major.h
149 1.2.6.2 nathanw */
150 1.2.6.2 nathanw #define LINUX_CONS_MAJOR 4
151 1.2.6.2 nathanw #define NETBSD_WSCONS_MAJOR 47 /* XXX */
152 1.2.6.2 nathanw
153 1.2.6.2 nathanw /*
154 1.2.6.2 nathanw * Linux ioctl calls for the keyboard.
155 1.2.6.2 nathanw *
156 1.2.6.2 nathanw * From Linux's include/linux/kd.h
157 1.2.6.2 nathanw */
158 1.2.6.2 nathanw #define LINUX_KDGKBMODE 0x4b44
159 1.2.6.2 nathanw #define LINUX_KDSKBMODE 0x4b45
160 1.2.6.2 nathanw #define LINUX_KDMKTONE 0x4b30
161 1.2.6.2 nathanw #define LINUX_KDSETMODE 0x4b3a
162 1.2.6.2 nathanw #define LINUX_KDENABIO 0x4b36
163 1.2.6.2 nathanw #define LINUX_KDDISABIO 0x4b37
164 1.2.6.2 nathanw #define LINUX_KDGETLED 0x4b31
165 1.2.6.2 nathanw #define LINUX_KDSETLED 0x4b32
166 1.2.6.2 nathanw #define LINUX_KDGKBTYPE 0x4B33
167 1.2.6.2 nathanw #define LINUX_KDGKBENT 0x4B46
168 1.2.6.2 nathanw
169 1.2.6.2 nathanw /*
170 1.2.6.2 nathanw * Mode for KDSKBMODE which we don't have (we just use plain mode for this)
171 1.2.6.2 nathanw *
172 1.2.6.2 nathanw * From Linux's include/linux/kd.h
173 1.2.6.2 nathanw */
174 1.2.6.2 nathanw #define LINUX_K_MEDIUMRAW 2
175 1.2.6.2 nathanw
176 1.2.6.2 nathanw /*
177 1.2.6.2 nathanw * VT ioctl calls in Linux (the ones that the pcvt emulation in
178 1.2.6.2 nathanw * wscons can handle)
179 1.2.6.2 nathanw *
180 1.2.6.2 nathanw * From Linux's include/linux/vt.h
181 1.2.6.2 nathanw */
182 1.2.6.2 nathanw #define LINUX_VT_OPENQRY 0x5600
183 1.2.6.2 nathanw #define LINUX_VT_GETMODE 0x5601
184 1.2.6.2 nathanw #define LINUX_VT_SETMODE 0x5602
185 1.2.6.2 nathanw #define LINUX_VT_GETSTATE 0x5603
186 1.2.6.2 nathanw #define LINUX_VT_RELDISP 0x5605
187 1.2.6.2 nathanw #define LINUX_VT_ACTIVATE 0x5606
188 1.2.6.2 nathanw #define LINUX_VT_WAITACTIVE 0x5607
189 1.2.6.2 nathanw #define LINUX_VT_DISALLOCATE 0x5608
190 1.2.6.2 nathanw
191 1.2.6.2 nathanw /*
192 1.2.6.2 nathanw * This range used by VMWare (XXX)
193 1.2.6.2 nathanw *
194 1.2.6.2 nathanw * From Linux's include/linux/vt.h
195 1.2.6.2 nathanw * XXX not needed for mips
196 1.2.6.2 nathanw */
197 1.2.6.2 nathanw #define LINUX_VMWARE_NONE 200
198 1.2.6.2 nathanw #define LINUX_VMWARE_LAST 237
199 1.2.6.2 nathanw
200 1.2.6.2 nathanw /*
201 1.2.6.2 nathanw * Range of ioctls to just pass on, so that LKMs (like VMWare) can
202 1.2.6.2 nathanw * handle them.
203 1.2.6.2 nathanw *
204 1.2.6.2 nathanw * From Linux's include/linux/vt.h
205 1.2.6.2 nathanw */
206 1.2.6.2 nathanw #define LINUX_IOCTL_MIN_PASS LINUX_VMWARE_NONE
207 1.2.6.2 nathanw #define LINUX_IOCTL_MAX_PASS (LINUX_VMWARE_LAST+8)
208 1.2.6.2 nathanw
209 1.2.6.2 nathanw #ifdef _KERNEL
210 1.2.6.2 nathanw __BEGIN_DECLS /* XXX from NetBSD/i386. Not arch dependent? */
211 1.2.6.2 nathanw void linux_syscall_intern __P((struct proc *));
212 1.2.6.2 nathanw __END_DECLS
213 1.2.6.2 nathanw #endif /* !_KERNEL */
214 1.2.6.2 nathanw
215 1.2.6.2 nathanw #endif /* _MIPS_LINUX_MACHDEP_H */
216