* configure.in (*-*-sunos*): Use trailing * to match all
[deliverable/binutils-gdb.git] / gdb / symm-xdep.c
index 34496789aca62f31140ef96091ca5ccf363fa1fd..4ce743a521e9ecb1aa2af44020765f4bbc72d762 100644 (file)
@@ -1,27 +1,26 @@
 /* Sequent Symmetry host interface, for GDB when running under Unix.
-   Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
-GDB is free software; you can redistribute it and/or modify
+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 1, or (at your option)
-any later version.
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
 
-GDB is distributed in the hope that it will be useful,
+This program 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 General Public License for more details.
 
 You should have received a copy of the GNU General Public License
-along with GDB; see the file COPYING.  If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
-/* many 387-specific items of use taken from i386-dep.c */
+/* FIXME, some 387-specific items of use taken from i387-tdep.c -- ought to be
+   merged back in. */
 
-#include <stdio.h>
 #include "defs.h"
-#include "param.h"
 #include "frame.h"
 #include "inferior.h"
 #include "symtab.h"
@@ -34,13 +33,12 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
 #include <sys/stat.h>
 #include "gdbcore.h"
 #include <fcntl.h>
-
-static long i386_get_frame_setup ();
-static i386_follow_jump ();
-
 #include <sgtty.h>
 #define TERMINAL struct sgttyb
 
