]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h
Update copyright dates with scripts/update-copyrights.
[thirdparty/glibc.git] / sysdeps / unix / sysv / linux / sparc / sparc64 / register-dump.h
index ccfb881d9838462803872d48b1dec9ffd7754727..6cfe4f36964874d29468a87b5fcfc529d15206b8 100644 (file)
@@ -1,26 +1,24 @@
 /* Dump registers.
-   Copyright (C) 1999 Free Software Foundation, Inc.
+   Copyright (C) 1999-2016 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jakub Jelinek <jj@ultra.linux.cz>, 1999.
 
    The GNU C Library is free software; you can redistribute it and/or
-   modify it under the terms of the GNU Library General Public License as
-   published by the Free Software Foundation; either version 2 of the
-   License, or (at your option) any later version.
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
 
    The GNU C Library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-   Library General Public License for more details.
+   Lesser General Public License for more details.
 
-   You should have received a copy of the GNU Library General Public
-   License along with the GNU C Library; see the file COPYING.LIB.  If not,
-   write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-   Boston, MA 02111-1307, USA.  */
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 #include <sys/uio.h>
-#include <stdio-common/_itoa.h>
-#include <bits/sigcontext.h>
+#include <_itoa.h>
 
 /* We will print the register dump in this format:
 
@@ -62,25 +60,17 @@ hexvalue (unsigned long int value, char *buf, size_t len)
     *--cp = '0';
 }
 
-struct __siginfo_sparc64_fpu
-{
-  unsigned long si_float_regs[32];
-  unsigned long si_xfsr;
-  unsigned long si_gsr;
-  unsigned long si_fprs;
-};
-
 static void
 register_dump (int fd, SIGCONTEXT ctx)
 {
   char regs[36][16];
-  char fregs[35][8];
+  char fregs[68][8];
   struct iovec iov[150];
   size_t nr = 0;
   int i;
-  struct reg_window *r = (struct reg_window *)
-    ctx->sf_regs.u_regs[14];
-  struct __siginfo_sparc64_fpu *f;
+  unsigned long *r = (unsigned long *)
+    (ctx->sigc_regs.u_regs[14] + STACK_BIAS);
+  __siginfo_fpu_t *f;
 
 #define ADD_STRING(str) \
   iov[nr].iov_base = (char *) str;                                           \
@@ -92,15 +82,15 @@ register_dump (int fd, SIGCONTEXT ctx)
   ++nr
 
   /* Generate strings of register contents.  */
-  hexvalue (ctx->sf_regs.tstate,       regs[0], 16);
-  hexvalue (ctx->sf_regs.tpc,          regs[1], 16);
-  hexvalue (ctx->sf_regs.tnpc,         regs[2], 16);
-  hexvalue (ctx->sf_regs.y,            regs[3], 8);
+  hexvalue (ctx->sigc_regs.tstate,     regs[0], 16);
+  hexvalue (ctx->sigc_regs.tpc,                regs[1], 16);
+  hexvalue (ctx->sigc_regs.tnpc,       regs[2], 16);
+  hexvalue (ctx->sigc_regs.y,          regs[3], 8);
   for (i = 1; i <= 15; i++)
-    hexvalue (ctx->sf_regs.u_regs[i],  regs[3+i], 16);
+    hexvalue (ctx->sigc_regs.u_regs[i], regs[3+i], 16);
   for (i = 0; i <= 15; i++)
-    hexvalue (r->locals[i],            regs[19+i], 16);
-  hexvalue (ctx->sf_mask,              regs[35], 16);
+    hexvalue (r[i],                    regs[19+i], 16);
+  hexvalue (ctx->sigc_mask,            regs[35], 16);
 
   /* Generate the output.  */
   ADD_STRING ("Register dump:\n\n TSTATE: ");
@@ -176,85 +166,85 @@ register_dump (int fd, SIGCONTEXT ctx)
   ADD_STRING ("\n\n Mask: ");
   ADD_MEM (regs[35], 16);
 
