Mon Dec 14 00:48:36 2009 UTC ()
Merge from matt-nb5-mips64


(matt)
diff -r1.34 -r1.35 src/sys/kern/core_elf32.c
diff -r1.11 -r1.12 src/sys/kern/exec_elf.c
diff -r1.241 -r1.242 src/sys/kern/init_sysent.c
diff -r1.151 -r1.152 src/sys/kern/sys_process.c
diff -r1.232 -r1.233 src/sys/kern/syscalls.c
diff -r1.20 -r1.21 src/sys/lib/libkern/arch/mips/Makefile.inc
diff -r1.128 -r1.129 src/sys/sys/exec.h
diff -r1.41 -r1.42 src/sys/sys/ptrace.h

cvs diff -r1.34 -r1.35 src/sys/kern/core_elf32.c (expand / switch to unified diff)

--- src/sys/kern/core_elf32.c 2009/10/21 21:12:06 1.34
+++ src/sys/kern/core_elf32.c 2009/12/14 00:48:35 1.35
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: core_elf32.c,v 1.34 2009/10/21 21:12:06 rmind Exp $ */ 1/* $NetBSD: core_elf32.c,v 1.35 2009/12/14 00:48:35 matt Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2001 Wasabi Systems, Inc. 4 * Copyright (c) 2001 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -30,27 +30,27 @@ @@ -30,27 +30,27 @@
30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 30 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 31 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 32 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 33 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 34 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35 * POSSIBILITY OF SUCH DAMAGE. 35 * POSSIBILITY OF SUCH DAMAGE.
36 */ 36 */
37 37
38/* 38/*
39 * core_elf32.c/core_elf64.c: Support for the Elf32/Elf64 core file format. 39 * core_elf32.c/core_elf64.c: Support for the Elf32/Elf64 core file format.
40 */ 40 */
41 41
42#include <sys/cdefs.h> 42#include <sys/cdefs.h>
43__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.34 2009/10/21 21:12:06 rmind Exp $"); 43__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.35 2009/12/14 00:48:35 matt Exp $");
44 44
45#ifdef _KERNEL_OPT 45#ifdef _KERNEL_OPT
46#include "opt_coredump.h" 46#include "opt_coredump.h"
47#endif 47#endif
48 48
49#ifndef ELFSIZE 49#ifndef ELFSIZE
50#define ELFSIZE 32 50#define ELFSIZE 32
51#endif 51#endif
52 52
53#include <sys/param.h> 53#include <sys/param.h>
54#include <sys/systm.h> 54#include <sys/systm.h>
55#include <sys/proc.h> 55#include <sys/proc.h>
56#include <sys/vnode.h> 56#include <sys/vnode.h>
@@ -80,27 +80,31 @@ struct writesegs_state { @@ -80,27 +80,31 @@ struct writesegs_state {
80 80
81static int ELFNAMEEND(coredump_writeseghdrs)(struct proc *, void *, 81static int ELFNAMEEND(coredump_writeseghdrs)(struct proc *, void *,
82 struct uvm_coredump_state *); 82 struct uvm_coredump_state *);
83 83
84static int ELFNAMEEND(coredump_notes)(struct proc *, struct lwp *, void *, 84static int ELFNAMEEND(coredump_notes)(struct proc *, struct lwp *, void *,
85 size_t *); 85 size_t *);
86static int ELFNAMEEND(coredump_note)(struct proc *, struct lwp *, void *, 86static int ELFNAMEEND(coredump_note)(struct proc *, struct lwp *, void *,
87 size_t *); 87 size_t *);
88 88
89#define ELFROUNDSIZE 4 /* XXX Should it be sizeof(Elf_Word)? */ 89#define ELFROUNDSIZE 4 /* XXX Should it be sizeof(Elf_Word)? */
90#define elfround(x) roundup((x), ELFROUNDSIZE) 90#define elfround(x) roundup((x), ELFROUNDSIZE)
91 91
92#define elf_process_read_regs CONCAT(process_read_regs, ELFSIZE) 92#define elf_process_read_regs CONCAT(process_read_regs, ELFSIZE)
 93#ifdef __HAVE_PROCESS_XFPREGS
 94#define elf_process_read_xfpregs CONCAT(process_read_xfpregs, ELFSIZE)
 95#else
93#define elf_process_read_fpregs CONCAT(process_read_fpregs, ELFSIZE) 96#define elf_process_read_fpregs CONCAT(process_read_fpregs, ELFSIZE)
 97#endif
94#define elf_reg CONCAT(process_reg, ELFSIZE) 98#define elf_reg CONCAT(process_reg, ELFSIZE)
95#define elf_fpreg CONCAT(process_fpreg, ELFSIZE) 99#define elf_fpreg CONCAT(process_fpreg, ELFSIZE)
96 100
97int 101int
98ELFNAMEEND(coredump)(struct lwp *l, void *cookie) 102ELFNAMEEND(coredump)(struct lwp *l, void *cookie)
99{ 103{
100 struct proc *p; 104 struct proc *p;
101 Elf_Ehdr ehdr; 105 Elf_Ehdr ehdr;
102 Elf_Phdr phdr, *psections; 106 Elf_Phdr phdr, *psections;
103 struct countsegs_state cs; 107 struct countsegs_state cs;
104 struct writesegs_state ws; 108 struct writesegs_state ws;
105 off_t notestart, secstart, offset; 109 off_t notestart, secstart, offset;
106 size_t notesize; 110 size_t notesize;
@@ -152,26 +156,30 @@ ELFNAMEEND(coredump)(struct lwp *l, void @@ -152,26 +156,30 @@ ELFNAMEEND(coredump)(struct lwp *l, void
152 ehdr.e_machine = ELFDEFNNAME(MACHDEP_ID); 156 ehdr.e_machine = ELFDEFNNAME(MACHDEP_ID);
153 ehdr.e_version = EV_CURRENT; 157 ehdr.e_version = EV_CURRENT;
154 ehdr.e_entry = 0; 158 ehdr.e_entry = 0;
155 ehdr.e_phoff = sizeof(ehdr); 159 ehdr.e_phoff = sizeof(ehdr);
156 ehdr.e_shoff = 0; 160 ehdr.e_shoff = 0;
157 ehdr.e_flags = 0; 161 ehdr.e_flags = 0;
158 ehdr.e_ehsize = sizeof(ehdr); 162 ehdr.e_ehsize = sizeof(ehdr);
159 ehdr.e_phentsize = sizeof(Elf_Phdr); 163 ehdr.e_phentsize = sizeof(Elf_Phdr);
160 ehdr.e_phnum = cs.npsections; 164 ehdr.e_phnum = cs.npsections;
161 ehdr.e_shentsize = 0; 165 ehdr.e_shentsize = 0;
162 ehdr.e_shnum = 0; 166 ehdr.e_shnum = 0;
163 ehdr.e_shstrndx = 0; 167 ehdr.e_shstrndx = 0;
164 168
 169#ifdef ELF_MD_COREDUMP_SETUP
 170 ELF_MD_COREDUMP_SETUP(l, &ehdr);
 171#endif
 172
165 /* Write out the ELF header. */ 173 /* Write out the ELF header. */
166 error = coredump_write(cookie, UIO_SYSSPACE, &ehdr, sizeof(ehdr)); 174 error = coredump_write(cookie, UIO_SYSSPACE, &ehdr, sizeof(ehdr));
167 if (error) 175 if (error)
168 goto out; 176 goto out;
169 177
170 offset = sizeof(ehdr); 178 offset = sizeof(ehdr);
171 179
172 notestart = offset + sizeof(phdr) * cs.npsections; 180 notestart = offset + sizeof(phdr) * cs.npsections;
173 secstart = notestart + notesize; 181 secstart = notestart + notesize;
174 182
175 psections = malloc(cs.npsections * sizeof(Elf_Phdr), 183 psections = malloc(cs.npsections * sizeof(Elf_Phdr),
176 M_TEMP, M_WAITOK|M_ZERO); 184 M_TEMP, M_WAITOK|M_ZERO);
177 185
@@ -441,32 +449,37 @@ ELFNAMEEND(coredump_note)(struct proc *p @@ -441,32 +449,37 @@ ELFNAMEEND(coredump_note)(struct proc *p
441 nhdr.n_type = PT_GETREGS; 449 nhdr.n_type = PT_GETREGS;
442 450
443 error = ELFNAMEEND(coredump_writenote)(p, iocookie, &nhdr, 451 error = ELFNAMEEND(coredump_writenote)(p, iocookie, &nhdr,
444 name, &intreg); 452 name, &intreg);
445 if (error) 453 if (error)
446 return (error); 454 return (error);
447 455
448 } 456 }
449 size += notesize; 457 size += notesize;
450 458
451#ifdef PT_GETFPREGS 459#ifdef PT_GETFPREGS
452 notesize = sizeof(nhdr) + elfround(namesize) + elfround(sizeof(freg)); 460 notesize = sizeof(nhdr) + elfround(namesize) + elfround(sizeof(freg));
453 if (iocookie) { 461 if (iocookie) {
 462 size_t freglen = sizeof(freg);
 463#ifdef __HAVE_PROCESS_XFPREGS
 464 error = elf_process_read_xfpregs(l, &freg, &freglen);
 465#else
454 error = elf_process_read_fpregs(l, &freg); 466 error = elf_process_read_fpregs(l, &freg);
 467#endif
455 if (error) 468 if (error)
456 return (error); 469 return (error);
457 470
458 nhdr.n_namesz = namesize; 471 nhdr.n_namesz = namesize;
459 nhdr.n_descsz = sizeof(freg); 472 nhdr.n_descsz = freglen;
460 nhdr.n_type = PT_GETFPREGS; 473 nhdr.n_type = PT_GETFPREGS;
461 474
462 error = ELFNAMEEND(coredump_writenote)(p, iocookie, &nhdr, 475 error = ELFNAMEEND(coredump_writenote)(p, iocookie, &nhdr,
463 name, &freg); 476 name, &freg);
464 if (error) 477 if (error)
465 return (error); 478 return (error);
466 } 479 }
467 size += notesize; 480 size += notesize;
468#endif 481#endif
469 *sizep = size; 482 *sizep = size;
470 /* XXX Add hook for machdep per-LWP notes. */ 483 /* XXX Add hook for machdep per-LWP notes. */
471 return (0); 484 return (0);
472} 485}

cvs diff -r1.11 -r1.12 src/sys/kern/exec_elf.c (expand / switch to unified diff)

--- src/sys/kern/exec_elf.c 2008/12/17 20:51:35 1.11
+++ src/sys/kern/exec_elf.c 2009/12/14 00:48:35 1.12
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: exec_elf.c,v 1.11 2008/12/17 20:51:35 cegger Exp $ */ 1/* $NetBSD: exec_elf.c,v 1.12 2009/12/14 00:48:35 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc. 4 * Copyright (c) 1994, 2000, 2005 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. 8 * by Christos Zoulas.
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.
@@ -47,27 +47,27 @@ @@ -47,27 +47,27 @@
47 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 47 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
48 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 48 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 49 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
50 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 50 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 51 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
52 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 52 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 53 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 54 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 55 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
56 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 56 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
57 */ 57 */
58 58
59#include <sys/cdefs.h> 59#include <sys/cdefs.h>
60__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.11 2008/12/17 20:51:35 cegger Exp $"); 60__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.12 2009/12/14 00:48:35 matt Exp $");
61 61
62#ifdef _KERNEL_OPT 62#ifdef _KERNEL_OPT
63#include "opt_pax.h" 63#include "opt_pax.h"
64#endif /* _KERNEL_OPT */ 64#endif /* _KERNEL_OPT */
65 65
66#include <sys/param.h> 66#include <sys/param.h>
67#include <sys/proc.h> 67#include <sys/proc.h>
68#include <sys/malloc.h> 68#include <sys/malloc.h>
69#include <sys/kmem.h> 69#include <sys/kmem.h>
70#include <sys/namei.h> 70#include <sys/namei.h>
71#include <sys/vnode.h> 71#include <sys/vnode.h>
72#include <sys/exec.h> 72#include <sys/exec.h>
73#include <sys/exec_elf.h> 73#include <sys/exec_elf.h>
@@ -899,18 +899,21 @@ next: @@ -899,18 +899,21 @@ next:
899out: 899out:
900 kmem_free(ph, phsize); 900 kmem_free(ph, phsize);
901 return error; 901 return error;
902} 902}
903 903
904int 904int
905netbsd_elf_probe(struct lwp *l, struct exec_package *epp, void *eh, char *itp, 905netbsd_elf_probe(struct lwp *l, struct exec_package *epp, void *eh, char *itp,
906 vaddr_t *pos) 906 vaddr_t *pos)
907{ 907{
908 int error; 908 int error;
909 909
910 if ((error = netbsd_elf_signature(l, epp, eh)) != 0) 910 if ((error = netbsd_elf_signature(l, epp, eh)) != 0)
911 return error; 911 return error;
912#ifdef ELF_INTERP_NON_RELOCATABLE 912#ifdef ELF_MD_PROBE_FUNC
 913 if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0)
 914 return error;
 915#elif defined(ELF_INTERP_NON_RELOCATABLE)
913 *pos = ELF_LINK_ADDR; 916 *pos = ELF_LINK_ADDR;
914#endif 917#endif
915 return 0; 918 return 0;
916} 919}

