diff options
author | J.T. Conklin <jtc@redback.com> | 2000-11-03 22:00:56 +0000 |
---|---|---|
committer | J.T. Conklin <jtc@redback.com> | 2000-11-03 22:00:56 +0000 |
commit | 4e3cb06fa480c4938db1141608f804bfec335602 (patch) | |
tree | 63404e215bc61e92636a7423fa87625d6de0f1d0 /gdb/monitor.c | |
parent | 3909f3bc19f48cf39f4003a901ba3adda5e77dfa (diff) | |
download | gdb-4e3cb06fa480c4938db1141608f804bfec335602.tar.gz |
* TODO: Note abstraction layer violation where "ocd reset" command
must invalidate the dcache, and how this might be fixed.
* monitor.c (#include "dcache.h"): Removed.
(remote_dcache): Removed.
(monitor_open): Removed code that created local dcache.
(flush_monitor_dcache): Removed (unused function).
(monitor_resume): Removed call to dcache_invd().
(monitor_load): Likewise.
(monitor_xfer_memory): Changed to call monitor_write_memory(),
monitor_write_memory_block(), and monitor_read_memory() instead
of dcache_xfer_memory().
* monitor.h (flush_monitor_dcache): Removed (unused function).
* ocd.c (#include "dcache.h"): Removed.
(ocd_dcache): Removed.
(ocd_open): Removed code that created local dcache.
(ocd_resume): Removed call to dcache_invd().
(ocd_xfer_memory): Changed to call ocd_write_bytes() and
ocd_read_bytes() instead of dcache_xfer_memory().
(bdm_reset_command): Invalidate target dcache.
* remote-bug.c (bug_load): Remove call to dcache_invd().
(bug_resume): Likewise.
(bug_settings): Remove dcache, readfunc, and writefunc fields
from initializer.
(bug_xfer_memory): Changed to call bug_read_memory() and
bug_write_memory() instead of dcache_xfer_memory().
* remote-nindy.c (#include "dcache.h"): Removed.
(nindy_dcache): Removed.
(nindy_open): Removed code that created local dcache.
(nindy_resume): Removed call to dcache_invd().
(nindy_load): Likewise.
(nindy_xfer_inferior_memory): Changed to call ninMemPut() and
ninMemGet() instead of dcache_xfer_memory().
* remote-sds.c (#include "dcache.h"): Removed.
(sds_dcache): Removed.
(sds_open): Removed code that created local dcache.
(sds_resume): Removed call to dcache_invd().
(sds_xfer_memory): Changed to call sds_write_bytes() and
sds_read_bytes() instead of dcache_xfer_memory().
* remote-utils.c (gr_open): Removed code that created local dcache.
* remote-utils.h (#include "dcache.h"): Removed.
(struct gr_settings): Removed dcache, readfunc, and writefunc fields.
(gr_get_dcache, gr_set_dcache): Removed macro definitions.
* remote.c (#include "dcache.h"): Removed.
(remote_dcache): Removed.
(remote_open_1): Removed code that created local dcache.
(remote_async_open_1): Likewise.
(remote_resume): Removed call to dcache_invd().
(remote_async_resume): Likewise.
(remote_xfer_memory): Changed to call remote_write_bytes() and
remote_read_bytes() instead of dcache_xfer_memory().
* wince.c (#include "dcache.h"): Removed.
(remote_dcache): Removed.
(child_create_inferior): Removed code that created local dcache.
(child_xfer_memory): Changed to call remote_write_bytes() and
remote_read_bytes() instead of dcache_xfer_memory().
(child_resume): Removed call to dcache_invd().
* target.c (target_dcache): Added.
(target_load): Invalidate target_dcache.
(do_xfer_memory): New function.
(target_xfer_memory): Reimplement in terms of dcache_xfer_memory().
(target_xfer_memory_partial): Likewise.
(initialize_targets): Create target_dcache.
* target.h (#include "dcache.h"): Added.
(target_open): Invalidate target_dcache.
(target_resume): Likewise.
(do_xfer_memory): New declaration.
* dcache.c (dcache_init): Removed reading and writing arguments.
(dcache_struct): Removed read_memory and write_memory fields.
(dcache_write_line): Call do_xfer_memory.
(dcache_read_line): Likewise.
(dcache_xfer_memory): Likewise.
(dcache_invalidate): Renamed from dcache_invd.
(dcache_init): Updated.
(dcache_xfer_memory): Updated.
* dcache.h (memxferfunc): Removed definition.
Diffstat (limited to 'gdb/monitor.c')
-rw-r--r-- | gdb/monitor.c | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/gdb/monitor.c b/gdb/monitor.c index 3206470bbfa..dec36da698b 100644 --- a/gdb/monitor.c +++ b/gdb/monitor.c @@ -51,7 +51,6 @@ #include "gdbcmd.h" #include "inferior.h" #include "gdb_regex.h" -#include "dcache.h" #include "srec.h" static char *dev_name; @@ -130,7 +129,6 @@ static char getmem_resp_delim_fastmap[256]; static int dump_reg_flag; /* Non-zero means do a dump_registers cmd when monitor_wait wakes up. */ -static DCACHE *remote_dcache; static int first_time = 0; /* is this the first time we're executing after gaving created the child proccess? */ @@ -838,15 +836,6 @@ monitor_open (char *args, struct monitor_ops *mon_ops, int from_tty) monitor_printf (current_monitor->line_term); - 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 - remote_dcache = dcache_init (monitor_read_memory, monitor_write_memory); - start_remote (); } @@ -929,12 +918,6 @@ monitor_supply_register (int regno, char *valstr) /* Tell the remote machine to resume. */ -void -flush_monitor_dcache (void) -{ - dcache_invd (remote_dcache); -} - static void monitor_resume (int pid, int step, enum target_signal sig) { @@ -948,7 +931,6 @@ monitor_resume (int pid, int step, enum target_signal sig) dump_reg_flag = 1; return; } - dcache_invd (remote_dcache); if (step) monitor_printf (current_monitor->step); else @@ -2008,7 +1990,21 @@ static int monitor_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, struct target_ops *target) { - return dcache_xfer_memory (remote_dcache, memaddr, myaddr, len, write); + int res; + + if (write) + { + if (current_monitor->flags & MO_HAS_BLOCKWRITES) + res = monitor_write_memory_block(memaddr, myaddr, len); + else + res = monitor_write_memory(memaddr, myaddr, len); + } + else + { + res = monitor_read_memory(memaddr, myaddr, len); + } + + return res; } static void @@ -2145,7 +2141,6 @@ monitor_wait_srec_ack (void) static void monitor_load (char *file, int from_tty) { - dcache_invd (remote_dcache); monitor_debug ("MON load\n"); if (current_monitor->load_routine) |