-  f = *(struct __siginfo_sparc64_fpu **)(ctx + 1);
+  f = ctx->sigc_fpu_save;
   if (f != NULL)
     {
-      for (i = 0; i < 32; i++)
-       hexvalue (f->si_float_regs[i], fregs[i], 16);
-      hexvalue (f->si_xfsr, fregs[32], 16);
-      hexvalue (f->si_gsr, fregs[33], 2);
-      hexvalue (f->si_fprs, fregs[34], 1);
-    ADD_STRING (" XFSR: ");
-    ADD_MEM (fregs[32], 16);
-    ADD_STRING (" GSR: ");
-    ADD_MEM (fregs[33], 2);
-    ADD_STRING (" FPRS: ");
-    ADD_MEM (fregs[34], 1);
-    ADD_STRING ("\n  f0: ");
-    ADD_MEM (fregs[0], 16);
-    ADD_STRING ("   f2: ");
-    ADD_MEM (fregs[1], 16);
-    ADD_STRING ("   f4: ");
-    ADD_MEM (fregs[2], 16);
-    ADD_STRING ("\n  f6: ");
-    ADD_MEM (fregs[3], 16);
-    ADD_STRING ("   f8: ");
-    ADD_MEM (fregs[4], 16);
-    ADD_STRING ("  f10: ");
-    ADD_MEM (fregs[5], 16);
-    ADD_STRING ("\n f12: ");
-    ADD_MEM (fregs[6], 16);
-    ADD_STRING ("  f14: ");
-    ADD_MEM (fregs[7], 16);
-    ADD_STRING ("  f16: ");
-    ADD_MEM (fregs[8], 16);
-    ADD_STRING ("\n f18: ");
-    ADD_MEM (fregs[9], 16);
-    ADD_STRING ("  f20: ");
-    ADD_MEM (fregs[10], 16);
-    ADD_STRING ("  f22: ");
-    ADD_MEM (fregs[11], 16);
-    ADD_STRING ("\n f24: ");
-    ADD_MEM (fregs[12], 16);
-    ADD_STRING ("  f26: ");
-    ADD_MEM (fregs[13], 16);
-    ADD_STRING ("  f28: ");
-    ADD_MEM (fregs[14], 16);
-    ADD_STRING ("\n f30: ");
-    ADD_MEM (fregs[15], 16);
-    ADD_STRING ("  f32: ");
-    ADD_MEM (fregs[16], 16);
-    ADD_STRING ("  f34: ");
-    ADD_MEM (fregs[17], 16);
-    ADD_STRING ("\n f36: ");
-    ADD_MEM (fregs[18], 16);
-    ADD_STRING ("  f38: ");
-    ADD_MEM (fregs[19], 16);
-    ADD_STRING ("  f40: ");
-    ADD_MEM (fregs[20], 16);
-    ADD_STRING ("\n f42: ");
-    ADD_MEM (fregs[21], 16);
-    ADD_STRING ("  f44: ");
-    ADD_MEM (fregs[22], 16);
-    ADD_STRING ("  f46: ");
-    ADD_MEM (fregs[23], 16);
-    ADD_STRING ("\n f48: ");
-    ADD_MEM (fregs[24], 16);
-    ADD_STRING ("  f50: ");
-    ADD_MEM (fregs[25], 16);
-    ADD_STRING ("  f52: ");
-    ADD_MEM (fregs[26], 16);
-    ADD_STRING ("\n f54: ");
-    ADD_MEM (fregs[27], 16);
-    ADD_STRING ("  f56: ");
-    ADD_MEM (fregs[28], 16);
-    ADD_STRING ("  f58: ");
-    ADD_MEM (fregs[29], 16);
-    ADD_STRING ("\n f60: ");
-    ADD_MEM (fregs[30], 16);
-    ADD_STRING ("  f62: ");
-    ADD_MEM (fregs[31], 16);
-  }
+      for (i = 0; i < 64; i++)
+       hexvalue (f->si_float_regs[i], fregs[i], 8);
+      hexvalue (f->si_fsr, fregs[64], 16);
+      hexvalue (f->si_gsr, fregs[66], 2);
+      hexvalue (f->si_fprs, fregs[67], 1);
+      ADD_STRING (" XFSR: ");
+      ADD_MEM (fregs[64], 16);
+      ADD_STRING (" GSR: ");
+      ADD_MEM (fregs[66], 2);
+      ADD_STRING (" FPRS: ");
+      ADD_MEM (fregs[67], 1);
+      ADD_STRING ("\n  f0: ");
+      ADD_MEM (fregs[0], 16);
+      ADD_STRING ("   f2: ");
+      ADD_MEM (fregs[2], 16);
+      ADD_STRING ("   f4: ");
+      ADD_MEM (fregs[4], 16);
+      ADD_STRING ("\n  f6: ");
+      ADD_MEM (fregs[6], 16);
+      ADD_STRING ("   f8: ");
+      ADD_MEM (fregs[8], 16);
+      ADD_STRING ("  f10: ");
+      ADD_MEM (fregs[10], 16);
+      ADD_STRING ("\n f12: ");
+      ADD_MEM (fregs[12], 16);
+      ADD_STRING ("  f14: ");
+      ADD_MEM (fregs[14], 16);
+      ADD_STRING ("  f16: ");
+      ADD_MEM (fregs[16], 16);
+      ADD_STRING ("\n f18: ");
+      ADD_MEM (fregs[18], 16);
+      ADD_STRING ("  f20: ");
+      ADD_MEM (fregs[20], 16);
+      ADD_STRING ("  f22: ");
+      ADD_MEM (fregs[22], 16);
+      ADD_STRING ("\n f24: ");
+      ADD_MEM (fregs[24], 16);
+      ADD_STRING ("  f26: ");
+      ADD_MEM (fregs[26], 16);
+      ADD_STRING ("  f28: ");
+      ADD_MEM (fregs[28], 16);
+      ADD_STRING ("\n f30: ");
+      ADD_MEM (fregs[30], 16);
+      ADD_STRING ("  f32: ");
+      ADD_MEM (fregs[32], 16);
+      ADD_STRING ("  f34: ");
+      ADD_MEM (fregs[34], 16);
+      ADD_STRING ("\n f36: ");
+      ADD_MEM (fregs[36], 16);
+      ADD_STRING ("  f38: ");
+      ADD_MEM (fregs[38], 16);
+      ADD_STRING ("  f40: ");
+      ADD_MEM (fregs[40], 16);
+      ADD_STRING ("\n f42: ");
+      ADD_MEM (fregs[42], 16);
+      ADD_STRING ("  f44: ");
+      ADD_MEM (fregs[44], 16);
+      ADD_STRING ("  f46: ");
+      ADD_MEM (fregs[46], 16);
+      ADD_STRING ("\n f48: ");
+      ADD_MEM (fregs[48], 16);
+      ADD_STRING ("  f50: ");
+      ADD_MEM (fregs[50], 16);
+      ADD_STRING ("  f52: ");
+      ADD_MEM (fregs[52], 16);
+      ADD_STRING ("\n f54: ");
+      ADD_MEM (fregs[54], 16);
+      ADD_STRING ("  f56: ");
+      ADD_MEM (fregs[56], 16);
+      ADD_STRING ("  f58: ");
+      ADD_MEM (fregs[58], 16);
+      ADD_STRING ("\n f60: ");
+      ADD_MEM (fregs[60], 16);
+      ADD_STRING ("  f62: ");
+      ADD_MEM (fregs[62], 16);
+    }
 
   ADD_STRING ("\n");