Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys Remove __HAVE_PROCESS_XFPREGS and add the extra paramete...



details:   https://anonhg.NetBSD.org/src/rev/c3d2d1ec3fcf
branches:  trunk
changeset: 325715:c3d2d1ec3fcf
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sat Jan 04 00:10:02 2014 +0000

description:
Remove __HAVE_PROCESS_XFPREGS and add the extra parameter for the size
  of the fp save area to all the process_read_fpregs() and
  process_write_fpregs() functions.
None of the functions have been modified to use the new parameters.
The size is set for all the writes, but some of the arch-specific reads
  just pass NULL.
The amd64 (and i386) need variable sized fp register save areas in order
  to support AVX and other enhanced register areas.
These functions are rarely called - so the extra argument won't matter.

diffstat:

 sys/arch/alpha/alpha/process_machdep.c       |   8 ++++----
 sys/arch/amd64/amd64/netbsd32_machdep.c      |  12 +++++++-----
 sys/arch/amd64/amd64/process_machdep.c       |   8 ++++----
 sys/arch/amd64/include/netbsd32_machdep.h    |   8 ++++++--
 sys/arch/arm/arm/core_machdep.c              |   6 +++---
 sys/arch/arm/arm/process_machdep.c           |   8 ++++----
 sys/arch/hppa/hppa/core_machdep.c            |   6 +++---
 sys/arch/hppa/hppa/process_machdep.c         |   8 ++++----
 sys/arch/i386/i386/process_machdep.c         |   8 ++++----
 sys/arch/ia64/ia64/process_machdep.c         |   8 ++++----
 sys/arch/m68k/include/reg.h                  |   4 ++--
 sys/arch/m68k/m68k/core_machdep.c            |   6 +++---
 sys/arch/m68k/m68k/process_machdep.c         |   8 ++++----
 sys/arch/mips/include/types.h                |   3 +--
 sys/arch/mips/mips/process_machdep.c         |   8 ++++----
 sys/arch/powerpc/powerpc/process_machdep.c   |   8 ++++----
 sys/arch/sparc/sparc/process_machdep.c       |   8 ++++----
 sys/arch/sparc64/include/netbsd32_machdep.h  |   4 ++--
 sys/arch/sparc64/sparc64/netbsd32_machdep.c  |   6 +++---
 sys/arch/sparc64/sparc64/process_machdep.c   |   8 ++++----
 sys/arch/usermode/usermode/process_machdep.c |   8 ++++----
 sys/arch/x86/x86/core_machdep.c              |   8 +++++---
 sys/compat/linux/arch/amd64/linux_machdep.c  |   7 ++++---
 sys/compat/linux/arch/i386/linux_ptrace.c    |  12 +++++++-----
 sys/compat/linux/arch/powerpc/linux_ptrace.c |   8 ++++----
 sys/kern/core_elf32.c                        |  14 +++-----------
 sys/kern/sys_process.c                       |  16 ++++------------
 sys/sys/ptrace.h                             |  26 +++++++++-----------------
 28 files changed, 114 insertions(+), 128 deletions(-)

diffs (truncated from 959 to 300 lines):

diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/alpha/alpha/process_machdep.c
--- a/sys/arch/alpha/alpha/process_machdep.c    Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/alpha/alpha/process_machdep.c    Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: process_machdep.c,v 1.27 2012/02/06 02:14:12 matt Exp $ */
+/* $NetBSD: process_machdep.c,v 1.28 2014/01/04 00:10:02 dsl Exp $ */
 
 /*
  * Copyright (c) 1994 Christopher G. Demetriou
@@ -54,7 +54,7 @@
 
 #include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.27 2012/02/06 02:14:12 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.28 2014/01/04 00:10:02 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -112,7 +112,7 @@
 }
 
 int
-process_read_fpregs(struct lwp *l, struct fpreg *regs)
+process_read_fpregs(struct lwp *l, struct fpreg *regs, size_t *sz)
 {
        struct pcb *pcb = lwp_getpcb(l);
 
@@ -123,7 +123,7 @@
 }
 
 int
-process_write_fpregs(struct lwp *l, const struct fpreg *regs)
+process_write_fpregs(struct lwp *l, const struct fpreg *regs, size_t sz)
 {
        struct pcb *pcb = lwp_getpcb(l);
 
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/amd64/amd64/netbsd32_machdep.c
--- a/sys/arch/amd64/amd64/netbsd32_machdep.c   Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/amd64/amd64/netbsd32_machdep.c   Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.c,v 1.86 2014/01/01 18:57:15 dsl Exp $        */
+/*     $NetBSD: netbsd32_machdep.c,v 1.87 2014/01/04 00:10:02 dsl Exp $        */
 
 /*
  * Copyright (c) 2001 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.86 2014/01/01 18:57:15 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: netbsd32_machdep.c,v 1.87 2014/01/04 00:10:02 dsl Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -486,7 +486,7 @@
                return error;
 
        /* Save floating point registers. */
