int i; dcache->valid_head = 0; dcache->valid_tail = 0;  dcache->free_head = 0; dcache->free_tail = 0;  for (i = 0; i < DCACHE_SIZE; i++) { struct dcache_block *db = dcache->the_cache + i;  if (!dcache->free_head) dcache->free_head = db; else dcache->free_tail->p = db; dcache->free_tail = db; db->p = 0; }  dcache->cache_has_stuff = 0;  return; }    static struct dcache_block * dcache_hit (dcache, addr) DCACHE *dcache; CORE_ADDR addr; { register struct dcache_block *db;
struct dcache_block *db;
dcache_hit PARAMS ((DCACHE *dcache, CORE_ADDR addr));static int dcache_write_line PARAMS ((DCACHE *dcache,struct dcache_block *db));static struct dcache_block *dcache_alloc PARAMS ((DCACHE *dcache));static int dcache_writeback PARAMS ((DCACHE *dcache));static void dcache_info PARAMS ((char *exp, int tty));int remote_dcache = 0;DCACHE *last_cache; /* Used by info dcache *//* Free all the data cache blocks, thus discarding all cached data.  */voiddcache_flush (dcache)     DCACHE *dcache;{  int i;  dcache->valid_head = 0;  dcache->valid_tail = 0;  dcache->free_head = 0;  dcache->free_tail = 0;  for (i = 0; i < DCACHE_SIZE; i++)    {      struct dcache_block *db = dcache->the_cache + i;      if (!dcache->free_head)	dcache->free_head = db;      else	dcache->free_tail->p = db;      dcache->free_tail = db;      db->p = 0;    }  dcache->cache_has_stuff = 0;  return;}/* If addr is present in the dcache, return the address of the block   containing it. */static struct dcache_block *dcache_hit (dcache, addr)     DCACHE *dcache;     CORE_ADDR addr;{  register struct dcache_block *db;  /* Search all cache blocks for one that is at this address.  */  db = dcache->valid_head;  while (db)    {      if (MASK(addr) == db->addr)	{	  db->refs++;	  return db;	}      db = db->p;    }  return NULL;}