Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: rbrown64@csc.com.au
To: Mark Kettenis <kettenis@science.uva.nl>
Cc: gdb-patches@sources.redhat.com
Subject: Re: Additional patches for UnixWare {2.1.3,7.1.0} support
Date: Tue, 12 Feb 2002 20:08:00 -0000	[thread overview]
Message-ID: <OF49D23FEA.ACC32BDE-ONCA256B5F.00164913@int.csc.com.au> (raw)

Please apply the i387_*_fsave parts of the patch to i386v4-nat.c .

--- i386v4-nat.c.orig   Thu Jan 31 09:32:37 2002
+++ i386v4-nat.c  Wed Feb 13 15:11:07 2002
@@ -152,28 +152,9 @@
    idea of the current floating point register values. */

 /* FIXME: Assumes that fpregsetp contains an i387 FSAVE area. */
-static const int freg_offset_map[] =
-{
 #if !defined(FPREGSET_FSAVE_OFFSET)
 #define FPREGSET_FSAVE_OFFSET      0
 #endif
-  FPREGSET_FSAVE_OFFSET + 28 + 0 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 1 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 2 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 3 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 4 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 5 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 6 * 10,
-  FPREGSET_FSAVE_OFFSET + 28 + 7 * 10,
-  FPREGSET_FSAVE_OFFSET + 0,
-  FPREGSET_FSAVE_OFFSET + 4,
-  FPREGSET_FSAVE_OFFSET + 8,
-  FPREGSET_FSAVE_OFFSET + 16,
-  FPREGSET_FSAVE_OFFSET + 12,
-  FPREGSET_FSAVE_OFFSET + 24,
-  FPREGSET_FSAVE_OFFSET + 20,
-  FPREGSET_FSAVE_OFFSET + 16
-};

 void
 supply_fpregset (fpregset_t *fpregsetp)
@@ -182,27 +163,7 @@

   if (NUM_FREGS == 0)
     return;
-  for (regi = FP0_REGNUM; regi <= LAST_FPU_CTRL_REGNUM; regi++)
-    {
-      char tbuf[4];
-      ULONGEST tval;
-      char *from = (char *) fpregsetp + freg_offset_map[regi - FP0_REGNUM];
-
-      if (regi == FCS_REGNUM)
-     {
-       tval = extract_unsigned_integer (from, 4) & 0xffff;
-       store_unsigned_integer (tbuf, 4, tval);
-       supply_register (regi, tbuf);
-     }
-      else if (regi == FOP_REGNUM)
-     {
-       tval = (extract_unsigned_integer (from, 4) >> 16) & ((1 << 11) - 1);
-       store_unsigned_integer (tbuf, 4, tval);
-       supply_register (regi, tbuf);
-     }
-      else
-     supply_register (regi, from);
-    }
+  i387_supply_fsave ((char *) fpregsetp + FPREGSET_FSAVE_OFFSET);
 }

 /*  Given a pointer to a floating point register set in /proc format
@@ -217,35 +178,7 @@

   if (NUM_FREGS == 0)
     return;
-  for (regi = FP0_REGNUM; regi <= LAST_FPU_CTRL_REGNUM; regi++)
-    {
-      if ((regno == -1) || (regno == regi))
-     {
-       char *to = (char *) fpregsetp + freg_offset_map[regi - FP0_REGNUM];
-       char *from = (char *) &registers[REGISTER_BYTE (regi)];
-       ULONGEST valto;
-       ULONGEST valfrom;
-
-       if (regi == FCS_REGNUM)
-         {
-           valto = extract_unsigned_integer (to, 4);
-           valfrom = extract_unsigned_integer (from, 4);
-           valto = (valto & ~0xffff) | (valfrom & 0xffff);
-           store_unsigned_integer (to, 4, valto);
-         }
-       else if (regi == FOP_REGNUM)
-         {
-           valto = extract_unsigned_integer (to, 4);
-           valfrom = extract_unsigned_integer (from, 4);
-           valto = (valto & 0xffff) | ((valfrom & ((1 << 11) - 1)) << 16);
-           store_unsigned_integer (to, 4, valto);
-         }
-       else
-         {
-           memcpy (to, from, REGISTER_RAW_SIZE (regi));
-         }
-     }
-    }
+  i387_fill_fsave ((char *) fpregsetp + FPREGSET_FSAVE_OFFSET, regno);
 }

 #endif /* defined (HAVE_FPREGSET_T) */





Mark Kettenis <kettenis@science.uva.nl> on 27/01/2002 04:03:33

To:    rbrown64@csc.com.au
cc:    gdb-patches@sources.redhat.com
Subject:    Re: Additional patches for UnixWare {2.1.3,7.1.0} support


rbrown64@csc.com.au writes:

> 2002-01-15  Rodney Brown  <rbrown64@csc.com.au>
>
>      * config/i386/tm-i386v4.h: Define HAVE_I387_REGS.
>      * config/i386/i386v42mp.mh: Add i387-nat.o .
>      * i386v4-nat.c: Include i387-nat.h.
>      (supply_fpregset): Use i387_supply_fsave.
>      (fill_fpregset): Use i387_fill_fsave.
>      * procfs.c(procfs_do_thread_registers): Use elfcore_write_pstatus
>      if pstatus_t is available.

Sorry for the delay, but the i386 bits of these patch are approved.

Mark




             reply	other threads:[~2002-02-13  4:08 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-02-12 20:08 rbrown64 [this message]
2002-02-13  0:11 ` kettenis
  -- strict thread matches above, loose matches on Subject: below --
2002-01-14 23:28 rbrown64
2002-01-15 11:52 ` Michael Snyder
2002-01-15 11:56   ` Michael Snyder
2002-01-26  9:07 ` Mark Kettenis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OF49D23FEA.ACC32BDE-ONCA256B5F.00164913@int.csc.com.au \
    --to=rbrown64@csc.com.au \
    --cc=gdb-patches@sources.redhat.com \
    --cc=kettenis@science.uva.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox