ansify function definitionsdiff -r1.14 -r1.15 src/sys/compat/linux/arch/amd64/linux_exec_machdep.c
(cegger)
--- src/sys/compat/linux/arch/amd64/linux_exec_machdep.c 2008/11/20 09:26:06 1.14
+++ src/sys/compat/linux/arch/amd64/linux_exec_machdep.c 2009/03/15 15:55:51 1.15
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux_exec_machdep.c,v 1.14 2008/11/20 09:26:06 ad Exp $ */ | 1 | /* $NetBSD: linux_exec_machdep.c,v 1.15 2009/03/15 15:55:51 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved | 4 | * Copyright (c) 2005 Emmanuel Dreyfus, all rights reserved | |
5 | * | 5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | 6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions | 7 | * modification, are permitted provided that the following conditions | |
8 | * are met: | 8 | * are met: | |
9 | * 1. Redistributions of source code must retain the above copyright | 9 | * 1. Redistributions of source code must retain the above copyright | |
10 | * notice, this list of conditions and the following disclaimer. | 10 | * notice, this list of conditions and the following disclaimer. | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | 11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | 12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | 13 | * documentation and/or other materials provided with the distribution. | |
14 | * 3. All advertising materials mentioning features or use of this software | 14 | * 3. All advertising materials mentioning features or use of this software | |
@@ -22,27 +22,27 @@ | @@ -22,27 +22,27 @@ | |||
22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | 22 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | |
23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 23 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | 24 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS | |
25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 25 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 26 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 27 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 28 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 29 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 30 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
31 | * POSSIBILITY OF SUCH DAMAGE. | 31 | * POSSIBILITY OF SUCH DAMAGE. | |
32 | */ | 32 | */ | |
33 | 33 | |||
34 | #include <sys/cdefs.h> | 34 | #include <sys/cdefs.h> | |
35 | __KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.14 2008/11/20 09:26:06 ad Exp $"); | 35 | __KERNEL_RCSID(0, "$NetBSD: linux_exec_machdep.c,v 1.15 2009/03/15 15:55:51 cegger Exp $"); | |
36 | 36 | |||
37 | #ifdef __amd64__ | 37 | #ifdef __amd64__ | |
38 | #define ELFSIZE 64 | 38 | #define ELFSIZE 64 | |
39 | #endif | 39 | #endif | |
40 | 40 | |||
41 | #include <sys/param.h> | 41 | #include <sys/param.h> | |
42 | #include <sys/systm.h> | 42 | #include <sys/systm.h> | |
43 | #include <sys/kernel.h> | 43 | #include <sys/kernel.h> | |
44 | #include <sys/resource.h> | 44 | #include <sys/resource.h> | |
45 | #include <sys/proc.h> | 45 | #include <sys/proc.h> | |
46 | #include <sys/conf.h> | 46 | #include <sys/conf.h> | |
47 | #include <sys/malloc.h> | 47 | #include <sys/malloc.h> | |
48 | #include <sys/exec_elf.h> | 48 | #include <sys/exec_elf.h> | |
@@ -114,32 +114,28 @@ linux_exec_setup_stack(struct lwp *l, st | @@ -114,32 +114,28 @@ linux_exec_setup_stack(struct lwp *l, st | |||
114 | access_size), noaccess_size); | 114 | access_size), noaccess_size); | |
115 | if (noaccess_size > 0) { | 115 | if (noaccess_size > 0) { | |
116 | NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, noaccess_size, | 116 | NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, noaccess_size, | |
117 | noaccess_linear_min, NULLVP, 0, VM_PROT_NONE); | 117 | noaccess_linear_min, NULLVP, 0, VM_PROT_NONE); | |
118 | } | 118 | } | |
119 | KASSERT(access_size > 0); | 119 | KASSERT(access_size > 0); | |
120 | NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, access_size, | 120 | NEW_VMCMD(&epp->ep_vmcmds, vmcmd_map_zero, access_size, | |
121 | access_linear_min, NULLVP, 0, VM_PROT_READ | VM_PROT_WRITE); | 121 | access_linear_min, NULLVP, 0, VM_PROT_READ | VM_PROT_WRITE); | |
122 | 122 | |||
123 | return 0; | 123 | return 0; | |
124 | } | 124 | } | |
125 | 125 | |||
126 | int | 126 | int | |
127 | ELFNAME2(linux,copyargs)(l, pack, arginfo, stackp, argp) | 127 | ELFNAME2(linux,copyargs)(struct lwp *l, struct exec_package *pack, | |
128 | struct lwp *l; | 128 | struct ps_strings *arginfo, char **stackp, void *argp) | |
129 | struct exec_package *pack; | |||
130 | struct ps_strings *arginfo; | |||
131 | char **stackp; | |||
132 | void *argp; | |||
133 | { | 129 | { | |
134 | struct linux_extra_stack_data64 *esdp, esd; | 130 | struct linux_extra_stack_data64 *esdp, esd; | |
135 | struct elf_args *ap; | 131 | struct elf_args *ap; | |
136 | struct vattr *vap; | 132 | struct vattr *vap; | |
137 | Elf_Ehdr *eh; | 133 | Elf_Ehdr *eh; | |
138 | Elf_Phdr *ph; | 134 | Elf_Phdr *ph; | |
139 | u_long phsize; | 135 | u_long phsize; | |
140 | Elf_Addr phdr = 0; | 136 | Elf_Addr phdr = 0; | |
141 | int error; | 137 | int error; | |
142 | int i; | 138 | int i; | |
143 | 139 | |||
144 | if ((error = copyargs(l, pack, arginfo, stackp, argp)) != 0) | 140 | if ((error = copyargs(l, pack, arginfo, stackp, argp)) != 0) | |
145 | return error; | 141 | return error; |
--- src/sys/compat/linux/common/linux_exec.c 2009/03/14 21:04:18 1.111
+++ src/sys/compat/linux/common/linux_exec.c 2009/03/15 15:55:51 1.112
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux_exec.c,v 1.111 2009/03/14 21:04:18 dsl Exp $ */ | 1 | /* $NetBSD: linux_exec.c,v 1.112 2009/03/15 15:55:51 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1994, 1995, 1998, 2000, 2007, 2008 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Christos Zoulas, Frank van der Linden, Eric Haszlakiewicz and | 8 | * by Christos Zoulas, Frank van der Linden, Eric Haszlakiewicz and | |
9 | * Thor Lancelot Simon. | 9 | * Thor Lancelot Simon. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -21,27 +21,27 @@ | @@ -21,27 +21,27 @@ | |||
21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | 21 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 22 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | 23 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | |
24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | 24 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
30 | * POSSIBILITY OF SUCH DAMAGE. | 30 | * POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | #include <sys/cdefs.h> | 33 | #include <sys/cdefs.h> | |
34 | __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.111 2009/03/14 21:04:18 dsl Exp $"); | 34 | __KERNEL_RCSID(0, "$NetBSD: linux_exec.c,v 1.112 2009/03/15 15:55:51 cegger Exp $"); | |
35 | 35 | |||
36 | #include <sys/param.h> | 36 | #include <sys/param.h> | |
37 | #include <sys/systm.h> | 37 | #include <sys/systm.h> | |
38 | #include <sys/kernel.h> | 38 | #include <sys/kernel.h> | |
39 | #include <sys/proc.h> | 39 | #include <sys/proc.h> | |
40 | #include <sys/malloc.h> | 40 | #include <sys/malloc.h> | |
41 | #include <sys/namei.h> | 41 | #include <sys/namei.h> | |
42 | #include <sys/vnode.h> | 42 | #include <sys/vnode.h> | |
43 | #include <sys/mount.h> | 43 | #include <sys/mount.h> | |
44 | #include <sys/exec.h> | 44 | #include <sys/exec.h> | |
45 | #include <sys/exec_elf.h> | 45 | #include <sys/exec_elf.h> | |
46 | 46 | |||
47 | #include <sys/mman.h> | 47 | #include <sys/mman.h> | |
@@ -361,30 +361,27 @@ linux_nptl_proc_exit(struct proc *p) | @@ -361,30 +361,27 @@ linux_nptl_proc_exit(struct proc *p) | |||
361 | SCARG(&cup, op) = LINUX_FUTEX_WAKE; | 361 | SCARG(&cup, op) = LINUX_FUTEX_WAKE; | |
362 | SCARG(&cup, val) = 0x7fffffff; /* Awake everyone */ | 362 | SCARG(&cup, val) = 0x7fffffff; /* Awake everyone */ | |
363 | SCARG(&cup, timeout) = NULL; | 363 | SCARG(&cup, timeout) = NULL; | |
364 | SCARG(&cup, uaddr2) = NULL; | 364 | SCARG(&cup, uaddr2) = NULL; | |
365 | SCARG(&cup, val3) = 0; | 365 | SCARG(&cup, val3) = 0; | |
366 | if ((error = linux_sys_futex(curlwp, &cup, &retval)) != 0) | 366 | if ((error = linux_sys_futex(curlwp, &cup, &retval)) != 0) | |
367 | printf("%s: linux_sys_futex failed\n", __func__); | 367 | printf("%s: linux_sys_futex failed\n", __func__); | |
368 | } | 368 | } | |
369 | 369 | |||
370 | return; | 370 | return; | |
371 | } | 371 | } | |
372 | 372 | |||
373 | void | 373 | void | |
374 | linux_nptl_proc_fork(p, parent, luserret) | 374 | linux_nptl_proc_fork(struct proc *p, struct proc *parent, void (*luserret)(void)) | |
375 | struct proc *p; | |||
376 | struct proc *parent; | |||
377 | void (*luserret)(void); | |||
378 | { | 375 | { | |
379 | struct linux_emuldata *e = p->p_emuldata; | 376 | struct linux_emuldata *e = p->p_emuldata; | |
380 | 377 | |||
381 | /* LINUX_CLONE_CHILD_CLEARTID: clear TID in child's memory on exit() */ | 378 | /* LINUX_CLONE_CHILD_CLEARTID: clear TID in child's memory on exit() */ | |
382 | if (e->clone_flags & LINUX_CLONE_CHILD_CLEARTID) | 379 | if (e->clone_flags & LINUX_CLONE_CHILD_CLEARTID) | |
383 | e->clear_tid = e->child_tidptr; | 380 | e->clear_tid = e->child_tidptr; | |
384 | 381 | |||
385 | /* LINUX_CLONE_PARENT_SETTID: set child's TID in parent's memory */ | 382 | /* LINUX_CLONE_PARENT_SETTID: set child's TID in parent's memory */ | |
386 | if (e->clone_flags & LINUX_CLONE_PARENT_SETTID) { | 383 | if (e->clone_flags & LINUX_CLONE_PARENT_SETTID) { | |
387 | if (copyout_proc(parent, &p->p_pid, | 384 | if (copyout_proc(parent, &p->p_pid, | |
388 | e->parent_tidptr, sizeof(p->p_pid)) != 0) | 385 | e->parent_tidptr, sizeof(p->p_pid)) != 0) | |
389 | printf("%s: LINUX_CLONE_PARENT_SETTID " | 386 | printf("%s: LINUX_CLONE_PARENT_SETTID " | |
390 | "failed (e->parent_tidptr = %p, " | 387 | "failed (e->parent_tidptr = %p, " |
--- src/sys/compat/linux/common/linux_exec_elf32.c 2008/11/20 09:26:06 1.82
+++ src/sys/compat/linux/common/linux_exec_elf32.c 2009/03/15 15:55:51 1.83
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux_exec_elf32.c,v 1.82 2008/11/20 09:26:06 ad Exp $ */ | 1 | /* $NetBSD: linux_exec_elf32.c,v 1.83 2009/03/15 15:55:51 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1995, 1998, 2000, 2001 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Christos Zoulas, Frank van der Linden, Eric Haszlakiewicz and | 8 | * by Christos Zoulas, Frank van der Linden, Eric Haszlakiewicz and | |
9 | * Emmanuel Dreyfus. | 9 | * Emmanuel Dreyfus. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -25,27 +25,27 @@ | @@ -25,27 +25,27 @@ | |||
25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | 25 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | 26 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | 27 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | 28 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | 29 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
30 | * POSSIBILITY OF SUCH DAMAGE. | 30 | * POSSIBILITY OF SUCH DAMAGE. | |
31 | */ | 31 | */ | |
32 | 32 | |||
33 | /* | 33 | /* | |
34 | * based on exec_aout.c, sunos_exec.c and svr4_exec.c | 34 | * based on exec_aout.c, sunos_exec.c and svr4_exec.c | |
35 | */ | 35 | */ | |
36 | 36 | |||
37 | #include <sys/cdefs.h> | 37 | #include <sys/cdefs.h> | |
38 | __KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.82 2008/11/20 09:26:06 ad Exp $"); | 38 | __KERNEL_RCSID(0, "$NetBSD: linux_exec_elf32.c,v 1.83 2009/03/15 15:55:51 cegger Exp $"); | |
39 | 39 | |||
40 | #ifndef ELFSIZE | 40 | #ifndef ELFSIZE | |
41 | /* XXX should die */ | 41 | /* XXX should die */ | |
42 | #define ELFSIZE 32 | 42 | #define ELFSIZE 32 | |
43 | #endif | 43 | #endif | |
44 | 44 | |||
45 | #include <sys/param.h> | 45 | #include <sys/param.h> | |
46 | #include <sys/systm.h> | 46 | #include <sys/systm.h> | |
47 | #include <sys/kernel.h> | 47 | #include <sys/kernel.h> | |
48 | #include <sys/proc.h> | 48 | #include <sys/proc.h> | |
49 | #include <sys/malloc.h> | 49 | #include <sys/malloc.h> | |
50 | #include <sys/namei.h> | 50 | #include <sys/namei.h> | |
51 | #include <sys/vnode.h> | 51 | #include <sys/vnode.h> | |
@@ -211,30 +211,27 @@ ELFNAME2(linux,gcc_signature)(l, epp, eh | @@ -211,30 +211,27 @@ ELFNAME2(linux,gcc_signature)(l, epp, eh | |||
211 | error = ENOEXEC; | 211 | error = ENOEXEC; | |
212 | 212 | |||
213 | out: | 213 | out: | |
214 | free(sh, M_TEMP); | 214 | free(sh, M_TEMP); | |
215 | return (error); | 215 | return (error); | |
216 | } | 216 | } | |
217 | #endif | 217 | #endif | |
218 | 218 | |||
219 | #ifdef LINUX_DEBUGLINK_SIGNATURE | 219 | #ifdef LINUX_DEBUGLINK_SIGNATURE | |
220 | /* | 220 | /* | |
221 | * Look for a .gnu_debuglink, specific to x86_64 interpeter | 221 | * Look for a .gnu_debuglink, specific to x86_64 interpeter | |
222 | */ | 222 | */ | |
223 | int | 223 | int | |
224 | ELFNAME2(linux,debuglink_signature)(l, epp, eh) | 224 | ELFNAME2(linux,debuglink_signature)(struct lwp *l, struct exec_package *epp, Elf_Ehdr *eh) | |
225 | struct lwp *l; | |||
226 | struct exec_package *epp; | |||
227 | Elf_Ehdr *eh; | |||
228 | { | 225 | { | |
229 | size_t shsize; | 226 | size_t shsize; | |
230 | int strndx; | 227 | int strndx; | |
231 | size_t i; | 228 | size_t i; | |
232 | static const char signature[] = ".gnu_debuglink"; | 229 | static const char signature[] = ".gnu_debuglink"; | |
233 | char *strtable = NULL; | 230 | char *strtable = NULL; | |
234 | Elf_Shdr *sh; | 231 | Elf_Shdr *sh; | |
235 | 232 | |||
236 | int error; | 233 | int error; | |
237 | 234 | |||
238 | /* | 235 | /* | |
239 | * load the section header table | 236 | * load the section header table | |
240 | */ | 237 | */ | |
@@ -276,31 +273,27 @@ ELFNAME2(linux,debuglink_signature)(l, e | @@ -276,31 +273,27 @@ ELFNAME2(linux,debuglink_signature)(l, e | |||
276 | } | 273 | } | |
277 | } | 274 | } | |
278 | error = ENOEXEC; | 275 | error = ENOEXEC; | |
279 | 276 | |||
280 | out: | 277 | out: | |
281 | free(sh, M_TEMP); | 278 | free(sh, M_TEMP); | |
282 | if (strtable) | 279 | if (strtable) | |
283 | free(strtable, M_TEMP); | 280 | free(strtable, M_TEMP); | |
284 | return (error); | 281 | return (error); | |
285 | } | 282 | } | |
286 | #endif | 283 | #endif | |
287 | 284 | |||
288 | int | 285 | int | |
289 | ELFNAME2(linux,signature)(l, epp, eh, itp) | 286 | ELFNAME2(linux,signature)(struct lwp *l, struct exec_package *epp, Elf_Ehdr *eh, char *itp) | |
290 | struct lwp *l; | |||
291 | struct exec_package *epp; | |||
292 | Elf_Ehdr *eh; | |||
293 | char *itp; | |||
294 | { | 287 | { | |
295 | size_t i; | 288 | size_t i; | |
296 | Elf_Phdr *ph; | 289 | Elf_Phdr *ph; | |
297 | size_t phsize; | 290 | size_t phsize; | |
298 | int error; | 291 | int error; | |
299 | static const char linux[] = "Linux"; | 292 | static const char linux[] = "Linux"; | |
300 | 293 | |||
301 | if (eh->e_ident[EI_OSABI] == 3 || | 294 | if (eh->e_ident[EI_OSABI] == 3 || | |
302 | memcmp(&eh->e_ident[EI_ABIVERSION], linux, sizeof(linux)) == 0) | 295 | memcmp(&eh->e_ident[EI_ABIVERSION], linux, sizeof(linux)) == 0) | |
303 | return 0; | 296 | return 0; | |
304 | 297 | |||
305 | phsize = eh->e_phnum * sizeof(Elf_Phdr); | 298 | phsize = eh->e_phnum * sizeof(Elf_Phdr); | |
306 | ph = (Elf_Phdr *)malloc(phsize, M_TEMP, M_WAITOK); | 299 | ph = (Elf_Phdr *)malloc(phsize, M_TEMP, M_WAITOK); |
--- src/sys/compat/linux/common/linux_limit.h 2008/04/28 20:23:43 1.3
+++ src/sys/compat/linux/common/linux_limit.h 2009/03/15 15:55:51 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux_limit.h,v 1.3 2008/04/28 20:23:43 martin Exp $ */ | 1 | /* $NetBSD: linux_limit.h,v 1.4 2009/03/15 15:55:51 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe | 8 | * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe | |
9 | * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. | 9 | * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -47,28 +47,27 @@ static int linux_to_bsd_limit(int); | @@ -47,28 +47,27 @@ static int linux_to_bsd_limit(int); | |||
47 | LINUX_RLIM_INFINITY : (int32_t)(b)->f | 47 | LINUX_RLIM_INFINITY : (int32_t)(b)->f | |
48 | #endif | 48 | #endif | |
49 | #define bsd_to_linux_rlimit(l, b) \ | 49 | #define bsd_to_linux_rlimit(l, b) \ | |
50 | bsd_to_linux_rlimit1(l, b, rlim_cur); \ | 50 | bsd_to_linux_rlimit1(l, b, rlim_cur); \ | |
51 | bsd_to_linux_rlimit1(l, b, rlim_max) | 51 | bsd_to_linux_rlimit1(l, b, rlim_max) | |
52 | 52 | |||
53 | #define linux_to_bsd_rlimit1(b, l, f) \ | 53 | #define linux_to_bsd_rlimit1(b, l, f) \ | |
54 | (b)->f = (l)->f == LINUX_RLIM_INFINITY ? RLIM_INFINITY : (l)->f | 54 | (b)->f = (l)->f == LINUX_RLIM_INFINITY ? RLIM_INFINITY : (l)->f | |
55 | #define linux_to_bsd_rlimit(b, l) \ | 55 | #define linux_to_bsd_rlimit(b, l) \ | |
56 | linux_to_bsd_rlimit1(b, l, rlim_cur); \ | 56 | linux_to_bsd_rlimit1(b, l, rlim_cur); \ | |
57 | linux_to_bsd_rlimit1(b, l, rlim_max) | 57 | linux_to_bsd_rlimit1(b, l, rlim_max) | |
58 | 58 | |||
59 | static int | 59 | static int | |
60 | linux_to_bsd_limit(lim) | 60 | linux_to_bsd_limit(int lim) | |
61 | int lim; | |||
62 | { | 61 | { | |
63 | switch (lim) { | 62 | switch (lim) { | |
64 | case LINUX_RLIMIT_CPU: | 63 | case LINUX_RLIMIT_CPU: | |
65 | return RLIMIT_CPU; | 64 | return RLIMIT_CPU; | |
66 | case LINUX_RLIMIT_FSIZE: | 65 | case LINUX_RLIMIT_FSIZE: | |
67 | return RLIMIT_FSIZE; | 66 | return RLIMIT_FSIZE; | |
68 | case LINUX_RLIMIT_DATA: | 67 | case LINUX_RLIMIT_DATA: | |
69 | return RLIMIT_DATA; | 68 | return RLIMIT_DATA; | |
70 | case LINUX_RLIMIT_STACK: | 69 | case LINUX_RLIMIT_STACK: | |
71 | return RLIMIT_STACK; | 70 | return RLIMIT_STACK; | |
72 | case LINUX_RLIMIT_CORE: | 71 | case LINUX_RLIMIT_CORE: | |
73 | return RLIMIT_CORE; | 72 | return RLIMIT_CORE; | |
74 | case LINUX_RLIMIT_RSS: | 73 | case LINUX_RLIMIT_RSS: |
--- src/sys/compat/linux/common/linux_statfs.h 2008/04/28 20:23:44 1.3
+++ src/sys/compat/linux/common/linux_statfs.h 2009/03/15 15:55:51 1.4
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux_statfs.h,v 1.3 2008/04/28 20:23:44 martin Exp $ */ | 1 | /* $NetBSD: linux_statfs.h,v 1.4 2009/03/15 15:55:51 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1995, 1998, 1999 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe | 8 | * by Frank van der Linden and Eric Haszlakiewicz; by Jason R. Thorpe | |
9 | * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. | 9 | * of the Numerical Aerospace Simulation Facility, NASA Ames Research Center. | |
10 | * | 10 | * | |
11 | * Redistribution and use in source and binary forms, with or without | 11 | * Redistribution and use in source and binary forms, with or without | |
12 | * modification, are permitted provided that the following conditions | 12 | * modification, are permitted provided that the following conditions | |
13 | * are met: | 13 | * are met: | |
14 | * 1. Redistributions of source code must retain the above copyright | 14 | * 1. Redistributions of source code must retain the above copyright | |
@@ -32,29 +32,27 @@ | @@ -32,29 +32,27 @@ | |||
32 | 32 | |||
33 | #ifndef _LINUX_STATFS_H | 33 | #ifndef _LINUX_STATFS_H | |
34 | #define _LINUX_STATFS_H | 34 | #define _LINUX_STATFS_H | |
35 | 35 | |||
36 | static void bsd_to_linux_statfs(const struct statvfs *, | 36 | static void bsd_to_linux_statfs(const struct statvfs *, | |
37 | struct linux_statfs *); | 37 | struct linux_statfs *); | |
38 | 38 | |||
39 | /* | 39 | /* | |
40 | * Convert NetBSD statvfs structure to Linux statfs structure. | 40 | * Convert NetBSD statvfs structure to Linux statfs structure. | |
41 | * Linux doesn't have f_flag, and we can't set f_frsize due | 41 | * Linux doesn't have f_flag, and we can't set f_frsize due | |
42 | * to glibc statvfs() bug (see below). | 42 | * to glibc statvfs() bug (see below). | |
43 | */ | 43 | */ | |
44 | static void | 44 | static void | |
45 | bsd_to_linux_statfs(bsp, lsp) | 45 | bsd_to_linux_statfs(const struct statvfs *bsp, struct linux_statfs *lsp) | |
46 | const struct statvfs *bsp; | |||
47 | struct linux_statfs *lsp; | |||
48 | { | 46 | { | |
49 | int i; | 47 | int i; | |
50 | 48 | |||
51 | for (i = 0; i < linux_fstypes_cnt; i++) { | 49 | for (i = 0; i < linux_fstypes_cnt; i++) { | |
52 | if (strcmp(bsp->f_fstypename, linux_fstypes[i].bsd) == 0) { | 50 | if (strcmp(bsp->f_fstypename, linux_fstypes[i].bsd) == 0) { | |
53 | lsp->l_ftype = linux_fstypes[i].linux; | 51 | lsp->l_ftype = linux_fstypes[i].linux; | |
54 | break; | 52 | break; | |
55 | } | 53 | } | |
56 | } | 54 | } | |
57 | 55 | |||
58 | if (i == linux_fstypes_cnt) { | 56 | if (i == linux_fstypes_cnt) { | |
59 | lsp->l_ftype = LINUX_DEFAULT_SUPER_MAGIC; | 57 | lsp->l_ftype = LINUX_DEFAULT_SUPER_MAGIC; | |
60 | } | 58 | } |
--- src/sys/compat/linux/common/linux_termios.h 2008/06/28 21:34:32 1.18
+++ src/sys/compat/linux/common/linux_termios.h 2009/03/15 15:55:51 1.19
@@ -1,14 +1,14 @@ | @@ -1,14 +1,14 @@ | |||
1 | /* $NetBSD: linux_termios.h,v 1.18 2008/06/28 21:34:32 chris Exp $ */ | 1 | /* $NetBSD: linux_termios.h,v 1.19 2009/03/15 15:55:51 cegger Exp $ */ | |
2 | 2 | |||
3 | /*- | 3 | /*- | |
4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | 4 | * Copyright (c) 1998 The NetBSD Foundation, Inc. | |
5 | * All rights reserved. | 5 | * All rights reserved. | |
6 | * | 6 | * | |
7 | * This code is derived from software contributed to The NetBSD Foundation | 7 | * This code is derived from software contributed to The NetBSD Foundation | |
8 | * by Eric Haszlakiewicz. | 8 | * by Eric Haszlakiewicz. | |
9 | * | 9 | * | |
10 | * Redistribution and use in source and binary forms, with or without | 10 | * Redistribution and use in source and binary forms, with or without | |
11 | * modification, are permitted provided that the following conditions | 11 | * modification, are permitted provided that the following conditions | |
12 | * are met: | 12 | * are met: | |
13 | * 1. Redistributions of source code must retain the above copyright | 13 | * 1. Redistributions of source code must retain the above copyright | |
14 | * notice, this list of conditions and the following disclaimer. | 14 | * notice, this list of conditions and the following disclaimer. | |
@@ -175,33 +175,29 @@ static void bsd_termios_to_linux_termios | @@ -175,33 +175,29 @@ static void bsd_termios_to_linux_termios | |||
175 | 175 | |||
176 | /* | 176 | /* | |
177 | * Deal with termio ioctl cruft. This doesn't look very good.. | 177 | * Deal with termio ioctl cruft. This doesn't look very good.. | |
178 | * XXX too much code duplication, obviously.. | 178 | * XXX too much code duplication, obviously.. | |
179 | * | 179 | * | |
180 | * The conversion routines between Linux and BSD structures assume | 180 | * The conversion routines between Linux and BSD structures assume | |
181 | * that the fields are already filled with the current values, | 181 | * that the fields are already filled with the current values, | |
182 | * so that fields present in BSD but not in Linux keep their current | 182 | * so that fields present in BSD but not in Linux keep their current | |
183 | * values. | 183 | * values. | |
184 | */ | 184 | */ | |
185 | 185 | |||
186 | static void | 186 | static void | |
187 | #ifdef COMPAT_LINUX32 | 187 | #ifdef COMPAT_LINUX32 | |
188 | linux32_termio_to_bsd_termios(lt, bts) | 188 | linux32_termio_to_bsd_termios(struct linux32_termio *lt, struct termios *bts) | |
189 | struct linux32_termio *lt; | |||
190 | struct termios *bts; | |||
191 | #else | 189 | #else | |
192 | linux_termio_to_bsd_termios(lt, bts) | 190 | linux_termio_to_bsd_termios(struct linux_termio *lt, struct termios *bts) | |
193 | struct linux_termio *lt; | |||
194 | struct termios *bts; | |||
195 | #endif | 191 | #endif | |
196 | { | 192 | { | |
197 | int index; | 193 | int index; | |
198 | 194 | |||
199 | bts->c_iflag = 0; | 195 | bts->c_iflag = 0; | |
200 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_IGNBRK, IGNBRK); | 196 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_IGNBRK, IGNBRK); | |
201 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_BRKINT, BRKINT); | 197 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_BRKINT, BRKINT); | |
202 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_IGNPAR, IGNPAR); | 198 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_IGNPAR, IGNPAR); | |
203 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_INPCK, INPCK); | 199 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_INPCK, INPCK); | |
204 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_ISTRIP, ISTRIP); | 200 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_ISTRIP, ISTRIP); | |
205 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_INLCR, INLCR); | 201 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_INLCR, INLCR); | |
206 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_IGNCR, IGNCR); | 202 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_IGNCR, IGNCR); | |
207 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_ICRNL, ICRNL); | 203 | bts->c_iflag |= cvtto_bsd_mask(lt->c_iflag, LINUX_ICRNL, ICRNL); | |
@@ -264,33 +260,29 @@ linux_termio_to_bsd_termios(lt, bts) | @@ -264,33 +260,29 @@ linux_termio_to_bsd_termios(lt, bts) | |||
264 | bts->c_ispeed = bts->c_ospeed = linux_speeds[index]; | 260 | bts->c_ispeed = bts->c_ospeed = linux_speeds[index]; | |
265 | 261 | |||
266 | bts->c_cc[VINTR] = lt->c_cc[LINUX_OLD_VINTR]; | 262 | bts->c_cc[VINTR] = lt->c_cc[LINUX_OLD_VINTR]; | |
267 | bts->c_cc[VQUIT] = lt->c_cc[LINUX_OLD_VQUIT]; | 263 | bts->c_cc[VQUIT] = lt->c_cc[LINUX_OLD_VQUIT]; | |
268 | bts->c_cc[VERASE] = lt->c_cc[LINUX_OLD_VERASE]; | 264 | bts->c_cc[VERASE] = lt->c_cc[LINUX_OLD_VERASE]; | |
269 | bts->c_cc[VKILL] = lt->c_cc[LINUX_OLD_VKILL]; | 265 | bts->c_cc[VKILL] = lt->c_cc[LINUX_OLD_VKILL]; | |
270 | bts->c_cc[VEOF] = lt->c_cc[LINUX_OLD_VEOF]; | 266 | bts->c_cc[VEOF] = lt->c_cc[LINUX_OLD_VEOF]; | |
271 | bts->c_cc[VTIME] = lt->c_cc[LINUX_OLD_VTIME]; | 267 | bts->c_cc[VTIME] = lt->c_cc[LINUX_OLD_VTIME]; | |
272 | bts->c_cc[VMIN] = lt->c_cc[LINUX_OLD_VMIN]; | 268 | bts->c_cc[VMIN] = lt->c_cc[LINUX_OLD_VMIN]; | |
273 | } | 269 | } | |
274 | 270 | |||
275 | static void | 271 | static void | |
276 | #ifdef COMPAT_LINUX32 | 272 | #ifdef COMPAT_LINUX32 | |
277 | bsd_termios_to_linux32_termio(bts, lt) | 273 | bsd_termios_to_linux32_termio(struct termios *bts, struct linux32_termio *lt) | |
278 | struct termios *bts; | |||
279 | struct linux32_termio *lt; | |||
280 | #else | 274 | #else | |
281 | bsd_termios_to_linux_termio(bts, lt) | 275 | bsd_termios_to_linux_termio(struct termios *bts, struct linux_termio *lt) | |
282 | struct termios *bts; | |||
283 | struct linux_termio *lt; | |||
284 | #endif | 276 | #endif | |
285 | { | 277 | { | |
286 | int i, mask; | 278 | int i, mask; | |
287 | 279 | |||
288 | lt->c_iflag = 0; | 280 | lt->c_iflag = 0; | |
289 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNBRK, LINUX_IGNBRK); | 281 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNBRK, LINUX_IGNBRK); | |
290 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, BRKINT, LINUX_BRKINT); | 282 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, BRKINT, LINUX_BRKINT); | |
291 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNPAR, LINUX_IGNPAR); | 283 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNPAR, LINUX_IGNPAR); | |
292 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, INPCK, LINUX_INPCK); | 284 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, INPCK, LINUX_INPCK); | |
293 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, ISTRIP, LINUX_ISTRIP); | 285 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, ISTRIP, LINUX_ISTRIP); | |
294 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, INLCR, LINUX_INLCR); | 286 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, INLCR, LINUX_INLCR); | |
295 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNCR, LINUX_IGNCR); | 287 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNCR, LINUX_IGNCR); | |
296 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, ICRNL, LINUX_ICRNL); | 288 | lt->c_iflag |= cvtto_linux_mask(bts->c_iflag, ICRNL, LINUX_ICRNL); | |
@@ -356,33 +348,29 @@ bsd_termios_to_linux_termio(bts, lt) | @@ -356,33 +348,29 @@ bsd_termios_to_linux_termio(bts, lt) | |||
356 | lt->c_cc[LINUX_VERASE] = bts->c_cc[VERASE]; | 348 | lt->c_cc[LINUX_VERASE] = bts->c_cc[VERASE]; | |
357 | lt->c_cc[LINUX_VKILL] = bts->c_cc[VKILL]; | 349 | lt->c_cc[LINUX_VKILL] = bts->c_cc[VKILL]; | |
358 | lt->c_cc[LINUX_VEOF] = bts->c_cc[VEOF]; | 350 | lt->c_cc[LINUX_VEOF] = bts->c_cc[VEOF]; | |
359 | lt->c_cc[LINUX_VTIME] = bts->c_cc[VTIME]; | 351 | lt->c_cc[LINUX_VTIME] = bts->c_cc[VTIME]; | |
360 | lt->c_cc[LINUX_VMIN] = bts->c_cc[VMIN]; | 352 | lt->c_cc[LINUX_VMIN] = bts->c_cc[VMIN]; | |
361 | lt->c_cc[LINUX_VSWTC] = 0; | 353 | lt->c_cc[LINUX_VSWTC] = 0; | |
362 | 354 | |||
363 | /* XXX should be fixed someday */ | 355 | /* XXX should be fixed someday */ | |
364 | lt->c_line = 0; | 356 | lt->c_line = 0; | |
365 | } | 357 | } | |
366 | 358 | |||
367 | static void | 359 | static void | |
368 | #ifdef COMPAT_LINUX32 | 360 | #ifdef COMPAT_LINUX32 | |
369 | linux32_termios_to_bsd_termios(lts, bts) | 361 | linux32_termios_to_bsd_termios(struct linux32_termios *lts, struct termios *bts) | |
370 | struct linux32_termios *lts; | |||
371 | struct termios *bts; | |||
372 | #else | 362 | #else | |
373 | linux_termios_to_bsd_termios(lts, bts) | 363 | linux_termios_to_bsd_termios(struct linux_termios *lts, struct termios *bts) | |
374 | struct linux_termios *lts; | |||
375 | struct termios *bts; | |||
376 | #endif | 364 | #endif | |
377 | { | 365 | { | |
378 | int index; | 366 | int index; | |
379 | 367 | |||
380 | bts->c_iflag = 0; | 368 | bts->c_iflag = 0; | |
381 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_IGNBRK, IGNBRK); | 369 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_IGNBRK, IGNBRK); | |
382 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_BRKINT, BRKINT); | 370 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_BRKINT, BRKINT); | |
383 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_IGNPAR, IGNPAR); | 371 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_IGNPAR, IGNPAR); | |
384 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_INPCK, INPCK); | 372 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_INPCK, INPCK); | |
385 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_ISTRIP, ISTRIP); | 373 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_ISTRIP, ISTRIP); | |
386 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_INLCR, INLCR); | 374 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_INLCR, INLCR); | |
387 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_IGNCR, IGNCR); | 375 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_IGNCR, IGNCR); | |
388 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_ICRNL, ICRNL); | 376 | bts->c_iflag |= cvtto_bsd_mask(lts->c_iflag, LINUX_ICRNL, ICRNL); | |
@@ -457,33 +445,29 @@ linux_termios_to_bsd_termios(lts, bts) | @@ -457,33 +445,29 @@ linux_termios_to_bsd_termios(lts, bts) | |||
457 | bts->c_cc[VEOL] = lts->c_cc[LINUX_VEOL]; | 445 | bts->c_cc[VEOL] = lts->c_cc[LINUX_VEOL]; | |
458 | bts->c_cc[VEOL2] = lts->c_cc[LINUX_VEOL2]; | 446 | bts->c_cc[VEOL2] = lts->c_cc[LINUX_VEOL2]; | |
459 | bts->c_cc[VWERASE] = lts->c_cc[LINUX_VWERASE]; | 447 | bts->c_cc[VWERASE] = lts->c_cc[LINUX_VWERASE]; | |
460 | bts->c_cc[VSUSP] = lts->c_cc[LINUX_VSUSP]; | 448 | bts->c_cc[VSUSP] = lts->c_cc[LINUX_VSUSP]; | |
461 | bts->c_cc[VSTART] = lts->c_cc[LINUX_VSTART]; | 449 | bts->c_cc[VSTART] = lts->c_cc[LINUX_VSTART]; | |
462 | bts->c_cc[VSTOP] = lts->c_cc[LINUX_VSTOP]; | 450 | bts->c_cc[VSTOP] = lts->c_cc[LINUX_VSTOP]; | |
463 | bts->c_cc[VLNEXT] = lts->c_cc[LINUX_VLNEXT]; | 451 | bts->c_cc[VLNEXT] = lts->c_cc[LINUX_VLNEXT]; | |
464 | bts->c_cc[VDISCARD] = lts->c_cc[LINUX_VDISCARD]; | 452 | bts->c_cc[VDISCARD] = lts->c_cc[LINUX_VDISCARD]; | |
465 | bts->c_cc[VREPRINT] = lts->c_cc[LINUX_VREPRINT]; | 453 | bts->c_cc[VREPRINT] = lts->c_cc[LINUX_VREPRINT]; | |
466 | } | 454 | } | |
467 | 455 | |||
468 | static void | 456 | static void | |
469 | #ifdef COMPAT_LINUX32 | 457 | #ifdef COMPAT_LINUX32 | |
470 | bsd_termios_to_linux32_termios(bts, lts) | 458 | bsd_termios_to_linux32_termios(struct termios *bts, struct linux32_termios *lts) | |
471 | struct termios *bts; | |||
472 | struct linux32_termios *lts; | |||
473 | #else | 459 | #else | |
474 | bsd_termios_to_linux_termios(bts, lts) | 460 | bsd_termios_to_linux_termios(struct termios *bts, struct linux_termios *lts) | |
475 | struct termios *bts; | |||
476 | struct linux_termios *lts; | |||
477 | #endif | 461 | #endif | |
478 | { | 462 | { | |
479 | int i, mask; | 463 | int i, mask; | |
480 | 464 | |||
481 | lts->c_iflag = 0; | 465 | lts->c_iflag = 0; | |
482 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNBRK, LINUX_IGNBRK); | 466 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNBRK, LINUX_IGNBRK); | |
483 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, BRKINT, LINUX_BRKINT); | 467 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, BRKINT, LINUX_BRKINT); | |
484 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNPAR, LINUX_IGNPAR); | 468 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNPAR, LINUX_IGNPAR); | |
485 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, INPCK, LINUX_INPCK); | 469 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, INPCK, LINUX_INPCK); | |
486 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, ISTRIP, LINUX_ISTRIP); | 470 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, ISTRIP, LINUX_ISTRIP); | |
487 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, INLCR, LINUX_INLCR); | 471 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, INLCR, LINUX_INLCR); | |
488 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNCR, LINUX_IGNCR); | 472 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, IGNCR, LINUX_IGNCR); | |
489 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, ICRNL, LINUX_ICRNL); | 473 | lts->c_iflag |= cvtto_linux_mask(bts->c_iflag, ICRNL, LINUX_ICRNL); |