mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
fix(spi_flash): integrate branch prediction control during cache operations
This commit is contained in:
committed by
Ashish Sharma
parent
d631bca52f
commit
ab48e180ac
@@ -31,6 +31,9 @@ void sleep_cache_suspend(void)
|
||||
// If the access to external memory hits in the cache, it will not trigger a cache error. So in order to
|
||||
// fully check the access to external memory, writeback & invalidate is needed here.
|
||||
Cache_WriteBack_Invalidate_All(CACHE_MAP_MASK);
|
||||
#endif
|
||||
#if SOC_BRANCH_PREDICTOR_SUPPORTED
|
||||
esp_cpu_branch_prediction_disable();
|
||||
#endif
|
||||
spi_flash_disable_cache(esp_cpu_get_core_id(), &s_cache_state);
|
||||
}
|
||||
@@ -43,6 +46,9 @@ void sleep_cache_resume(void)
|
||||
assert(s_cache_suspend_cnt >= 0 && DRAM_STR("cache resume doesn't match suspend ops"));
|
||||
if (s_cache_suspend_cnt == 0) {
|
||||
spi_flash_restore_cache(esp_cpu_get_core_id(), s_cache_state);
|
||||
#if SOC_BRANCH_PREDICTOR_SUPPORTED
|
||||
esp_cpu_branch_prediction_enable();
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user