summaryrefslogtreecommitdiff
path: root/gdb/dcache.c
diff options
context:
space:
mode:
authorJ.T. Conklin <jtc@redback.com>2001-04-06 22:43:55 +0000
committerJ.T. Conklin <jtc@redback.com>2001-04-06 22:43:55 +0000
commit8a6460b61c0c484dc6df68631f223eb0be318ae7 (patch)
tree0cbd87a9d64781ab6c1467f524b15059c2d2be3e /gdb/dcache.c
parentf6c36799f70c86b91022ba086d6cb89d52392e34 (diff)
downloadgdb-8a6460b61c0c484dc6df68631f223eb0be318ae7.tar.gz
* dcache.c (dcache_write_line): Fixed bugs where cache line was
not written to target correctly.
Diffstat (limited to 'gdb/dcache.c')
-rw-r--r--gdb/dcache.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/dcache.c b/gdb/dcache.c
index d6268f700f3..6e742746363 100644
--- a/gdb/dcache.c
+++ b/gdb/dcache.c
@@ -278,20 +278,24 @@ dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
while (reg_len > 0)
{
s = XFORM(memaddr);
- do {
+ while (reg_len > 0) {
if (db->state[s] == ENTRY_DIRTY)
break;
s++;
reg_len--;
- } while (reg_len > 0);
+
+ memaddr++;
+ myaddr++;
+ len--;
+ }
e = s;
- do {
+ while (reg_len > 0) {
if (db->state[e] != ENTRY_DIRTY)
break;
e++;
reg_len--;
- } while (reg_len > 0);
+ }
dirty_len = e - s;
while (dirty_len > 0)
@@ -304,6 +308,7 @@ dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
memset (&db->state[XFORM(memaddr)], ENTRY_OK, res);
memaddr += res;
myaddr += res;
+ len -= res;
dirty_len -= res;
}
}