fix(esp_system): fix test rodata being prefetched into cache unexpectedly

This commit is contained in:
wuzhenghui 2024-08-28 15:42:12 +08:00
parent 05e74480f5
commit 71fb3d2f31
No known key found for this signature in database
GPG Key ID: 3EFEDECDEBA39BB9

View File

@ -60,7 +60,9 @@ TEST_CASE("spi_flash_cache_enabled() works on both CPUs", "[spi_flash][esp_flash
// This needs to sufficiently large array, otherwise it may end up in
// DRAM (e.g. size <= 8 bytes && ARCH == RISCV)
static const uint32_t s_in_rodata[8] = { 0x12345678, 0xfedcba98 };
// And it needs to be >= and aligned to the cacheline size, otherwise it may be prefetched
// to cache data memory before accessing it because of accessing other rodata in the same cacheline.
static const __attribute__((aligned(128))) uint32_t s_in_rodata[32] = { 0x12345678, 0xfedcba98 };
static void reset_after_invalid_cache(void)
{