cvs diff -r1.241 -r1.242 src/sys/kern/init_sysent.c (expand / switch to unified diff)

--- src/sys/kern/init_sysent.c 2009/10/13 21:57:53 1.241
+++ src/sys/kern/init_sysent.c 2009/12/14 00:48:35 1.242
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1/* $NetBSD: init_sysent.c,v 1.241 2009/10/13 21:57:53 pooka Exp $ */ 1/* $NetBSD: init_sysent.c,v 1.242 2009/12/14 00:48:35 matt Exp $ */
2 2
3/* 3/*
4 * System call switch table. 4 * System call switch table.
5 * 5 *
6 * DO NOT EDIT-- this file is automatically generated. 6 * DO NOT EDIT-- this file is automatically generated.
7 * created from NetBSD: syscalls.master,v 1.229 2009/07/21 23:59:00 pooka Exp 7 * created from NetBSD
8 */ 8 */
9 9
10#include <sys/cdefs.h> 10#include <sys/cdefs.h>
11__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.241 2009/10/13 21:57:53 pooka Exp $"); 11__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.242 2009/12/14 00:48:35 matt Exp $");
12 12
13#include "opt_modular.h" 13#include "opt_modular.h"
14#include "opt_ntp.h" 14#include "opt_ntp.h"
15#include "opt_sysv.h" 15#include "opt_sysv.h"
16#include "fs_lfs.h" 16#include "fs_lfs.h"
17#include <sys/param.h> 17#include <sys/param.h>
18#include <sys/systm.h> 18#include <sys/systm.h>
19#include <sys/signal.h> 19#include <sys/signal.h>
20#include <sys/mount.h> 20#include <sys/mount.h>
21#include <sys/sched.h> 21#include <sys/sched.h>
22#include <sys/syscallargs.h> 22#include <sys/syscallargs.h>
23 23
24#ifdef COMPAT_43 24#ifdef COMPAT_43
@@ -455,29 +455,29 @@ struct sysent sysent[] = { @@ -455,29 +455,29 @@ struct sysent sysent[] = {
455#else 455#else
456 { 0, 0, 0, 456 { 0, 0, 0,
457 sys_nosys }, /* 170 = excluded 1.0 msgsys */ 457 sys_nosys }, /* 170 = excluded 1.0 msgsys */
458#endif 458#endif
459#if (defined(SYSVSHM) || !defined(_KERNEL_OPT)) && !defined(_LP64) 459#if (defined(SYSVSHM) || !defined(_KERNEL_OPT)) && !defined(_LP64)
460 { ns(struct compat_10_sys_shmsys_args), 0, 460 { ns(struct compat_10_sys_shmsys_args), 0,
461 (sy_call_t *)sys_nomodule }, /* 171 = compat_10_oshmsys */ 461 (sy_call_t *)sys_nomodule }, /* 171 = compat_10_oshmsys */
462#else 462#else
463 { 0, 0, 0, 463 { 0, 0, 0,
464 sys_nosys }, /* 171 = excluded 1.0 shmsys */ 464 sys_nosys }, /* 171 = excluded 1.0 shmsys */
465#endif 465#endif
466 { 0, 0, 0, 466 { 0, 0, 0,
467 sys_nosys }, /* 172 = unimplemented */ 467 sys_nosys }, /* 172 = unimplemented */
468 { ns(struct sys_pread_args), 0, 468 { ns(struct sys_pread_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64,
469 (sy_call_t *)sys_pread }, /* 173 = pread */ 469 (sy_call_t *)sys_pread }, /* 173 = pread */
470 { ns(struct sys_pwrite_args), 0, 470 { ns(struct sys_pwrite_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64,
471 (sy_call_t *)sys_pwrite }, /* 174 = pwrite */ 471 (sy_call_t *)sys_pwrite }, /* 174 = pwrite */
472 { ns(struct compat_30_sys_ntp_gettime_args), 0, 472 { ns(struct compat_30_sys_ntp_gettime_args), 0,
473 (sy_call_t *)compat_30(sys_ntp_gettime) },/* 175 = compat_30_ntp_gettime */ 473 (sy_call_t *)compat_30(sys_ntp_gettime) },/* 175 = compat_30_ntp_gettime */
474#if defined(NTP) || !defined(_KERNEL_OPT) 474#if defined(NTP) || !defined(_KERNEL_OPT)
475 { ns(struct sys_ntp_adjtime_args), 0, 475 { ns(struct sys_ntp_adjtime_args), 0,
476 (sy_call_t *)sys_ntp_adjtime }, /* 176 = ntp_adjtime */ 476 (sy_call_t *)sys_ntp_adjtime }, /* 176 = ntp_adjtime */
477#else 477#else
478 { 0, 0, 0, 478 { 0, 0, 0,
479 sys_nosys }, /* 176 = excluded ntp_adjtime */ 479 sys_nosys }, /* 176 = excluded ntp_adjtime */
480#endif 480#endif
481 { 0, 0, 0, 481 { 0, 0, 0,
482 sys_nosys }, /* 177 = unimplemented */ 482 sys_nosys }, /* 177 = unimplemented */
483 { 0, 0, 0, 483 { 0, 0, 0,
@@ -519,35 +519,35 @@ struct sysent sysent[] = { @@ -519,35 +519,35 @@ struct sysent sysent[] = {
519 (sy_call_t *)sys_nomodule }, /* 190 = compat_12_lstat12 */ 519 (sy_call_t *)sys_nomodule }, /* 190 = compat_12_lstat12 */
520 { ns(struct sys_pathconf_args), 0, 520 { ns(struct sys_pathconf_args), 0,
521 (sy_call_t *)sys_pathconf }, /* 191 = pathconf */ 521 (sy_call_t *)sys_pathconf }, /* 191 = pathconf */
522 { ns(struct sys_fpathconf_args), 0, 522 { ns(struct sys_fpathconf_args), 0,
523 (sy_call_t *)sys_fpathconf }, /* 192 = fpathconf */ 523 (sy_call_t *)sys_fpathconf }, /* 192 = fpathconf */
524 { 0, 0, 0, 524 { 0, 0, 0,
525 sys_nosys }, /* 193 = unimplemented */ 525 sys_nosys }, /* 193 = unimplemented */
526 { ns(struct sys_getrlimit_args), 0, 526 { ns(struct sys_getrlimit_args), 0,
527 (sy_call_t *)sys_getrlimit }, /* 194 = getrlimit */ 527 (sy_call_t *)sys_getrlimit }, /* 194 = getrlimit */
528 { ns(struct sys_setrlimit_args), 0, 528 { ns(struct sys_setrlimit_args), 0,
529 (sy_call_t *)sys_setrlimit }, /* 195 = setrlimit */ 529 (sy_call_t *)sys_setrlimit }, /* 195 = setrlimit */
530 { ns(struct compat_12_sys_getdirentries_args), 0, 530 { ns(struct compat_12_sys_getdirentries_args), 0,
531 (sy_call_t *)sys_nomodule }, /* 196 = compat_12_getdirentries */ 531 (sy_call_t *)sys_nomodule }, /* 196 = compat_12_getdirentries */
532 { ns(struct sys_mmap_args), 0, 532 { ns(struct sys_mmap_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG6_64,
533 (sy_call_t *)sys_mmap }, /* 197 = mmap */ 533 (sy_call_t *)sys_mmap }, /* 197 = mmap */
534 { ns(struct sys___syscall_args), SYCALL_INDIRECT, 534 { ns(struct sys___syscall_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG0_64 | SYCALL_RET_64 | SYCALL_INDIRECT,
535 (sy_call_t *)sys___syscall }, /* 198 = __syscall */ 535 (sy_call_t *)sys___syscall }, /* 198 = __syscall */
536 { ns(struct sys_lseek_args), 0, 536 { ns(struct sys_lseek_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64 | SYCALL_RET_64,
537 (sy_call_t *)sys_lseek }, /* 199 = lseek */ 537 (sy_call_t *)sys_lseek }, /* 199 = lseek */
538 { ns(struct sys_truncate_args), 0, 538 { ns(struct sys_truncate_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64,
539 (sy_call_t *)sys_truncate }, /* 200 = truncate */ 539 (sy_call_t *)sys_truncate }, /* 200 = truncate */
540 { ns(struct sys_ftruncate_args), 0, 540 { ns(struct sys_ftruncate_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64,
541 (sy_call_t *)sys_ftruncate }, /* 201 = ftruncate */ 541 (sy_call_t *)sys_ftruncate }, /* 201 = ftruncate */
542 { ns(struct sys___sysctl_args), 0, 542 { ns(struct sys___sysctl_args), 0,
543 (sy_call_t *)sys___sysctl }, /* 202 = __sysctl */ 543 (sy_call_t *)sys___sysctl }, /* 202 = __sysctl */
544 { ns(struct sys_mlock_args), 0, 544 { ns(struct sys_mlock_args), 0,
545 (sy_call_t *)sys_mlock }, /* 203 = mlock */ 545 (sy_call_t *)sys_mlock }, /* 203 = mlock */
546 { ns(struct sys_munlock_args), 0, 546 { ns(struct sys_munlock_args), 0,
547 (sy_call_t *)sys_munlock }, /* 204 = munlock */ 547 (sy_call_t *)sys_munlock }, /* 204 = munlock */
548 { ns(struct sys_undelete_args), 0, 548 { ns(struct sys_undelete_args), 0,
549 (sy_call_t *)sys_undelete }, /* 205 = undelete */ 549 (sy_call_t *)sys_undelete }, /* 205 = undelete */
550 { ns(struct compat_50_sys_futimes_args), 0, 550 { ns(struct compat_50_sys_futimes_args), 0,
551 (sy_call_t *)sys_nomodule }, /* 206 = compat_50_futimes */ 551 (sy_call_t *)sys_nomodule }, /* 206 = compat_50_futimes */
552 { ns(struct sys_getpgid_args), 0, 552 { ns(struct sys_getpgid_args), 0,
553 (sy_call_t *)sys_getpgid }, /* 207 = getpgid */ 553 (sy_call_t *)sys_getpgid }, /* 207 = getpgid */
@@ -736,29 +736,29 @@ struct sysent sysent[] = { @@ -736,29 +736,29 @@ struct sysent sysent[] = {
736 (sy_call_t *)sys___vfork14 }, /* 282 = __vfork14 */ 736 (sy_call_t *)sys___vfork14 }, /* 282 = __vfork14 */
737 { ns(struct sys___posix_chown_args), 0, 737 { ns(struct sys___posix_chown_args), 0,
738 (sy_call_t *)sys___posix_chown }, /* 283 = __posix_chown */ 738 (sy_call_t *)sys___posix_chown }, /* 283 = __posix_chown */
739 { ns(struct sys___posix_fchown_args), 0, 739 { ns(struct sys___posix_fchown_args), 0,
740 (sy_call_t *)sys___posix_fchown }, /* 284 = __posix_fchown */ 740 (sy_call_t *)sys___posix_fchown }, /* 284 = __posix_fchown */
741 { ns(struct sys___posix_lchown_args), 0, 741 { ns(struct sys___posix_lchown_args), 0,
742 (sy_call_t *)sys___posix_lchown }, /* 285 = __posix_lchown */ 742 (sy_call_t *)sys___posix_lchown }, /* 285 = __posix_lchown */
743 { ns(struct sys_getsid_args), 0, 743 { ns(struct sys_getsid_args), 0,
744 (sy_call_t *)sys_getsid }, /* 286 = getsid */ 744 (sy_call_t *)sys_getsid }, /* 286 = getsid */
745 { ns(struct sys___clone_args), 0, 745 { ns(struct sys___clone_args), 0,
746 (sy_call_t *)sys___clone }, /* 287 = __clone */ 746 (sy_call_t *)sys___clone }, /* 287 = __clone */
747 { ns(struct sys_fktrace_args), 0, 747 { ns(struct sys_fktrace_args), 0,
748 (sy_call_t *)sys_fktrace }, /* 288 = fktrace */ 748 (sy_call_t *)sys_fktrace }, /* 288 = fktrace */
749 { ns(struct sys_preadv_args), 0, 749 { ns(struct sys_preadv_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64,
750 (sy_call_t *)sys_preadv }, /* 289 = preadv */ 750 (sy_call_t *)sys_preadv }, /* 289 = preadv */
751 { ns(struct sys_pwritev_args), 0, 751 { ns(struct sys_pwritev_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64,
752 (sy_call_t *)sys_pwritev }, /* 290 = pwritev */ 752 (sy_call_t *)sys_pwritev }, /* 290 = pwritev */
753 { ns(struct compat_16_sys___sigaction14_args), 0, 753 { ns(struct compat_16_sys___sigaction14_args), 0,
754 (sy_call_t *)sys_nomodule }, /* 291 = compat_16___sigaction14 */ 754 (sy_call_t *)sys_nomodule }, /* 291 = compat_16___sigaction14 */
755 { ns(struct sys___sigpending14_args), 0, 755 { ns(struct sys___sigpending14_args), 0,
756 (sy_call_t *)sys___sigpending14 }, /* 292 = __sigpending14 */ 756 (sy_call_t *)sys___sigpending14 }, /* 292 = __sigpending14 */
757 { ns(struct sys___sigprocmask14_args), 0, 757 { ns(struct sys___sigprocmask14_args), 0,
758 (sy_call_t *)sys___sigprocmask14 }, /* 293 = __sigprocmask14 */ 758 (sy_call_t *)sys___sigprocmask14 }, /* 293 = __sigprocmask14 */
759 { ns(struct sys___sigsuspend14_args), 0, 759 { ns(struct sys___sigsuspend14_args), 0,
760 (sy_call_t *)sys___sigsuspend14 }, /* 294 = __sigsuspend14 */ 760 (sy_call_t *)sys___sigsuspend14 }, /* 294 = __sigsuspend14 */
761 { ns(struct compat_16_sys___sigreturn14_args), 0, 761 { ns(struct compat_16_sys___sigreturn14_args), 0,
762 (sy_call_t *)sys_nomodule }, /* 295 = compat_16___sigreturn14 */ 762 (sy_call_t *)sys_nomodule }, /* 295 = compat_16___sigreturn14 */
763 { ns(struct sys___getcwd_args), 0, 763 { ns(struct sys___getcwd_args), 0,
764 (sy_call_t *)sys___getcwd }, /* 296 = __getcwd */ 764 (sy_call_t *)sys___getcwd }, /* 296 = __getcwd */
@@ -881,27 +881,27 @@ struct sysent sysent[] = { @@ -881,27 +881,27 @@ struct sysent sysent[] = {
881 (sy_call_t *)sys__sched_getparam }, /* 347 = _sched_getparam */ 881 (sy_call_t *)sys__sched_getparam }, /* 347 = _sched_getparam */
882 { ns(struct sys__sched_setaffinity_args), 0, 882 { ns(struct sys__sched_setaffinity_args), 0,
883 (sy_call_t *)sys__sched_setaffinity },/* 348 = _sched_setaffinity */ 883 (sy_call_t *)sys__sched_setaffinity },/* 348 = _sched_setaffinity */
884 { ns(struct sys__sched_getaffinity_args), 0, 884 { ns(struct sys__sched_getaffinity_args), 0,
885 (sy_call_t *)sys__sched_getaffinity },/* 349 = _sched_getaffinity */ 885 (sy_call_t *)sys__sched_getaffinity },/* 349 = _sched_getaffinity */
886 { 0, 0, 0, 886 { 0, 0, 0,
887 (sy_call_t *)sys_sched_yield }, /* 350 = sched_yield */ 887 (sy_call_t *)sys_sched_yield }, /* 350 = sched_yield */
888 { 0, 0, 0, 888 { 0, 0, 0,
889 sys_nosys }, /* 351 = unimplemented */ 889 sys_nosys }, /* 351 = unimplemented */
890 { 0, 0, 0, 890 { 0, 0, 0,
891 sys_nosys }, /* 352 = unimplemented */ 891 sys_nosys }, /* 352 = unimplemented */
892 { 0, 0, 0, 892 { 0, 0, 0,
893 sys_nosys }, /* 353 = unimplemented */ 893 sys_nosys }, /* 353 = unimplemented */
894 { ns(struct sys_fsync_range_args), 0, 894 { ns(struct sys_fsync_range_args), SYCALL_NARGS64_VAL(2) | SYCALL_ARG3_64 | SYCALL_ARG2_64,
895 (sy_call_t *)sys_fsync_range }, /* 354 = fsync_range */ 895 (sy_call_t *)sys_fsync_range }, /* 354 = fsync_range */
896 { ns(struct sys_uuidgen_args), 0, 896 { ns(struct sys_uuidgen_args), 0,
897 (sy_call_t *)sys_uuidgen }, /* 355 = uuidgen */ 897 (sy_call_t *)sys_uuidgen }, /* 355 = uuidgen */
898 { ns(struct sys_getvfsstat_args), 0, 898 { ns(struct sys_getvfsstat_args), 0,
899 (sy_call_t *)sys_getvfsstat }, /* 356 = getvfsstat */ 899 (sy_call_t *)sys_getvfsstat }, /* 356 = getvfsstat */
900 { ns(struct sys_statvfs1_args), 0, 900 { ns(struct sys_statvfs1_args), 0,
901 (sy_call_t *)sys_statvfs1 }, /* 357 = statvfs1 */ 901 (sy_call_t *)sys_statvfs1 }, /* 357 = statvfs1 */
902 { ns(struct sys_fstatvfs1_args), 0, 902 { ns(struct sys_fstatvfs1_args), 0,
903 (sy_call_t *)sys_fstatvfs1 }, /* 358 = fstatvfs1 */ 903 (sy_call_t *)sys_fstatvfs1 }, /* 358 = fstatvfs1 */
904 { ns(struct compat_30_sys_fhstatvfs1_args), 0, 904 { ns(struct compat_30_sys_fhstatvfs1_args), 0,
905 (sy_call_t *)sys_nomodule }, /* 359 = compat_30_fhstatvfs1 */ 905 (sy_call_t *)sys_nomodule }, /* 359 = compat_30_fhstatvfs1 */
906 { ns(struct sys_extattrctl_args), 0, 906 { ns(struct sys_extattrctl_args), 0,
907 (sy_call_t *)sys_extattrctl }, /* 360 = extattrctl */ 907 (sy_call_t *)sys_extattrctl }, /* 360 = extattrctl */
@@ -1005,27 +1005,27 @@ struct sysent sysent[] = { @@ -1005,27 +1005,27 @@ struct sysent sysent[] = {
1005 sys_nosys }, /* 409 = unimplemented */ 1005 sys_nosys }, /* 409 = unimplemented */
1006 { ns(struct sys___mount50_args), 0, 1006 { ns(struct sys___mount50_args), 0,
1007 (sy_call_t *)sys___mount50 }, /* 410 = __mount50 */ 1007 (sy_call_t *)sys___mount50 }, /* 410 = __mount50 */
1008 { ns(struct sys_mremap_args), 0, 1008 { ns(struct sys_mremap_args), 0,
1009 (sy_call_t *)sys_mremap }, /* 411 = mremap */ 1009 (sy_call_t *)sys_mremap }, /* 411 = mremap */
1010 { ns(struct sys_pset_create_args), 0, 1010 { ns(struct sys_pset_create_args), 0,
1011 (sy_call_t *)sys_pset_create }, /* 412 = pset_create */ 1011 (sy_call_t *)sys_pset_create }, /* 412 = pset_create */
1012 { ns(struct sys_pset_destroy_args), 0, 1012 { ns(struct sys_pset_destroy_args), 0,
1013 (sy_call_t *)sys_pset_destroy }, /* 413 = pset_destroy */ 1013 (sy_call_t *)sys_pset_destroy }, /* 413 = pset_destroy */
1014 { ns(struct sys_pset_assign_args), 0, 1014 { ns(struct sys_pset_assign_args), 0,
1015 (sy_call_t *)sys_pset_assign }, /* 414 = pset_assign */ 1015 (sy_call_t *)sys_pset_assign }, /* 414 = pset_assign */
1016 { ns(struct sys__pset_bind_args), 0, 1016 { ns(struct sys__pset_bind_args), 0,
1017 (sy_call_t *)sys__pset_bind }, /* 415 = _pset_bind */ 1017 (sy_call_t *)sys__pset_bind }, /* 415 = _pset_bind */
1018 { ns(struct sys___posix_fadvise50_args), 0, 1018 { ns(struct sys___posix_fadvise50_args), SYCALL_NARGS64_VAL(2) | SYCALL_ARG3_64 | SYCALL_ARG2_64,
1019 (sy_call_t *)sys___posix_fadvise50 },/* 416 = __posix_fadvise50 */ 1019 (sy_call_t *)sys___posix_fadvise50 },/* 416 = __posix_fadvise50 */
1020 { ns(struct sys___select50_args), 0, 1020 { ns(struct sys___select50_args), 0,
1021 (sy_call_t *)sys___select50 }, /* 417 = __select50 */ 1021 (sy_call_t *)sys___select50 }, /* 417 = __select50 */
1022 { ns(struct sys___gettimeofday50_args), 0, 1022 { ns(struct sys___gettimeofday50_args), 0,
1023 (sy_call_t *)sys___gettimeofday50 },/* 418 = __gettimeofday50 */ 1023 (sy_call_t *)sys___gettimeofday50 },/* 418 = __gettimeofday50 */
1024 { ns(struct sys___settimeofday50_args), 0, 1024 { ns(struct sys___settimeofday50_args), 0,
1025 (sy_call_t *)sys___settimeofday50 },/* 419 = __settimeofday50 */ 1025 (sy_call_t *)sys___settimeofday50 },/* 419 = __settimeofday50 */
1026 { ns(struct sys___utimes50_args), 0, 1026 { ns(struct sys___utimes50_args), 0,
1027 (sy_call_t *)sys___utimes50 }, /* 420 = __utimes50 */ 1027 (sy_call_t *)sys___utimes50 }, /* 420 = __utimes50 */
1028 { ns(struct sys___adjtime50_args), 0, 1028 { ns(struct sys___adjtime50_args), 0,
1029 (sy_call_t *)sys___adjtime50 }, /* 421 = __adjtime50 */ 1029 (sy_call_t *)sys___adjtime50 }, /* 421 = __adjtime50 */
1030#if defined(LFS) || !defined(_KERNEL) 1030#if defined(LFS) || !defined(_KERNEL)
1031 { ns(struct sys___lfs_segwait50_args), 0, 1031 { ns(struct sys___lfs_segwait50_args), 0,

cvs diff -r1.151 -r1.152 src/sys/kern/sys_process.c (expand / switch to unified diff)

--- src/sys/kern/sys_process.c 2009/10/21 21:12:06 1.151
+++ src/sys/kern/sys_process.c 2009/12/14 00:48:35 1.152
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: sys_process.c,v 1.151 2009/10/21 21:12:06 rmind Exp $ */ 1/* $NetBSD: sys_process.c,v 1.152 2009/12/14 00:48:35 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. 4 * Copyright (c) 2008, 2009 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 Andrew Doran. 8 * by Andrew Doran.
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.
@@ -108,27 +108,27 @@ @@ -108,27 +108,27 @@
108 108
109/* 109/*
110 * References: 110 * References:
111 * (1) Bach's "The Design of the UNIX Operating System", 111 * (1) Bach's "The Design of the UNIX Operating System",
112 * (2) sys/miscfs/procfs from UCB's 4.4BSD-Lite distribution, 112 * (2) sys/miscfs/procfs from UCB's 4.4BSD-Lite distribution,
113 * (3) the "4.4BSD Programmer's Reference Manual" published 113 * (3) the "4.4BSD Programmer's Reference Manual" published
114 * by USENIX and O'Reilly & Associates. 114 * by USENIX and O'Reilly & Associates.
115 * The 4.4BSD PRM does a reasonably good job of documenting what the various 115 * The 4.4BSD PRM does a reasonably good job of documenting what the various
116 * ptrace() requests should actually do, and its text is quoted several times 116 * ptrace() requests should actually do, and its text is quoted several times
117 * in this file. 117 * in this file.
118 */ 118 */
119 119
120#include <sys/cdefs.h> 120#include <sys/cdefs.h>
121__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.151 2009/10/21 21:12:06 rmind Exp $"); 121__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.152 2009/12/14 00:48:35 matt Exp $");
122 122
123#include "opt_ptrace.h" 123#include "opt_ptrace.h"
124#include "opt_ktrace.h" 124#include "opt_ktrace.h"
125 125
126#include <sys/param.h> 126#include <sys/param.h>
127#include <sys/systm.h> 127#include <sys/systm.h>
128#include <sys/proc.h> 128#include <sys/proc.h>
129#include <sys/errno.h> 129#include <sys/errno.h>
130#include <sys/ptrace.h> 130#include <sys/ptrace.h>
131#include <sys/uio.h> 131#include <sys/uio.h>
132#include <sys/user.h> 132#include <sys/user.h>
133#include <sys/ras.h> 133#include <sys/ras.h>
134#include <sys/kmem.h> 134#include <sys/kmem.h>
@@ -886,47 +886,55 @@ process_validregs(struct lwp *l) @@ -886,47 +886,55 @@ process_validregs(struct lwp *l)
886 return (0); 886 return (0);
887#endif 887#endif
888} 888}
889 889
890int 890int
891process_dofpregs(struct lwp *curl /*tracer*/, 891process_dofpregs(struct lwp *curl /*tracer*/,
892 struct lwp *l /*traced*/, 892 struct lwp *l /*traced*/,
893 struct uio *uio) 893 struct uio *uio)
894{ 894{
895#if defined(PT_GETFPREGS) || defined(PT_SETFPREGS) 895#if defined(PT_GETFPREGS) || defined(PT_SETFPREGS)
896 int error; 896 int error;
897 struct fpreg r; 897 struct fpreg r;
898 char *kv; 898 char *kv;
899 int kl; 899 size_t kl;
900 900
901 if (uio->uio_offset < 0 || uio->uio_offset > (off_t)sizeof(r)) 901 if (uio->uio_offset < 0 || uio->uio_offset > (off_t)sizeof(r))
902 return EINVAL; 902 return EINVAL;
903 903
904 kl = sizeof(r); 904 kl = sizeof(r);
905 kv = (char *)&r; 905 kv = (char *)&r;
906 906
907 kv += uio->uio_offset; 907 kv += uio->uio_offset;
908 kl -= uio->uio_offset; 908 kl -= uio->uio_offset;
909 if ((size_t)kl > uio->uio_resid) 909 if ((size_t)kl > uio->uio_resid)
910 kl = uio->uio_resid; 910 kl = uio->uio_resid;
911 911
 912#ifdef __HAVE_PROCESS_XFPREGS
 913 error = process_read_xfpregs(l, &r, &kl);
 914#else
912 error = process_read_fpregs(l, &r); 915 error = process_read_fpregs(l, &r);
 916#endif
913 if (error == 0) 917 if (error == 0)
914 error = uiomove(kv, kl, uio); 918 error = uiomove(kv, kl, uio);
915 if (error == 0 && uio->uio_rw == UIO_WRITE) { 919 if (error == 0 && uio->uio_rw == UIO_WRITE) {
916 if (l->l_stat != LSSTOP) 920 if (l->l_stat != LSSTOP)
917 error = EBUSY; 921 error = EBUSY;
918 else 922 else
 923#ifdef __HAVE_PROCESS_XFPREGS
 924 error = process_write_xfpregs(l, &r, kl);
 925#else
919 error = process_write_fpregs(l, &r); 926 error = process_write_fpregs(l, &r);
 927#endif
920 } 928 }
921 uio->uio_offset = 0; 929 uio->uio_offset = 0;
922 return (error); 930 return (error);
923#else 931#else
924 return (EINVAL); 932 return (EINVAL);
925#endif 933#endif
926} 934}
927 935
928int 936int
929process_validfpregs(struct lwp *l) 937process_validfpregs(struct lwp *l)
930{ 938{
931 939
932#if defined(PT_SETFPREGS) || defined(PT_GETFPREGS) 940#if defined(PT_SETFPREGS) || defined(PT_GETFPREGS)

cvs diff -r1.232 -r1.233 src/sys/kern/syscalls.c (expand / switch to unified diff)

--- src/sys/kern/syscalls.c 2009/10/13 21:57:53 1.232
+++ src/sys/kern/syscalls.c 2009/12/14 00:48:35 1.233
@@ -1,24 +1,24 @@ @@ -1,24 +1,24 @@
1/* $NetBSD: syscalls.c,v 1.232 2009/10/13 21:57:53 pooka Exp $ */ 1/* $NetBSD: syscalls.c,v 1.233 2009/12/14 00:48:35 matt Exp $ */
2 2
3/* 3/*
4 * System call names. 4 * System call names.
5 * 5 *
6 * DO NOT EDIT-- this file is automatically generated. 6 * DO NOT EDIT-- this file is automatically generated.
7 * created from NetBSD: syscalls.master,v 1.229 2009/07/21 23:59:00 pooka Exp 7 * created from NetBSD
8 */ 8 */
9 9
10#include <sys/cdefs.h> 10#include <sys/cdefs.h>
11__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.232 2009/10/13 21:57:53 pooka Exp $"); 11__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.233 2009/12/14 00:48:35 matt Exp $");
12 12
13#if defined(_KERNEL_OPT) 13#if defined(_KERNEL_OPT)
14#include "opt_modular.h" 14#include "opt_modular.h"
15#include "opt_ntp.h" 15#include "opt_ntp.h"
16#include "opt_sysv.h" 16#include "opt_sysv.h"
17#include "fs_lfs.h" 17#include "fs_lfs.h"
18#include <sys/param.h> 18#include <sys/param.h>
19#include <sys/systm.h> 19#include <sys/systm.h>
20#include <sys/signal.h> 20#include <sys/signal.h>
21#include <sys/mount.h> 21#include <sys/mount.h>
22#include <sys/sched.h> 22#include <sys/sched.h>
23#include <sys/syscallargs.h> 23#include <sys/syscallargs.h>
24#endif /* _KERNEL_OPT */ 24#endif /* _KERNEL_OPT */

cvs diff -r1.20 -r1.21 src/sys/lib/libkern/arch/mips/Makefile.inc (expand / switch to unified diff)

--- src/sys/lib/libkern/arch/mips/Makefile.inc 2009/08/14 19:23:54 1.20
+++ src/sys/lib/libkern/arch/mips/Makefile.inc 2009/12/14 00:48:35 1.21
@@ -1,9 +1,14 @@ @@ -1,9 +1,14 @@
1# $NetBSD: Makefile.inc,v 1.20 2009/08/14 19:23:54 dsl Exp $ 1# $NetBSD: Makefile.inc,v 1.21 2009/12/14 00:48:35 matt Exp $
2# 2#
3# There are likely more that we will notice when we go native 3# There are likely more that we will notice when we go native
4 4
5NO_SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c 5NO_SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c
6NO_SRCS+= __main.c 6NO_SRCS+= __main.c
7 7
8SRCS+= byte_swap_2.S byte_swap_4.S ffs.S memcpy.S memset.S memmove.S 8SRCS+= __assert.c memchr.c memcmp.c random.c scanc.c \
9SRCS+= strlen.S strcmp.S 9 skpc.c strcat.c strcpy.c strcasecmp.c \
 10 strncasecmp.c strncmp.c strncpy.c strtoul.c
 11
 12SRCS+= byte_swap_2.S byte_swap_4.S byte_swap_8.S \
 13 ffs.S memcpy.S memset2.c memmove.S \
 14 strlen.S strcmp.S

cvs diff -r1.128 -r1.129 src/sys/sys/exec.h (expand / switch to unified diff)

--- src/sys/sys/exec.h 2009/12/10 14:13:54 1.128
+++ src/sys/sys/exec.h 2009/12/14 00:48:35 1.129
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: exec.h,v 1.128 2009/12/10 14:13:54 matt Exp $ */ 1/* $NetBSD: exec.h,v 1.129 2009/12/14 00:48:35 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1992, 1993 4 * Copyright (c) 1992, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * (c) UNIX System Laboratories, Inc. 6 * (c) UNIX System Laboratories, Inc.
7 * All or some portions of this file are derived from material licensed 7 * All or some portions of this file are derived from material licensed
8 * to the University of California by American Telephone and Telegraph 8 * to the University of California by American Telephone and Telegraph
9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 9 * Co. or Unix System Laboratories, Inc. and are reproduced herein with
10 * the permission of UNIX System Laboratories, Inc. 10 * the permission of UNIX System Laboratories, Inc.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -205,27 +205,27 @@ struct exec_package { @@ -205,27 +205,27 @@ struct exec_package {
205#define EXEC_INDIR 0x0001 /* script handling already done */ 205#define EXEC_INDIR 0x0001 /* script handling already done */
206#define EXEC_HASFD 0x0002 /* holding a shell script */ 206#define EXEC_HASFD 0x0002 /* holding a shell script */
207#define EXEC_HASARGL 0x0004 /* has fake args vector */ 207#define EXEC_HASARGL 0x0004 /* has fake args vector */
208#define EXEC_SKIPARG 0x0008 /* don't copy user-supplied argv[0] */ 208#define EXEC_SKIPARG 0x0008 /* don't copy user-supplied argv[0] */
209#define EXEC_DESTR 0x0010 /* destructive ops performed */ 209#define EXEC_DESTR 0x0010 /* destructive ops performed */
210#define EXEC_32 0x0020 /* 32-bit binary emulation */ 210#define EXEC_32 0x0020 /* 32-bit binary emulation */
211 211
212struct exec_vmcmd { 212struct exec_vmcmd {
213 int (*ev_proc)(struct lwp *, struct exec_vmcmd *); 213 int (*ev_proc)(struct lwp *, struct exec_vmcmd *);
214 /* procedure to run for region of vmspace */ 214 /* procedure to run for region of vmspace */
215 vsize_t ev_len; /* length of the segment to map */ 215 vsize_t ev_len; /* length of the segment to map */
216 vaddr_t ev_addr; /* address in the vmspace to place it at */ 216 vaddr_t ev_addr; /* address in the vmspace to place it at */
217 struct vnode *ev_vp; /* vnode pointer for the file w/the data */ 217 struct vnode *ev_vp; /* vnode pointer for the file w/the data */
218 u_long ev_offset; /* offset in the file for the data */ 218 vsize_t ev_offset; /* offset in the file for the data */
219 u_int ev_prot; /* protections for segment */ 219 u_int ev_prot; /* protections for segment */
220 int ev_flags; 220 int ev_flags;
221#define VMCMD_RELATIVE 0x0001 /* ev_addr is relative to base entry */ 221#define VMCMD_RELATIVE 0x0001 /* ev_addr is relative to base entry */
222#define VMCMD_BASE 0x0002 /* marks a base entry */ 222#define VMCMD_BASE 0x0002 /* marks a base entry */
223#define VMCMD_FIXED 0x0004 /* entry must be mapped at ev_addr */ 223#define VMCMD_FIXED 0x0004 /* entry must be mapped at ev_addr */
224#define VMCMD_STACK 0x0008 /* entry is for a stack */ 224#define VMCMD_STACK 0x0008 /* entry is for a stack */
225}; 225};
226 226
227#ifdef _KERNEL 227#ifdef _KERNEL
228/* 228/*
229 * funtions used either by execve() or the various CPU-dependent execve() 229 * funtions used either by execve() or the various CPU-dependent execve()
230 * hooks. 230 * hooks.
231 */ 231 */

cvs diff -r1.41 -r1.42 src/sys/sys/ptrace.h (expand / switch to unified diff)

--- src/sys/sys/ptrace.h 2009/10/02 22:18:56 1.41
+++ src/sys/sys/ptrace.h 2009/12/14 00:48:35 1.42
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ptrace.h,v 1.41 2009/10/02 22:18:56 elad Exp $ */ 1/* $NetBSD: ptrace.h,v 1.42 2009/12/14 00:48:35 matt Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1984, 1993 4 * Copyright (c) 1984, 1993
5 * The Regents of the University of California. All rights reserved. 5 * The Regents of the University of California. All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -103,48 +103,62 @@ void ptrace_init(void); @@ -103,48 +103,62 @@ void ptrace_init(void);
103 103
104int process_doregs(struct lwp *, struct lwp *, struct uio *); 104int process_doregs(struct lwp *, struct lwp *, struct uio *);
105int process_validregs(struct lwp *); 105int process_validregs(struct lwp *);
106 106
107int process_dofpregs(struct lwp *, struct lwp *, struct uio *); 107int process_dofpregs(struct lwp *, struct lwp *, struct uio *);
108int process_validfpregs(struct lwp *); 108int process_validfpregs(struct lwp *);
109 109
110int process_domem(struct lwp *, struct lwp *, struct uio *); 110int process_domem(struct lwp *, struct lwp *, struct uio *);
111 111
112void process_stoptrace(void); 112void process_stoptrace(void);
113 113
114void proc_reparent(struct proc *, struct proc *); 114void proc_reparent(struct proc *, struct proc *);
115#ifdef PT_GETFPREGS 115#ifdef PT_GETFPREGS
 116#ifdef __HAVE_PROCESS_XFPREGS
 117int process_read_xfpregs(struct lwp *, struct fpreg *, size_t *);
 118#ifndef process_read_xfpregs32
 119#define process_read_xfpregs32 process_read_xfpregs
 120#endif
 121#ifndef process_read_xfpregs64
 122#define process_read_xfpregs64 process_read_xfpregs
 123#endif
 124#else
116int process_read_fpregs(struct lwp *, struct fpreg *); 125int process_read_fpregs(struct lwp *, struct fpreg *);
117#ifndef process_read_fpregs32 126#ifndef process_read_fpregs32
118#define process_read_fpregs32 process_read_fpregs 127#define process_read_fpregs32 process_read_fpregs
119#endif 128#endif
120#ifndef process_read_fpregs64 129#ifndef process_read_fpregs64
121#define process_read_fpregs64 process_read_fpregs 130#define process_read_fpregs64 process_read_fpregs
122#endif 131#endif
123#endif 132#endif
 133#endif
124#ifdef PT_GETREGS 134#ifdef PT_GETREGS
125int process_read_regs(struct lwp *, struct reg *); 135int process_read_regs(struct lwp *, struct reg *);
126#ifndef process_read_regs32 136#ifndef process_read_regs32
127#define process_read_regs32 process_read_regs 137#define process_read_regs32 process_read_regs
128#endif 138#endif
129#ifndef process_read_regs64 139#ifndef process_read_regs64
130#define process_read_regs64 process_read_regs 140#define process_read_regs64 process_read_regs
131#endif 141#endif
132#endif 142#endif
133int process_set_pc(struct lwp *, void *); 143int process_set_pc(struct lwp *, void *);
134int process_sstep(struct lwp *, int); 144int process_sstep(struct lwp *, int);
135#ifdef PT_SETFPREGS 145#ifdef PT_SETFPREGS
 146#ifdef __HAVE_PROCESS_XFPREGS
 147int process_write_xfpregs(struct lwp *, const struct fpreg *, size_t);
 148#else
136int process_write_fpregs(struct lwp *, const struct fpreg *); 149int process_write_fpregs(struct lwp *, const struct fpreg *);
137#endif 150#endif
 151#endif
138#ifdef PT_SETREGS 152#ifdef PT_SETREGS
139int process_write_regs(struct lwp *, const struct reg *); 153int process_write_regs(struct lwp *, const struct reg *);
140#endif 154#endif
141 155
142#ifdef __HAVE_PROCFS_MACHDEP 156#ifdef __HAVE_PROCFS_MACHDEP
143int ptrace_machdep_dorequest(struct lwp *, struct lwp *, int, 157int ptrace_machdep_dorequest(struct lwp *, struct lwp *, int,
144 void *, int); 158 void *, int);
145#endif 159#endif
146 160
147#ifndef FIX_SSTEP 161#ifndef FIX_SSTEP
148#define FIX_SSTEP(p) 162#define FIX_SSTEP(p)
149#endif 163#endif
150 164