-       error = netbsd32_process_read_fpregs(l, &md_core.freg);
+       error = netbsd32_process_read_fpregs(l, &md_core.freg, NULL);
        if (error)
                return error;
 
@@ -569,10 +569,11 @@
 }
 
 int
-netbsd32_process_read_fpregs(struct lwp *l, struct fpreg32 *regs)
+netbsd32_process_read_fpregs(struct lwp *l, struct fpreg32 *regs, size_t *sz)
 {
        struct fpreg regs64;
        struct save87 *s87 = (struct save87 *)regs;
+       size_t fp_size;
        int error, i;
 
        union fp_addr {
@@ -596,7 +597,8 @@
         * All that stuff makes no sense in i386 code :(
         */
 
-       error = process_read_fpregs(l, &regs64);
+       fp_size = sizeof regs64;
+       error = process_read_fpregs(l, &regs64, &fp_size);
        if (error)
                return error;
 
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/amd64/amd64/process_machdep.c
--- a/sys/arch/amd64/amd64/process_machdep.c    Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/amd64/amd64/process_machdep.c    Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.24 2013/12/12 22:41:03 dsl Exp $ */
+/*     $NetBSD: process_machdep.c,v 1.25 2014/01/04 00:10:02 dsl Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -53,7 +53,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.24 2013/12/12 22:41:03 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.25 2014/01/04 00:10:02 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -103,7 +103,7 @@
 }
 
 int
-process_read_fpregs(struct lwp *l, struct fpreg *regs)
+process_read_fpregs(struct lwp *l, struct fpreg *regs,size_t *sz)
 {
        struct fxsave64 *frame = process_fpframe(l);
 
@@ -158,7 +158,7 @@
 }
 
 int
-process_write_fpregs(struct lwp *l, const struct fpreg *regs)
+process_write_fpregs(struct lwp *l, const struct fpreg *regs, size_t sz)
 {
        struct fxsave64 *frame = process_fpframe(l);
 
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/amd64/include/netbsd32_machdep.h
--- a/sys/arch/amd64/include/netbsd32_machdep.h Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/amd64/include/netbsd32_machdep.h Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: netbsd32_machdep.h,v 1.17 2012/02/19 21:06:02 rmind Exp $      */
+/*     $NetBSD: netbsd32_machdep.h,v 1.18 2014/01/04 00:10:02 dsl Exp $        */
 
 #ifndef _MACHINE_NETBSD32_H_
 #define _MACHINE_NETBSD32_H_
@@ -151,6 +151,10 @@
 struct save87 {
        struct env87    sv_env;
        struct fpacc87  sv_ac[8];
+       /*
+        * The fields below are not in the 'struct fpreg32' that is
+        * otherwise the same as this structure (for coredumps).
+        */
        int32_t         sv_ex_sw;
        int32_t         sv_ex_tw;
        uint8_t         sv_pad[8 * 2 - 2 * 4];
@@ -159,6 +163,6 @@
 #define NETBSD32_MID_MACHINE MID_I386
 
 int netbsd32_process_read_regs(struct lwp *, struct reg32 *);
-int netbsd32_process_read_fpregs(struct lwp *, struct fpreg32 *);
+int netbsd32_process_read_fpregs(struct lwp *, struct fpreg32 *, size_t *);
 
 #endif /* _MACHINE_NETBSD32_H_ */
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/arm/arm/core_machdep.c
--- a/sys/arch/arm/arm/core_machdep.c   Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/arm/arm/core_machdep.c   Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: core_machdep.c,v 1.3 2014/01/01 18:57:15 dsl Exp $     */
+/*     $NetBSD: core_machdep.c,v 1.4 2014/01/04 00:10:02 dsl Exp $     */
 
 /*
  * Copyright (c) 1994-1998 Mark Brinicombe.
@@ -37,7 +37,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.3 2014/01/01 18:57:15 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.4 2014/01/04 00:10:02 dsl Exp $");
 
 #include <sys/core.h>
 #include <sys/exec.h>
@@ -80,7 +80,7 @@
        if (error)
                return error;
        /* Save floating point registers. */
-       error = process_read_fpregs(l, &cpustate.fpregs);
+       error = process_read_fpregs(l, &cpustate.fpregs, NULL);
        if (error)
                return error;
 
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/arm/arm/process_machdep.c
--- a/sys/arch/arm/arm/process_machdep.c        Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/arm/arm/process_machdep.c        Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.28 2013/10/14 18:14:08 skrll Exp $       */
+/*     $NetBSD: process_machdep.c,v 1.29 2014/01/04 00:10:02 dsl Exp $ */
 
 /*
  * Copyright (c) 1993 The Regents of the University of California.
@@ -133,7 +133,7 @@
 
 #include <sys/param.h>
 
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.28 2013/10/14 18:14:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.29 2014/01/04 00:10:02 dsl Exp $");
 
 #include <sys/proc.h>
 #include <sys/ptrace.h>
@@ -172,7 +172,7 @@
 }
 
 int
-process_read_fpregs(struct lwp *l, struct fpreg *regs)
+process_read_fpregs(struct lwp *l, struct fpreg *regs, size_t *sz)
 {
 #ifdef FPU_VFP
        if (curcpu()->ci_vfp_id == 0) {
@@ -220,7 +220,7 @@
 }
 
 int
-process_write_fpregs(struct lwp *l, const struct fpreg *regs)
+process_write_fpregs(struct lwp *l, const struct fpreg *regs, size_t sz)
 {
 #ifdef FPU_VFP
        if (curcpu()->ci_vfp_id == 0) {
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/hppa/hppa/core_machdep.c
--- a/sys/arch/hppa/hppa/core_machdep.c Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/hppa/hppa/core_machdep.c Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: core_machdep.c,v 1.5 2014/01/01 18:57:15 dsl Exp $     */
+/*     $NetBSD: core_machdep.c,v 1.6 2014/01/04 00:10:02 dsl Exp $     */
 
 /*     $OpenBSD: vm_machdep.c,v 1.25 2001/09/19 20:50:56 mickey Exp $  */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.5 2014/01/01 18:57:15 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: core_machdep.c,v 1.6 2014/01/04 00:10:02 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -77,7 +77,7 @@
                return error;
 
        /* Save floating point registers. */
-       error = process_read_fpregs(l, &md_core.md_fpreg);
+       error = process_read_fpregs(l, &md_core.md_fpreg, NULL);
        if (error)
                return error;
 
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/hppa/hppa/process_machdep.c
--- a/sys/arch/hppa/hppa/process_machdep.c      Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/hppa/hppa/process_machdep.c      Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.17 2011/03/03 09:37:21 skrll Exp $       */
+/*     $NetBSD: process_machdep.c,v 1.18 2014/01/04 00:10:02 dsl Exp $ */
 
 /*     $OpenBSD: process_machdep.c,v 1.3 1999/06/18 05:19:52 mickey Exp $      */
 
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.17 2011/03/03 09:37:21 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.18 2014/01/04 00:10:02 dsl Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -108,7 +108,7 @@
 }
 
 int
-process_read_fpregs(struct lwp *l, struct fpreg *fpregs)
+process_read_fpregs(struct lwp *l, struct fpreg *fpregs, size_t *sz)
 {
        struct pcb *pcb = lwp_getpcb(l);
 
@@ -177,7 +177,7 @@
 }
 
 int
-process_write_fpregs(struct lwp *l, const struct fpreg *fpregs)
+process_write_fpregs(struct lwp *l, const struct fpreg *fpregs, size_t sz)
 {
        struct pcb *pcb = lwp_getpcb(l);
 
diff -r 8817df857616 -r c3d2d1ec3fcf sys/arch/i386/i386/process_machdep.c
--- a/sys/arch/i386/i386/process_machdep.c      Fri Jan 03 23:18:48 2014 +0000
+++ b/sys/arch/i386/i386/process_machdep.c      Sat Jan 04 00:10:02 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: process_machdep.c,v 1.75 2013/12/08 20:45:30 dsl Exp $ */
+/*     $NetBSD: process_machdep.c,v 1.76 2014/01/04 00:10:02 dsl Exp $ */
 
 /*-
  * Copyright (c) 1998, 2000, 2001, 2008 The NetBSD Foundation, Inc.
@@ -52,7 +52,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.75 2013/12/08 20:45:30 dsl Exp $");
+__KERNEL_RCSID(0, "$NetBSD: process_machdep.c,v 1.76 2014/01/04 00:10:02 dsl Exp $");
 
 #include "opt_vm86.h"
 #include "opt_ptrace.h"
@@ -238,7 +238,7 @@
 }
 
 int
-process_read_fpregs(struct lwp *l, struct fpreg *regs)
+process_read_fpregs(struct lwp *l, struct fpreg *regs, size_t *sz)



Home | Main Index | Thread Index | Old Index