From mboxrd@z Thu Jan 1 00:00:00 1970 From: jtc@redback.com (J.T. Conklin) To: "Frank Ch. Eigler" Cc: gdb@sources.redhat.com Subject: Re: Memory attributes triumphs over dcache Date: Wed, 04 Apr 2001 15:50:00 -0000 Message-id: <5mpuesnutt.fsf@jtc.redback.com> References: <5mbsqda24e.fsf@jtc.redback.com> <20010404125206.B19362@redhat.com> X-SW-Source: 2001-04/msg00038.html >>>>> "Frank" == Frank Ch Eigler writes: Frank> What got me worried is the effect of defining a memory region (with Frank> caching but no other flags), then doing a "target remote" download. Frank> It proceeded one byte at a time - yuck! If some combination of the Frank> dcache and memattr system is at fault, this still needs to be Frank> improved. Thanks for pointing this out. dcache_write_line() was totally broken. Can you try this out? It works fine for me, but I'm only doing small writes. A download might be a better test. --jtc Index: dcache.c =================================================================== RCS file: /cvs/src/src/gdb/dcache.c,v retrieving revision 1.14 diff -c -r1.14 dcache.c *** dcache.c 2001/03/06 08:21:06 1.14 --- dcache.c 2001/04/04 22:32:57 *************** *** 278,297 **** while (reg_len > 0) { s = XFORM(memaddr); ! do { if (db->state[s] == ENTRY_DIRTY) break; s++; reg_len--; - } while (reg_len > 0); e = s; ! do { if (db->state[e] != ENTRY_DIRTY) break; e++; reg_len--; ! } while (reg_len > 0); dirty_len = e - s; while (dirty_len > 0) --- 278,301 ---- while (reg_len > 0) { s = XFORM(memaddr); ! while (reg_len > 0) { if (db->state[s] == ENTRY_DIRTY) break; s++; reg_len--; + memaddr++; + myaddr++; + len--; + } + e = s; ! while (reg_len > 0) { if (db->state[e] != ENTRY_DIRTY) break; e++; reg_len--; ! } dirty_len = e - s; while (dirty_len > 0) *************** *** 304,309 **** --- 308,314 ---- memset (&db->state[XFORM(memaddr)], ENTRY_OK, res); memaddr += res; myaddr += res; + len -= res; dirty_len -= res; } } -- J.T. Conklin RedBack Networks