2000-12-04 Michael Snyder <msnyder@cleaver.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / remote-nindy.c
index 807000db73911f15abdadffaf5f4d893c1fcf9ed..6428541cec360379c253270806a03c88efa8b83f 100644 (file)
 #include "serial.h"
 #include "nindy-share/env.h"
 #include "nindy-share/stop.h"
-
-#include "dcache.h"
 #include "remote-utils.h"
 
-static DCACHE *nindy_dcache;
-
 extern int unlink ();
 extern char *getenv ();
 extern char *mktemp ();
@@ -188,11 +184,6 @@ nindy_open (char *name,            /* "/dev/ttyXX", "ttyXX", or "XX": tty to be opened */
 
   have_regs = regs_changed = 0;
 
-  if (!nindy_dcache)
-    nindy_dcache = dcache_init (ninMemGet, ninMemPut);
-  else
-    dcache_invd (nindy_dcache);
-
   /* Allow user to interrupt the following -- we could hang if there's
      no NINDY at the other end of the remote tty.  */
   immediate_quit++;
@@ -240,14 +231,13 @@ nindy_files_info (void)
                     nindy_initial_brk ? " with initial break" : "");
 }
 \f
-/* Return the number of characters in the buffer before
-   the first DLE character.  */
+/* Return the number of characters in the buffer BUF before
+   the first DLE character.  N is maximum number of characters to
+   consider.  */
 
 static
 int
-non_dle (buf, n)
-     char *buf;                        /* Character buffer; NOT '\0'-terminated */
-     int n;                    /* Number of characters in buffer */
+non_dle (char *buf, int n)
 {
   int i;
 
@@ -269,7 +259,6 @@ nindy_resume (int pid, int step, enum target_signal siggnal)
   if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal)
     warning ("Can't send signals to remote NINDY targets.");
 
-  dcache_invd (nindy_dcache);
   if (regs_changed)
     {
       nindy_store_registers (-1);
@@ -482,20 +471,24 @@ nindy_store_registers (int regno)
 
 /* Copy LEN bytes to or from inferior's memory starting at MEMADDR
    to debugger memory starting at MYADDR.   Copy to inferior if
-   SHOULD_WRITE is nonzero.  Returns the length copied. */
+   SHOULD_WRITE is nonzero.  Returns the length copied.  TARGET is
+   unused.  */
 
 int
-nindy_xfer_inferior_memory (memaddr, myaddr, len, should_write, target)
-     CORE_ADDR memaddr;
-     char *myaddr;
-     int len;
-     int should_write;
-     struct target_ops *target;        /* ignored */
+nindy_xfer_inferior_memory (CORE_ADDR memaddr, char *myaddr, int len,
+                           int should_write, struct target_ops *target)
 {
+  int res;
+
   if (len <= 0)
     return 0;
-  return dcache_xfer_memory (nindy_dcache, memaddr, myaddr, 
-                            len, should_write);
+
+  if (should_write)
+    res = ninMemPut (memaddr, myaddr, len);
+  else
+    res = ninMemGet (memaddr, myaddr, len);
+
+  return res;
 }
 \f
 static void
@@ -614,8 +607,6 @@ nindy_load (char *filename, int from_tty)
        }
     }
   bfd_close (file);
-
-  dcache_invd(nindy_dcache);
 }
 
 static int
This page took 0.025909 seconds and 4 git commands to generate.