Module Name: src Committed By: matt Date: Mon Dec 14 00:48:36 UTC 2009
Modified Files: src/sys/kern: core_elf32.c exec_elf.c init_sysent.c sys_process.c syscalls.c src/sys/lib/libkern/arch/mips: Makefile.inc src/sys/sys: exec.h ptrace.h Log Message: Merge from matt-nb5-mips64 To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/kern/core_elf32.c cvs rdiff -u -r1.11 -r1.12 src/sys/kern/exec_elf.c cvs rdiff -u -r1.241 -r1.242 src/sys/kern/init_sysent.c cvs rdiff -u -r1.151 -r1.152 src/sys/kern/sys_process.c cvs rdiff -u -r1.232 -r1.233 src/sys/kern/syscalls.c cvs rdiff -u -r1.20 -r1.21 src/sys/lib/libkern/arch/mips/Makefile.inc cvs rdiff -u -r1.128 -r1.129 src/sys/sys/exec.h cvs rdiff -u -r1.41 -r1.42 src/sys/sys/ptrace.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/core_elf32.c diff -u src/sys/kern/core_elf32.c:1.34 src/sys/kern/core_elf32.c:1.35 --- src/sys/kern/core_elf32.c:1.34 Wed Oct 21 21:12:06 2009 +++ src/sys/kern/core_elf32.c Mon Dec 14 00:48:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: core_elf32.c,v 1.34 2009/10/21 21:12:06 rmind Exp $ */ +/* $NetBSD: core_elf32.c,v 1.35 2009/12/14 00:48:35 matt Exp $ */ /* * Copyright (c) 2001 Wasabi Systems, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.34 2009/10/21 21:12:06 rmind Exp $"); +__KERNEL_RCSID(1, "$NetBSD: core_elf32.c,v 1.35 2009/12/14 00:48:35 matt Exp $"); #ifdef _KERNEL_OPT #include "opt_coredump.h" @@ -90,7 +90,11 @@ #define elfround(x) roundup((x), ELFROUNDSIZE) #define elf_process_read_regs CONCAT(process_read_regs, ELFSIZE) +#ifdef __HAVE_PROCESS_XFPREGS +#define elf_process_read_xfpregs CONCAT(process_read_xfpregs, ELFSIZE) +#else #define elf_process_read_fpregs CONCAT(process_read_fpregs, ELFSIZE) +#endif #define elf_reg CONCAT(process_reg, ELFSIZE) #define elf_fpreg CONCAT(process_fpreg, ELFSIZE) @@ -162,6 +166,10 @@ ehdr.e_shnum = 0; ehdr.e_shstrndx = 0; +#ifdef ELF_MD_COREDUMP_SETUP + ELF_MD_COREDUMP_SETUP(l, &ehdr); +#endif + /* Write out the ELF header. */ error = coredump_write(cookie, UIO_SYSSPACE, &ehdr, sizeof(ehdr)); if (error) @@ -451,12 +459,17 @@ #ifdef PT_GETFPREGS notesize = sizeof(nhdr) + elfround(namesize) + elfround(sizeof(freg)); if (iocookie) { + size_t freglen = sizeof(freg); +#ifdef __HAVE_PROCESS_XFPREGS + error = elf_process_read_xfpregs(l, &freg, &freglen); +#else error = elf_process_read_fpregs(l, &freg); +#endif if (error) return (error); nhdr.n_namesz = namesize; - nhdr.n_descsz = sizeof(freg); + nhdr.n_descsz = freglen; nhdr.n_type = PT_GETFPREGS; error = ELFNAMEEND(coredump_writenote)(p, iocookie, &nhdr, Index: src/sys/kern/exec_elf.c diff -u src/sys/kern/exec_elf.c:1.11 src/sys/kern/exec_elf.c:1.12 --- src/sys/kern/exec_elf.c:1.11 Wed Dec 17 20:51:35 2008 +++ src/sys/kern/exec_elf.c Mon Dec 14 00:48:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf.c,v 1.11 2008/12/17 20:51:35 cegger Exp $ */ +/* $NetBSD: exec_elf.c,v 1.12 2009/12/14 00:48:35 matt Exp $ */ /*- * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.11 2008/12/17 20:51:35 cegger Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.12 2009/12/14 00:48:35 matt Exp $"); #ifdef _KERNEL_OPT #include "opt_pax.h" @@ -909,7 +909,10 @@ if ((error = netbsd_elf_signature(l, epp, eh)) != 0) return error; -#ifdef ELF_INTERP_NON_RELOCATABLE +#ifdef ELF_MD_PROBE_FUNC + if ((error = ELF_MD_PROBE_FUNC(l, epp, eh, itp, pos)) != 0) + return error; +#elif defined(ELF_INTERP_NON_RELOCATABLE) *pos = ELF_LINK_ADDR; #endif return 0; Index: src/sys/kern/init_sysent.c diff -u src/sys/kern/init_sysent.c:1.241 src/sys/kern/init_sysent.c:1.242 --- src/sys/kern/init_sysent.c:1.241 Tue Oct 13 21:57:53 2009 +++ src/sys/kern/init_sysent.c Mon Dec 14 00:48:35 2009 @@ -1,14 +1,14 @@ -/* $NetBSD: init_sysent.c,v 1.241 2009/10/13 21:57:53 pooka Exp $ */ +/* $NetBSD: init_sysent.c,v 1.242 2009/12/14 00:48:35 matt Exp $ */ /* * System call switch table. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.229 2009/07/21 23:59:00 pooka Exp + * created from NetBSD */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.241 2009/10/13 21:57:53 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: init_sysent.c,v 1.242 2009/12/14 00:48:35 matt Exp $"); #include "opt_modular.h" #include "opt_ntp.h" @@ -465,9 +465,9 @@ #endif { 0, 0, 0, sys_nosys }, /* 172 = unimplemented */ - { ns(struct sys_pread_args), 0, + { ns(struct sys_pread_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)sys_pread }, /* 173 = pread */ - { ns(struct sys_pwrite_args), 0, + { ns(struct sys_pwrite_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)sys_pwrite }, /* 174 = pwrite */ { ns(struct compat_30_sys_ntp_gettime_args), 0, (sy_call_t *)compat_30(sys_ntp_gettime) },/* 175 = compat_30_ntp_gettime */ @@ -529,15 +529,15 @@ (sy_call_t *)sys_setrlimit }, /* 195 = setrlimit */ { ns(struct compat_12_sys_getdirentries_args), 0, (sy_call_t *)sys_nomodule }, /* 196 = compat_12_getdirentries */ - { ns(struct sys_mmap_args), 0, + { ns(struct sys_mmap_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG6_64, (sy_call_t *)sys_mmap }, /* 197 = mmap */ - { ns(struct sys___syscall_args), SYCALL_INDIRECT, + { ns(struct sys___syscall_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG0_64 | SYCALL_RET_64 | SYCALL_INDIRECT, (sy_call_t *)sys___syscall }, /* 198 = __syscall */ - { ns(struct sys_lseek_args), 0, + { ns(struct sys_lseek_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64 | SYCALL_RET_64, (sy_call_t *)sys_lseek }, /* 199 = lseek */ - { ns(struct sys_truncate_args), 0, + { ns(struct sys_truncate_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64, (sy_call_t *)sys_truncate }, /* 200 = truncate */ - { ns(struct sys_ftruncate_args), 0, + { ns(struct sys_ftruncate_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG2_64, (sy_call_t *)sys_ftruncate }, /* 201 = ftruncate */ { ns(struct sys___sysctl_args), 0, (sy_call_t *)sys___sysctl }, /* 202 = __sysctl */ @@ -746,9 +746,9 @@ (sy_call_t *)sys___clone }, /* 287 = __clone */ { ns(struct sys_fktrace_args), 0, (sy_call_t *)sys_fktrace }, /* 288 = fktrace */ - { ns(struct sys_preadv_args), 0, + { ns(struct sys_preadv_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)sys_preadv }, /* 289 = preadv */ - { ns(struct sys_pwritev_args), 0, + { ns(struct sys_pwritev_args), SYCALL_NARGS64_VAL(1) | SYCALL_ARG4_64, (sy_call_t *)sys_pwritev }, /* 290 = pwritev */ { ns(struct compat_16_sys___sigaction14_args), 0, (sy_call_t *)sys_nomodule }, /* 291 = compat_16___sigaction14 */ @@ -891,7 +891,7 @@ sys_nosys }, /* 352 = unimplemented */ { 0, 0, 0, sys_nosys }, /* 353 = unimplemented */ - { ns(struct sys_fsync_range_args), 0, + { ns(struct sys_fsync_range_args), SYCALL_NARGS64_VAL(2) | SYCALL_ARG3_64 | SYCALL_ARG2_64, (sy_call_t *)sys_fsync_range }, /* 354 = fsync_range */ { ns(struct sys_uuidgen_args), 0, (sy_call_t *)sys_uuidgen }, /* 355 = uuidgen */ @@ -1015,7 +1015,7 @@ (sy_call_t *)sys_pset_assign }, /* 414 = pset_assign */ { ns(struct sys__pset_bind_args), 0, (sy_call_t *)sys__pset_bind }, /* 415 = _pset_bind */ - { ns(struct sys___posix_fadvise50_args), 0, + { ns(struct sys___posix_fadvise50_args), SYCALL_NARGS64_VAL(2) | SYCALL_ARG3_64 | SYCALL_ARG2_64, (sy_call_t *)sys___posix_fadvise50 },/* 416 = __posix_fadvise50 */ { ns(struct sys___select50_args), 0, (sy_call_t *)sys___select50 }, /* 417 = __select50 */ Index: src/sys/kern/sys_process.c diff -u src/sys/kern/sys_process.c:1.151 src/sys/kern/sys_process.c:1.152 --- src/sys/kern/sys_process.c:1.151 Wed Oct 21 21:12:06 2009 +++ src/sys/kern/sys_process.c Mon Dec 14 00:48:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: sys_process.c,v 1.151 2009/10/21 21:12:06 rmind Exp $ */ +/* $NetBSD: sys_process.c,v 1.152 2009/12/14 00:48:35 matt Exp $ */ /*- * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc. @@ -118,7 +118,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.151 2009/10/21 21:12:06 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: sys_process.c,v 1.152 2009/12/14 00:48:35 matt Exp $"); #include "opt_ptrace.h" #include "opt_ktrace.h" @@ -896,7 +896,7 @@ int error; struct fpreg r; char *kv; - int kl; + size_t kl; if (uio->uio_offset < 0 || uio->uio_offset > (off_t)sizeof(r)) return EINVAL; @@ -909,14 +909,22 @@ if ((size_t)kl > uio->uio_resid) kl = uio->uio_resid; +#ifdef __HAVE_PROCESS_XFPREGS + error = process_read_xfpregs(l, &r, &kl); +#else error = process_read_fpregs(l, &r); +#endif if (error == 0) error = uiomove(kv, kl, uio); if (error == 0 && uio->uio_rw == UIO_WRITE) { if (l->l_stat != LSSTOP) error = EBUSY; else +#ifdef __HAVE_PROCESS_XFPREGS + error = process_write_xfpregs(l, &r, kl); +#else error = process_write_fpregs(l, &r); +#endif } uio->uio_offset = 0; return (error); Index: src/sys/kern/syscalls.c diff -u src/sys/kern/syscalls.c:1.232 src/sys/kern/syscalls.c:1.233 --- src/sys/kern/syscalls.c:1.232 Tue Oct 13 21:57:53 2009 +++ src/sys/kern/syscalls.c Mon Dec 14 00:48:35 2009 @@ -1,14 +1,14 @@ -/* $NetBSD: syscalls.c,v 1.232 2009/10/13 21:57:53 pooka Exp $ */ +/* $NetBSD: syscalls.c,v 1.233 2009/12/14 00:48:35 matt Exp $ */ /* * System call names. * * DO NOT EDIT-- this file is automatically generated. - * created from NetBSD: syscalls.master,v 1.229 2009/07/21 23:59:00 pooka Exp + * created from NetBSD */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.232 2009/10/13 21:57:53 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: syscalls.c,v 1.233 2009/12/14 00:48:35 matt Exp $"); #if defined(_KERNEL_OPT) #include "opt_modular.h" Index: src/sys/lib/libkern/arch/mips/Makefile.inc diff -u src/sys/lib/libkern/arch/mips/Makefile.inc:1.20 src/sys/lib/libkern/arch/mips/Makefile.inc:1.21 --- src/sys/lib/libkern/arch/mips/Makefile.inc:1.20 Fri Aug 14 19:23:54 2009 +++ src/sys/lib/libkern/arch/mips/Makefile.inc Mon Dec 14 00:48:35 2009 @@ -1,9 +1,14 @@ -# $NetBSD: Makefile.inc,v 1.20 2009/08/14 19:23:54 dsl Exp $ +# $NetBSD: Makefile.inc,v 1.21 2009/12/14 00:48:35 matt Exp $ # # There are likely more that we will notice when we go native NO_SRCS+= imax.c imin.c lmax.c lmin.c max.c min.c ulmax.c ulmin.c NO_SRCS+= __main.c -SRCS+= byte_swap_2.S byte_swap_4.S ffs.S memcpy.S memset.S memmove.S -SRCS+= strlen.S strcmp.S +SRCS+= __assert.c memchr.c memcmp.c random.c scanc.c \ + skpc.c strcat.c strcpy.c strcasecmp.c \ + strncasecmp.c strncmp.c strncpy.c strtoul.c + +SRCS+= byte_swap_2.S byte_swap_4.S byte_swap_8.S \ + ffs.S memcpy.S memset2.c memmove.S \ + strlen.S strcmp.S Index: src/sys/sys/exec.h diff -u src/sys/sys/exec.h:1.128 src/sys/sys/exec.h:1.129 --- src/sys/sys/exec.h:1.128 Thu Dec 10 14:13:54 2009 +++ src/sys/sys/exec.h Mon Dec 14 00:48:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: exec.h,v 1.128 2009/12/10 14:13:54 matt Exp $ */ +/* $NetBSD: exec.h,v 1.129 2009/12/14 00:48:35 matt Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -215,7 +215,7 @@ vsize_t ev_len; /* length of the segment to map */ vaddr_t ev_addr; /* address in the vmspace to place it at */ struct vnode *ev_vp; /* vnode pointer for the file w/the data */ - u_long ev_offset; /* offset in the file for the data */ + vsize_t ev_offset; /* offset in the file for the data */ u_int ev_prot; /* protections for segment */ int ev_flags; #define VMCMD_RELATIVE 0x0001 /* ev_addr is relative to base entry */ Index: src/sys/sys/ptrace.h diff -u src/sys/sys/ptrace.h:1.41 src/sys/sys/ptrace.h:1.42 --- src/sys/sys/ptrace.h:1.41 Fri Oct 2 22:18:56 2009 +++ src/sys/sys/ptrace.h Mon Dec 14 00:48:35 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: ptrace.h,v 1.41 2009/10/02 22:18:56 elad Exp $ */ +/* $NetBSD: ptrace.h,v 1.42 2009/12/14 00:48:35 matt Exp $ */ /*- * Copyright (c) 1984, 1993 @@ -113,6 +113,15 @@ void proc_reparent(struct proc *, struct proc *); #ifdef PT_GETFPREGS +#ifdef __HAVE_PROCESS_XFPREGS +int process_read_xfpregs(struct lwp *, struct fpreg *, size_t *); +#ifndef process_read_xfpregs32 +#define process_read_xfpregs32 process_read_xfpregs +#endif +#ifndef process_read_xfpregs64 +#define process_read_xfpregs64 process_read_xfpregs +#endif +#else int process_read_fpregs(struct lwp *, struct fpreg *); #ifndef process_read_fpregs32 #define process_read_fpregs32 process_read_fpregs @@ -121,6 +130,7 @@ #define process_read_fpregs64 process_read_fpregs #endif #endif +#endif #ifdef PT_GETREGS int process_read_regs(struct lwp *, struct reg *); #ifndef process_read_regs32 @@ -133,8 +143,12 @@ int process_set_pc(struct lwp *, void *); int process_sstep(struct lwp *, int); #ifdef PT_SETFPREGS +#ifdef __HAVE_PROCESS_XFPREGS +int process_write_xfpregs(struct lwp *, const struct fpreg *, size_t); +#else int process_write_fpregs(struct lwp *, const struct fpreg *); #endif +#endif #ifdef PT_SETREGS int process_write_regs(struct lwp *, const struct reg *); #endif