- void *tcache_min, *tcache_max;
- int zeros;
- u16 *pt;
-
- // Figure out what the main block is, as subblocks also have the flag set.
- // This relies on sub having single entry. It's possible that innocent
- // block might be hit, but that's not such a big deal.
- if ((p[0] >> 1) != (p[1] >> 1)) {
- for (; p > drc_ram_blk; p--)
- if (p[-1] == 0 || (p[-1] >> 1) == (*p >> 1))
- break;
+ u32 id = ~0, end_addr;
+ int max_zeros = MAX_LITERAL_OFFSET >> shift;
+ int i, zeros;
+
+ if (*p == 0 || (*p >> 1) >= BLOCKID_MAX) {
+ u32 from = ~0, to = 0;
+ dbg(1, "slow-remove blocks at @%08x", a);
+ for (i = 0; i < block_counts[tcache_id]; i++) {
+ if (btab[i].addr <= a && a < btab[i].end_addr) {
+ if (btab[i].addr < from)
+ from = btab[i].addr;
+ if (btab[i].end_addr > to)
+ to = btab[i].end_addr;
+ sh2_smc_rm_block_entry(&btab[i], tcache_id);
+ }
+ }
+ if (from < to) {
+ p = drc_ram_blk + ((from & mask) >> shift);
+ memset(p, 0, (to - from) >> (shift - 1));
+ }
+ return;