+#include "gdbcore.h"
+
+void
 store_inferior_registers(regno)
 int regno;
 {
@@ -72,7 +70,7 @@ int regno;
   else
     {
       reg_tmp = *(int *)&registers[REGISTER_BYTE(regno)];
-      ptrace(XPT_RREGS, inferior_pid, &regs, 0);
+      ptrace(XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
       switch (regno)
        {
        case 0:
@@ -108,11 +106,12 @@ int regno;
        }
     }
 #endif /* 0 */
-  ptrace(XPT_WREGS, inferior_pid, &regs, 0);
+  ptrace(XPT_WREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
 }
 
 void
-fetch_inferior_registers()
+fetch_inferior_registers (regno)
+     int regno;
 {
     int i;
     struct pt_regset regs;
@@ -120,7 +119,7 @@ fetch_inferior_registers()
 
     registers_fetched ();
     
-    ptrace(XPT_RREGS, inferior_pid, &regs, 0);
+    ptrace(XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regs, 0);
     *(int *)&registers[REGISTER_BYTE(0)] = regs.pr_eax;
     *(int *)&registers[REGISTER_BYTE(5)] = regs.pr_ebx;
     *(int *)&registers[REGISTER_BYTE(2)] = regs.pr_ecx;
@@ -148,8 +147,6 @@ fetch_inferior_registers()
 /* Work with core dump and executable files, for GDB. 
    This code would be in core.c if it weren't machine-dependent. */
 
-#include "gdbcore.h"
-
 void
 core_file_command (filename, from_tty)
      char *filename;
@@ -231,7 +228,7 @@ printf("u.u_tsize= %#x, u.u_dsize= %#x, u.u_ssize= %#x, stack_off= %#x\n",
        corefile = savestring (filename, strlen (filename));
       else
        {
-         corefile = concat (current_directory, "/", filename);
+         corefile = concat (current_directory, "/", filename, NULL);
        }
 
       set_current_frame(create_new_frame(read_register(FP_REGNUM),
@@ -244,73 +241,10 @@ printf("u.u_tsize= %#x, u.u_dsize= %#x, u.u_ssize= %#x, stack_off= %#x\n",
     printf ("No core file now.\n");
 }
 
-/* from i386-dep.c */
-static
-print_387_control_word (control)
-unsigned short control;
-{
-  printf ("control 0x%04x: ", control);
-  printf ("compute to ");
-  switch ((control >> 8) & 3) 
-    {
-    case 0: printf ("24 bits; "); break;
-    case 1: printf ("(bad); "); break;
-    case 2: printf ("53 bits; "); break;
-    case 3: printf ("64 bits; "); break;
-    }
-  printf ("round ");
-  switch ((control >> 10) & 3) 
-    {
-    case 0: printf ("NEAREST; "); break;
-    case 1: printf ("DOWN; "); break;
-    case 2: printf ("UP; "); break;
-    case 3: printf ("CHOP; "); break;
-    }
-  if (control & 0x3f) 
-    {
-      printf ("mask:");
-      if (control & 0x0001) printf (" INVALID");
-      if (control & 0x0002) printf (" DENORM");
-      if (control & 0x0004) printf (" DIVZ");
-      if (control & 0x0008) printf (" OVERF");
-      if (control & 0x0010) printf (" UNDERF");
-      if (control & 0x0020) printf (" LOS");
-      printf (";");
-    }
-  printf ("\n");
-  if (control & 0xe080) printf ("warning: reserved bits on 0x%x\n",
-                               control & 0xe080);
-}
-
-static
-print_387_status_word (status)
-     unsigned short status;
-{
-  printf ("status %#04x: ", status);
-  if (status & 0xff) {
-      printf ("exceptions:");  /* exception names match <machine/fpu.h> */
-      if (status & 0x0001) printf (" FLTINV");
-      if (status & 0x0002) printf (" FLTDEN");
-      if (status & 0x0004) printf (" FLTDIV");
-      if (status & 0x0008) printf (" FLTOVF");
-      if (status & 0x0010) printf (" FLTUND");
-      if (status & 0x0020) printf (" FLTPRE");
-      if (status & 0x0040) printf (" FLTSTK");
-      printf ("; ");
-    }
-  printf ("flags: %d%d%d%d; ",
-         (status & 0x4000) != 0,
-         (status & 0x0400) != 0,
-         (status & 0x0200) != 0,
-         (status & 0x0100) != 0);
-  
-  printf ("top %d\n", (status >> 11) & 7);
-}
-
+/* FIXME:  This should be merged with i387-tdep.c as well. */
 static
 print_fpu_status(ep)
 struct pt_regset ep;
-
 {
     int i;
     int bothstatus;
@@ -357,13 +291,13 @@ struct pt_regset ep;
            printf ("  %g\n", val);
        }
     if (ep.pr_fpu.fpu_rsvd1)
-       printf ("warning: rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
+       warning ("rsvd1 is 0x%x\n", ep.pr_fpu.fpu_rsvd1);
     if (ep.pr_fpu.fpu_rsvd2)
-       printf ("warning: rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
+       warning ("rsvd2 is 0x%x\n", ep.pr_fpu.fpu_rsvd2);
     if (ep.pr_fpu.fpu_rsvd3)
-       printf ("warning: rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
+       warning ("rsvd3 is 0x%x\n", ep.pr_fpu.fpu_rsvd3);
     if (ep.pr_fpu.fpu_rsvd5)
-       printf ("warning: rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
+       warning ("rsvd5 is 0x%x\n", ep.pr_fpu.fpu_rsvd5);
 }
 
 
@@ -487,14 +421,13 @@ struct pt_regset ep;
 }
 
 i386_float_info ()
-
 {
     char ubuf[UPAGES*NBPG];
     struct pt_regset regset;
     extern int corechan;
     
     if (have_inferior_p()) {
-       call_ptrace(XPT_RREGS, inferior_pid, &regset, 0);
+       call_ptrace(XPT_RREGS, inferior_pid, (PTRACE_ARG3_TYPE) &regset, 0);
     } else {
        if (lseek (corechan, 0, 0) < 0) {
            perror ("seek on core file");
@@ -509,49 +442,3 @@ i386_float_info ()
     print_fpu_status(regset);
     print_fpa_status(regset);
 }
-
-i387_to_double (from, to)
-     char *from;
-     char *to;
-{
-  long *lp;
-  /* push extended mode on 387 stack, then pop in double mode
-   *
-   * first, set exception masks so no error is generated -
-   * number will be rounded to inf or 0, if necessary 
-   */
-  asm ("pushl %eax");          /* grab a stack slot */
-  asm ("fstcw (%esp)");                /* get 387 control word */
-  asm ("movl (%esp),%eax");    /* save old value */
-  asm ("orl $0x3f,%eax");              /* mask all exceptions */
-  asm ("pushl %eax");
-  asm ("fldcw (%esp)");                /* load new value into 387 */
-  
-  asm ("movl 8(%ebp),%eax");
-  asm ("fldt (%eax)");         /* push extended number on 387 stack */
-  asm ("fwait");
-  asm ("movl 12(%ebp),%eax");
-  asm ("fstpl (%eax)");                /* pop double */
-  asm ("fwait");
-  
-  asm ("popl %eax");           /* flush modified control word */
-  asm ("fnclex");                      /* clear exceptions */
-  asm ("fldcw (%esp)");                /* restore original control word */
-  asm ("popl %eax");           /* flush saved copy */
-}
-
-double_to_i387 (from, to)
-     char *from;
-     char *to;
-{
-  /* push double mode on 387 stack, then pop in extended mode
-   * no errors are possible because every 64-bit pattern
-   * can be converted to an extended
-   */
-  asm ("movl 8(%ebp),%eax");
-  asm ("fldl (%eax)");
-  asm ("fwait");
-  asm ("movl 12(%ebp),%eax");
-  asm ("fstpt (%eax)");
-  asm ("fwait");
-}
This page took 0.026237 seconds and 4 git commands to generate.