1
0
Fork 0
mirror of https://github.com/suchmememanyskill/TegraExplorer.git synced 2024-11-22 20:06:43 +00:00

fix the bis cluster cache if too much data was read

This commit is contained in:
suchmememanyskill 2021-01-23 00:09:23 +01:00
parent 0129039d76
commit 81120849d0

View file

@ -219,6 +219,10 @@ static int nx_emmc_bis_read_block(u32 sector, u32 count, void *buff)
// Check if cache entry was previously in use in case of cache loop. // Check if cache entry was previously in use in case of cache loop.
if (cache_filled == 1 && bis_cache->cluster_cache[cluster_cache_end_index].dirty == 1) if (cache_filled == 1 && bis_cache->cluster_cache[cluster_cache_end_index].dirty == 1)
_nx_emmc_bis_flush_cluster(&bis_cache->cluster_cache[cluster_cache_end_index]); _nx_emmc_bis_flush_cluster(&bis_cache->cluster_cache[cluster_cache_end_index]);
if (cache_filled == 1)
cluster_lookup[bis_cache->cluster_cache[cluster_cache_end_index].cluster_num] = -1;
bis_cache->cluster_cache[cluster_cache_end_index].cluster_num = cluster; bis_cache->cluster_cache[cluster_cache_end_index].cluster_num = cluster;
bis_cache->cluster_cache[cluster_cache_end_index].visit_count = 1; bis_cache->cluster_cache[cluster_cache_end_index].visit_count = 1;
bis_cache->cluster_cache[cluster_cache_end_index].dirty = 0; bis_cache->cluster_cache[cluster_cache_end_index].dirty = 0;