* monitor.c (monitor_open): If a dcache has already been created,
invalidate it rather than creating another. * ocd.c (ocd_open): Likewise. * remote-nindy.c (nindy_open): Likewise. * remote-sds.c (sds_open): Likewise. * remote-utils.c (gr_open): Likewise. * remote.c (remote_open_1, remote_cisco_open): Likewise. * dcache.c (dcache_alloc): Changed to take address of line as an argument, and to invalidate cache line before returning. (dcache_peek_byte): Updated. (dcache_poke_byte): Updated. -------------------------------------------------------------------
This commit is contained in:
parent
e84d946b3a
commit
f1d7622b95
8 changed files with 63 additions and 22 deletions
24
gdb/dcache.c
24
gdb/dcache.c
|
@ -157,7 +157,7 @@ static struct dcache_block *dcache_hit (DCACHE * dcache, CORE_ADDR addr);
|
|||
|
||||
static int dcache_write_line (DCACHE * dcache, struct dcache_block *db);
|
||||
|
||||
static struct dcache_block *dcache_alloc (DCACHE * dcache);
|
||||
static struct dcache_block *dcache_alloc (DCACHE * dcache, CORE_ADDR addr);
|
||||
|
||||
static int dcache_writeback (DCACHE * dcache);
|
||||
|
||||
|
@ -267,15 +267,10 @@ dcache_write_line (DCACHE *dcache, register struct dcache_block *db)
|
|||
|
||||
|
||||
/* Get a free cache block, put or keep it on the valid list,
|
||||
and return its address. The caller should store into the block
|
||||
the address and data that it describes, then remque it from the
|
||||
free list and insert it into the valid list. This procedure
|
||||
prevents errors from creeping in if a memory retrieval is
|
||||
interrupted (which used to put garbage blocks in the valid
|
||||
list...). */
|
||||
and return its address. */
|
||||
|
||||
static struct dcache_block *
|
||||
dcache_alloc (DCACHE *dcache)
|
||||
dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
|
||||
{
|
||||
register struct dcache_block *db;
|
||||
|
||||
|
@ -297,6 +292,11 @@ dcache_alloc (DCACHE *dcache)
|
|||
dcache_write_line (dcache, db);
|
||||
}
|
||||
|
||||
db->addr = MASK(addr);
|
||||
db->refs = 0;
|
||||
db->anydirty = 0;
|
||||
memset (db->state, ENTRY_BAD, sizeof (db->data));
|
||||
|
||||
/* append this line to end of valid list */
|
||||
if (!dcache->valid_head)
|
||||
dcache->valid_head = db;
|
||||
|
@ -327,9 +327,9 @@ dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
|
|||
dcache_write_line (dcache, db);
|
||||
}
|
||||
else
|
||||
db = dcache_alloc (dcache);
|
||||
db = dcache_alloc (dcache, addr);
|
||||
|
||||
immediate_quit++;
|
||||
db->addr = MASK (addr);
|
||||
while (done < LINE_SIZE)
|
||||
{
|
||||
int try =
|
||||
|
@ -379,9 +379,7 @@ dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
|
|||
|
||||
if (!db)
|
||||
{
|
||||
db = dcache_alloc (dcache);
|
||||
db->addr = MASK (addr);
|
||||
memset (db->state, ENTRY_BAD, sizeof (db->data));
|
||||
db = dcache_alloc (dcache, addr);
|
||||
}
|
||||
|
||||
db->data[XFORM (addr)] = *ptr;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue