* symfile.c (symbol_file_add_main_1): Use inferior's
[deliverable/binutils-gdb.git] / sim / sh / interp.c
index 235d6bb30672281efc05792710ec3334fd3d0d32..20239def614b53b879765b022490298f976e8593 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "config.h"
 
+#include <stdio.h>
+#include <errno.h>
 #include <signal.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 # endif
 #endif
 
-#include "sysdep.h"
+#ifdef HAVE_STRING_H
+#include <string.h>
+#else
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
+#endif
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
 #include "bfd.h"
 #include "gdb/callback.h"
 #include "gdb/remote-sim.h"
@@ -64,7 +81,7 @@
 
 extern unsigned short sh_jump_table[], sh_dsp_table[0x1000], ppi_table[];
 
-int sim_write (SIM_DESC sd, SIM_ADDR addr, unsigned char *buffer, int size);
+int sim_write (SIM_DESC sd, SIM_ADDR addr, const unsigned char *buffer, int size);
 
 #define O_RECOMPILE 85
 #define DEFINE_TABLE
@@ -853,7 +870,7 @@ do { \
 
 #endif
 
-#if defined(__GO32__) || defined(_WIN32)
+#if defined(__GO32__)
 int sim_memory_size = 19;
 #else
 int sim_memory_size = 24;
@@ -1429,14 +1446,9 @@ macl (regs, memory, n, m)
      int m, n;
 {
   long tempm, tempn;
-  long prod, macl, mach, sum;
-  long long ans,ansl,ansh,t;
-  unsigned long long high,low,combine;
-  union mac64
-  {
-    long m[2]; /* mach and macl*/
-    long long m64; /* 64 bit MAC */
-  }mac64;
+  long macl, mach;
+  long long ans;
+  long long mac64;
 
   tempm = RSLAT (regs[m]);
   regs[m] += 4;
@@ -1447,15 +1459,15 @@ macl (regs, memory, n, m)
   mach = MACH;
   macl = MACL;
 
-  mac64.m[0] = macl;
-  mac64.m[1] = mach;
+  mac64 = ((long long) macl & 0xffffffff) |
+          ((long long) mach & 0xffffffff) << 32;
 
   ans = (long long) tempm * (long long) tempn; /* Multiply 32bit * 32bit */
 
-  mac64.m64 += ans; /* Accumulate   64bit + 64 bit */
+  mac64 += ans; /* Accumulate 64bit + 64 bit */
 
-  macl = mac64.m[0];
-  mach = mac64.m[1];
+  macl = (long) (mac64 & 0xffffffff);
+  mach = (long) ((mac64 >> 32) & 0xffffffff);
 
   if (S)  /* Store only 48 bits of the result */
     {
@@ -2129,7 +2141,7 @@ int
 sim_write (sd, addr, buffer, size)
      SIM_DESC sd;
      SIM_ADDR addr;
-     unsigned char *buffer;
+     const unsigned char *buffer;
      int size;
 {
   int i;
@@ -2775,3 +2787,9 @@ sim_set_callbacks (p)
 {
   callback = p;
 }
+
+char **
+sim_complete_command (SIM_DESC sd, char *text, char *word)
+{
+  return NULL;
+}
This page took 0.024377 seconds and 4 git commands to generate.