btrace: fix test build error in gdb.btrace/instruction_history.c
[deliverable/binutils-gdb.git] / gdb / i386v4-nat.c
index 188f01b4c12e9b45c3e5b513e80362fb4841991f..4d1020b8d63e286657648db3a41251bba2b389fb 100644 (file)
@@ -1,13 +1,12 @@
-/* Native-dependent code for SVR4 Unix running on i386's.
-   Copyright 1988, 1989, 1991, 1992, 1996, 1997, 1998, 1999, 2000,
-   2001, 2002
-   Free Software Foundation, Inc.
+/* Native-dependent code for Unix SVR4 running on i386's.
+
+   Copyright (C) 1988-2016 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 
    This file is part of GDB.
 
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
+   the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
    (at your option) any later version.
 
    This program is distributed in the hope that it will be useful,
@@ -16,9 +15,7 @@
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
 #include "value.h"
 
 #include "defs.h"
 #include "value.h"
@@ -36,7 +33,9 @@
 
 #include <sys/procfs.h>
 
 
 #include <sys/procfs.h>
 
-/* Prototypes for supply_gregset etc. */
+/* We must not compile this code for 64-bit Solaris x86.  */
+#if !defined (PR_MODEL_NATIVE) || (PR_MODEL_NATIVE == PR_MODEL_ILP32)
+
 #include "gregset.h"
 
 /* The `/proc' interface divides the target machine's register set up
 #include "gregset.h"
 
 /* The `/proc' interface divides the target machine's register set up
@@ -95,35 +94,36 @@ static int regmap[] =
   EAX, ECX, EDX, EBX,
   UESP, EBP, ESI, EDI,
   EIP, EFL, CS, SS,
   EAX, ECX, EDX, EBX,
   UESP, EBP, ESI, EDI,
   EIP, EFL, CS, SS,
-  DS, ES, FS, GS,
+  DS, ES, FS, GS
 };
 
 /* Fill GDB's register array with the general-purpose register values
    in *GREGSETP.  */
 
 void
 };
 
 /* Fill GDB's register array with the general-purpose register values
    in *GREGSETP.  */
 
 void
-supply_gregset (gregset_t *gregsetp)
+supply_gregset (struct regcache *regcache, const gregset_t *gregsetp)
 {
 {
-  greg_t *regp = (greg_t *) gregsetp;
-  int i;
+  const greg_t *regp = (const greg_t *) gregsetp;
+  int regnum;
 
 
-  for (i = 0; i < I386_NUM_GREGS; i++)
-    supply_register (i, (char *) (regp + regmap[i]));
+  for (regnum = 0; regnum < I386_NUM_GREGS; regnum++)
+    regcache_raw_supply (regcache, regnum, regp + regmap[regnum]);
 }
 
 }
 
-/* Fill register REGNO (if it is a general-purpose register) in
-   *GREGSETPS with the value in GDB's register array.  If REGNO is -1,
+/* Fill register REGNUM (if it is a general-purpose register) in
+   *GREGSETPS with the value in GDB's register array.  If REGNUM is -1,
    do this for all registers.  */
 
 void
    do this for all registers.  */
 
 void
-fill_gregset (gregset_t *gregsetp, int regno)
+fill_gregset (const struct regcache *regcache,
+             gregset_t *gregsetp, int regnum)
 {
   greg_t *regp = (greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
 {
   greg_t *regp = (greg_t *) gregsetp;
   int i;
 
   for (i = 0; i < I386_NUM_GREGS; i++)
-    if (regno == -1 || regno == i)
-      regcache_collect (i, regp + regmap[i]);
+    if (regnum == -1 || regnum == i)
+      regcache_raw_collect (regcache, i, regp + regmap[i]);
 }
 
 #endif /* HAVE_GREGSET_T */
 }
 
 #endif /* HAVE_GREGSET_T */
@@ -134,12 +134,12 @@ fill_gregset (gregset_t *gregsetp, int regno)
    *FPREGSETP.  */
 
 void
    *FPREGSETP.  */
 
 void
-supply_fpregset (fpregset_t *fpregsetp)
+supply_fpregset (struct regcache *regcache, const fpregset_t *fpregsetp)
 {
 {
-  if (FP0_REGNUM == 0)
+  if (gdbarch_fp0_regnum (get_regcache_arch (regcache)) == 0)
     return;
 
     return;
 
-  i387_supply_fsave (current_regcache, -1, fpregsetp);
+  i387_supply_fsave (regcache, -1, fpregsetp);
 }
 
 /* Fill register REGNO (if it is a floating-point register) in
 }
 
 /* Fill register REGNO (if it is a floating-point register) in
@@ -147,14 +147,17 @@ supply_fpregset (fpregset_t *fpregsetp)
    do this for all registers.  */
 
 void
    do this for all registers.  */
 
 void
-fill_fpregset (fpregset_t *fpregsetp, int regno)
+fill_fpregset (const struct regcache *regcache,
+              fpregset_t *fpregsetp, int regno)
 {
 {
-  if (FP0_REGNUM == 0)
+  if (gdbarch_fp0_regnum (get_regcache_arch (regcache)) == 0)
     return;
 
     return;
 
-  i387_fill_fsave ((char *) fpregsetp, regno);
+  i387_collect_fsave (regcache, regno, fpregsetp);
 }
 
 #endif /* HAVE_FPREGSET_T */
 
 }
 
 #endif /* HAVE_FPREGSET_T */
 
+#endif /* not 64-bit.  */
+
 #endif /* HAVE_SYS_PROCFS_H */
 #endif /* HAVE_SYS_PROCFS_H */
This page took 0.037332 seconds and 4 git commands to generate.