* remote-nindy.c (nindy_load): Invalidate dcache.
* dcache.c (dcache_invd): Renamed from dcache_flush. The term
flush with respect to caches usually implies that data will be
written to memory.
(dcache_init, dcache_xfer_memory): Updated.
* monitor.c (flush_monitor_dcache, monitor_resume, monitor_load):
Updated.
* ocd.c (ocd_open, ocd_resume, bdm_reset_command): Updated.
* remote-bug.c (bug_load, bug_resume): Updated.
* remote-nindy.c (nindy_open, nindy_resume): Updated.
* remote-sds.c (sds_open, sds_resume): Updated.
* remote-utils.c (gr_open): Updated.
* remote.c (remote_open_1, remote_resume, remote_async_resume,
remote_cisco_open): Updated.
* wince.c (child_create_inferior, child_resume): Updated.
* monitor.c (monitor_open): Free dcache before creating a new one.
* dcache.c (dcache_free): New function.
* dcache.h (dcache_free): New prototype.
-------------------------------------------------------------------
+2000-08-18 J.T. Conklin <jtc@redback.com>
+
+ * MAINTAINERS: Add myself as dcache.c maintainer.
+
+ * remote-nindy.c (nindy_load): Invalidate dcache.
+
+ * dcache.c (dcache_invd): Renamed from dcache_flush. The term
+ flush with respect to caches usually implies that data will be
+ written to memory.
+ (dcache_init, dcache_xfer_memory): Updated.
+ * monitor.c (flush_monitor_dcache, monitor_resume, monitor_load):
+ Updated.
+ * ocd.c (ocd_open, ocd_resume, bdm_reset_command): Updated.
+ * remote-bug.c (bug_load, bug_resume): Updated.
+ * remote-nindy.c (nindy_open, nindy_resume): Updated.
+ * remote-sds.c (sds_open, sds_resume): Updated.
+ * remote-utils.c (gr_open): Updated.
+ * remote.c (remote_open_1, remote_resume, remote_async_resume,
+ remote_cisco_open): Updated.
+ * wince.c (child_create_inferior, child_resume): Updated.
+
+ * monitor.c (monitor_open): Free dcache before creating a new one.
+ * dcache.c (dcache_free): New function.
+ * dcache.h (dcache_free): New prototype.
+
2000-08-18 Andrew Cagney <cagney@ops1.cygnus.com>
* remote-array.c (array_fetch_register): Pass dummy parameter to
hurd native Mark Kettenis kettenis@gnu.org
macos host & native Stan Shebs shebs@apple.com
hpux, hp pa native Jeff Law law@cygnus.com
-NetBSD J.T. Conklin jtc@redback.com
+NetBSD native & host J.T. Conklin jtc@redback.com
SCO/Unixware Nick Duffek nsd@cygnus.com
Robert Lipe rjl@sco.com
GNU/Linux ARM native Scott Bambrough scottb@netwinder.org
hp tests (gdb.hp) Jimmy Guo guo@cup.hp.com
Java tests (gdb.java) Anthony Green green@cygnus.com
Kernel Object Display Fernando Nasser fnasser@cygnus.com
+dcache.c J.T. Conklin jtc@redback.com
UI: External (user) interfaces.
/* Free all the data cache blocks, thus discarding all cached data. */
void
-dcache_flush (DCACHE *dcache)
+dcache_invd (DCACHE *dcache)
{
int i;
dcache->valid_head = 0;
dcache->the_cache = (struct dcache_block *) xmalloc (csize);
memset (dcache->the_cache, 0, csize);
- dcache_flush (dcache);
+ dcache_invd (dcache);
last_cache = dcache;
return dcache;
}
+/* Free a data cache */
+void
+dcache_free (DCACHE *dcache)
+{
+ if (last_cache == dcache)
+ last_cache = NULL;
+
+ free (dcache->the_cache);
+ free (dcache);
+}
+
/* Read or write LEN bytes from inferior memory at MEMADDR, transferring
to or from debugger address MYADDR. Write to inferior if SHOULD_WRITE is
nonzero.
xfunc = should_write ? dcache->write_memory : dcache->read_memory;
if (dcache->cache_has_stuff)
- dcache_flush (dcache);
+ dcache_invd (dcache);
len = xfunc (memaddr, myaddr, len);
}
typedef struct dcache_struct DCACHE;
-/* Flush DCACHE. */
-void dcache_flush (DCACHE * dcache);
+/* Invalidate DCACHE. */
+void dcache_invd (DCACHE * dcache);
/* Initialize DCACHE. */
DCACHE *dcache_init (memxferfunc reading, memxferfunc writing);
+/* Free a DCACHE */
+void dcache_free (DCACHE *);
+
/* Simple to call from <remote>_xfer_memory */
int dcache_xfer_memory (DCACHE * cache, CORE_ADDR mem, char *my, int len,
monitor_printf (current_monitor->line_term);
- if (!remote_dcache)
- {
- if (current_monitor->flags & MO_HAS_BLOCKWRITES)
- remote_dcache = dcache_init (monitor_read_memory,
- monitor_write_memory_block);
- else
- remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory);
- }
+ if (remote_dcache)
+ dcache_free (remote_dcache);
+
+ if (current_monitor->flags & MO_HAS_BLOCKWRITES)
+ remote_dcache = dcache_init (monitor_read_memory,
+ monitor_write_memory_block);
else
- dcache_flush (remote_dcache);
+ remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory);
start_remote ();
}
void
flush_monitor_dcache (void)
{
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
}
static void
dump_reg_flag = 1;
return;
}
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
if (step)
monitor_printf (current_monitor->step);
else
static void
monitor_load (char *file, int from_tty)
{
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
monitor_debug ("MON load\n");
if (current_monitor->load_routine)
if (!ocd_dcache)
ocd_dcache = dcache_init (ocd_read_bytes, ocd_write_bytes);
else
- dcache_flush (ocd_dcache);
+ dcache_invd (ocd_dcache);
if (strncmp (name, "wiggler", 7) == 0)
{
{
int pktlen;
- dcache_flush (ocd_dcache);
+ dcache_invd (ocd_dcache);
if (step)
ocd_do_command (OCD_STEP, &last_run_status, &pktlen);
error ("Not connected to OCD device.");
ocd_do_command (OCD_RESET, &status, &pktlen);
- dcache_flush (ocd_dcache);
+ dcache_invd (ocd_dcache);
registers_changed ();
}
sr_check_open ();
- dcache_flush (gr_get_dcache ());
+ dcache_invd (gr_get_dcache ());
inferior_pid = 0;
abfd = bfd_openr (args, 0);
if (!abfd)
void
bug_resume (int pid, int step, enum target_signal sig)
{
- dcache_flush (gr_get_dcache ());
+ dcache_invd (gr_get_dcache ());
if (step)
{
if (!nindy_dcache)
nindy_dcache = dcache_init (ninMemGet, ninMemPut);
else
- dcache_flush (nindy_dcache);
+ 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. */
if (siggnal != TARGET_SIGNAL_0 && siggnal != stop_signal)
warning ("Can't send signals to remote NINDY targets.");
- dcache_flush (nindy_dcache);
+ dcache_invd (nindy_dcache);
if (regs_changed)
{
nindy_store_registers (-1);
}
}
bfd_close (file);
+
+ dcache_invd(nindy_dcache);
}
static int
if (!sds_dcache)
sds_dcache = dcache_init (sds_read_bytes, sds_write_bytes);
else
- dcache_flush (sds_dcache);
+ dcache_invd (sds_dcache);
sds_desc = SERIAL_OPEN (name);
if (!sds_desc)
{
unsigned char buf[PBUFSIZ];
- dcache_flush (sds_dcache);
+ dcache_invd (sds_dcache);
last_sent_signal = siggnal;
last_sent_step = step;
if ((dcache = gr_get_dcache()) == NULL)
gr_set_dcache (dcache_init (gr->readfunc, gr->writefunc));
else
- dcache_flush (dcache);
+ dcache_invd (dcache);
if (sr_get_desc () != NULL)
gr_close (0);
if (!remote_dcache)
remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
else
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
remote_desc = SERIAL_OPEN (name);
if (!remote_desc)
else
set_thread (pid, 0); /* run this thread */
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
last_sent_signal = siggnal;
last_sent_step = step;
else
set_thread (pid, 0); /* run this thread */
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
last_sent_signal = siggnal;
last_sent_step = step;
if (!remote_dcache)
remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
else
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
remote_desc = SERIAL_OPEN (name);
if (!remote_desc)
if (!remote_dcache)
remote_dcache = dcache_init (remote_read_bytes, remote_write_bytes);
else
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
exec_file = upload_to_device (exec_file, exec_file);
th->context.ContextFlags = 0;
}
- dcache_flush (remote_dcache);
+ dcache_invd (remote_dcache);
/* Allow continuing with the same signal that interrupted us.
Otherwise complain. */