Lines Matching refs:dcache

24 #include "dcache.h"
35 In general the dcache speeds up performance, some speed improvement
81 /* NOTE: Interaction of dcache and memory region attributes
84 to or be a multiple of the dcache page size, dcache_read_line() and
92 segment fall within the same dcache page with a ro/cacheable memory
165 static int dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr);
167 static int dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr);
169 static struct dcache_block *dcache_hit (DCACHE *dcache, CORE_ADDR addr);
171 static int dcache_write_line (DCACHE *dcache, struct dcache_block *db);
173 static int dcache_read_line (DCACHE *dcache, struct dcache_block *db);
175 static struct dcache_block *dcache_alloc (DCACHE *dcache, CORE_ADDR addr);
177 static int dcache_writeback (DCACHE *dcache);
185 DCACHE *last_cache; /* Used by info dcache */
191 dcache_invalidate (DCACHE *dcache)
194 dcache->valid_head = 0;
195 dcache->valid_tail = 0;
197 dcache->free_head = 0;
198 dcache->free_tail = 0;
202 struct dcache_block *db = dcache->the_cache + i;
204 if (!dcache->free_head)
205 dcache->free_head = db;
207 dcache->free_tail->p = db;
208 dcache->free_tail = db;
215 /* If addr is present in the dcache, return the address of the block
219 dcache_hit (DCACHE *dcache, CORE_ADDR addr)
224 db = dcache->valid_head;
243 dcache_write_line (DCACHE *dcache, struct dcache_block *db)
324 dcache_read_line (DCACHE *dcache, struct dcache_block *db)
337 if (!dcache_write_line (dcache, db))
385 dcache_alloc (DCACHE *dcache, CORE_ADDR addr)
390 db = dcache->free_head;
393 dcache->free_head = db->p;
398 db = dcache->valid_head;
400 if (!dcache_write_line (dcache, db))
403 dcache->valid_head = db->p;
412 if (!dcache->valid_head)
413 dcache->valid_head = db;
415 dcache->valid_tail->p = db;
416 dcache->valid_tail = db;
424 dcache_writeback (DCACHE *dcache)
428 db = dcache->valid_head;
432 if (!dcache_write_line (dcache, db))
446 dcache_peek_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
448 struct dcache_block *db = dcache_hit (dcache, addr);
452 db = dcache_alloc (dcache, addr);
459 if (!dcache_read_line(dcache, db))
473 dcache_poke_byte (DCACHE *dcache, CORE_ADDR addr, char *ptr)
475 struct dcache_block *db = dcache_hit (dcache, addr);
479 db = dcache_alloc (dcache, addr);
495 DCACHE *dcache;
497 dcache = (DCACHE *) xmalloc (sizeof (*dcache));
499 dcache->the_cache = (struct dcache_block *) xmalloc (csize);
500 memset (dcache->the_cache, 0, csize);
502 dcache_invalidate (dcache);
504 last_cache = dcache;
505 return dcache;
510 dcache_free (DCACHE *dcache)
512 if (last_cache == dcache)
515 xfree (dcache->the_cache);
516 xfree (dcache);
528 dcache_xfer_memory (DCACHE *dcache, CORE_ADDR memaddr, char *myaddr, int len,
532 int (*xfunc) (DCACHE *dcache, CORE_ADDR addr, char *ptr);
537 if (!xfunc (dcache, memaddr + i, myaddr + i))
551 dcache_writeback (dcache);
601 add_info ("dcache", dcache_info,
602 "Print information on the dcache performance.");