Lines Matching refs:tag

248    If it is found then 'return_tag' is set to point to the tag for that line
250 If it is not found, 'return_tag' is set to point to the tag for the least
259 USI tag;
273 /* Now search the set for a valid tag which matches this address. At the
274 same time make note of the least recently used tag, which we will return
277 tag = CACHE_ADDRESS_TAG (cache, address);
281 /* This tag is available as the least recently used if it is the
285 if (found->valid && found->tag == tag)
332 write_line_to_memory (FRV_CACHE *cache, FRV_CACHE_TAG *tag)
334 SI address = tag->tag;
335 int set = CACHE_TAG_SET_NUMBER (cache, tag);
340 write_data_to_memory (cache, address, tag->line, cache->line_size);
360 fill_line_from_memory (FRV_CACHE *cache, FRV_CACHE_TAG *tag, SI address)
370 if (tag->dirty && tag->valid)
374 write_line_to_memory (cache, tag);
376 else if (tag->line == NULL)
378 int line_index = tag - cache->tag_storage;
379 tag->line = cache->data_storage + (line_index * cache->line_size);
385 read_data_from_memory (current_cpu, read_address, tag->line,
387 tag->tag = CACHE_ADDRESS_TAG (cache, address);
388 tag->valid = 1;
391 /* Update the LRU information for the tags in the same set as the given tag. */
393 set_most_recently_used (FRV_CACHE *cache, FRV_CACHE_TAG *tag)
397 FRV_CACHE_TAG *item = cache->tag_storage + CACHE_TAG_SET_START (cache, tag);
402 if (item->lru > tag->lru)
406 tag->lru = cache->ways; /* Mark as most recently used. */
409 /* Update the LRU information for the tags in the same set as the given tag. */
411 set_least_recently_used (FRV_CACHE *cache, FRV_CACHE_TAG *tag)
415 FRV_CACHE_TAG *item = cache->tag_storage + CACHE_TAG_SET_START (cache, tag);
420 if (item->lru != 0 && item->lru < tag->lru)
424 tag->lru = 0; /* Mark as least recently used. */
429 Returns the tag of the requested line. */
434 FRV_CACHE_TAG *tag;
435 int found = get_tag (cache, address, &tag);
440 /* The tag could be NULL is all ways in the set were used and locked. */
441 if (tag == NULL)
442 return tag;
444 fill_line_from_memory (cache, tag, address);
445 tag->dirty = 0;
449 set_most_recently_used (cache, tag);
451 return tag;
455 copy_line_to_return_buffer (FRV_CACHE *cache, int pipe, FRV_CACHE_TAG *tag,
461 tag->line, cache->line_size);
489 FRV_CACHE_TAG *tag;
497 tag = find_or_retrieve_cache_line (cache, address);
499 if (tag == NULL)
504 copy_line_to_return_buffer (cache, pipe, tag, address);
520 FRV_CACHE_TAG *tag;
529 found = get_tag (cache, address, &tag);
533 The tag may be NULL if all ways were in use and locked on a miss.
536 if (tag != NULL && (found || copy_back))
541 fill_line_from_memory (cache, tag, address);
543 memcpy (tag->line + line_offset, data, length);
544 tag->dirty = 1;
547 set_most_recently_used (cache, tag);
552 if (tag == NULL || ! copy_back)
555 if (tag != NULL)
556 tag->dirty = 0;
584 FRV_CACHE_TAG *tag = find_or_retrieve_cache_line (cache, address);
585 if (lock && tag != NULL)
586 tag->locked = 1;
598 FRV_CACHE_TAG *tag;
604 found = get_tag (cache, address, &tag);
607 tag->locked = 0;
631 FRV_CACHE_TAG *tag;
641 found = get_tag (cache, address, &tag);
646 if (tag->dirty && flush)
647 write_line_to_memory (cache, tag);
648 set_least_recently_used (cache, tag);
649 tag->valid = 0;
650 tag->locked = 0;
669 FRV_CACHE_TAG *tag = cache->tag_storage;
673 for(i = 0; i < elements; ++i, ++tag)
676 if (tag->valid && tag->dirty && flush)
677 write_line_to_memory (cache, tag);
678 tag->valid = 0;
679 tag->locked = 0;
1254 FRV_CACHE_TAG *tag;
1266 int found = get_tag (cache, address, &tag);
1271 set_most_recently_used (cache, tag);
1272 copy_line_to_return_buffer (cache, pipe, tag, address);
1289 FRV_CACHE_TAG *tag;
1329 found = get_tag (cache, cur_address, &tag);
1333 tag->locked = 1;
1350 FRV_CACHE_TAG *tag;
1372 found = get_tag (cache, address, &tag);
1376 The tag may be NULL if all ways were in use and locked on a miss.
1380 if (tag != NULL && (found || copy_back))
1398 memcpy (tag->line + line_offset, data, length);
1400 tag->dirty = 1;
1403 set_most_recently_used (cache, tag);
1408 if (tag == NULL || ! copy_back)
1411 if (tag != NULL)
1412 tag->dirty = 0;
1465 FRV_CACHE_TAG *tag;
1474 tag = find_or_retrieve_cache_line (cache, address);
1476 if (tag != NULL)
1480 copy_line_to_return_buffer (cache, pipe, tag, address);
1487 tag->locked = 1;
1626 FRV_CACHE_TAG *tag;
1633 int found = get_tag (cache, address, &tag);
1643 *value = T2H_4 (*(SI *)(tag->line + offset));