[aarch64] Fix cache flushing out of bounds

Seems like some platforms don't like this very much :|
This commit is contained in:
David Guillen Fandos 2021-12-13 18:54:21 +01:00
parent 76ccba445f
commit c6601d8932
2 changed files with 2 additions and 1 deletions

View File

@ -1861,7 +1861,7 @@ extern void* ldst_lookup_tables[16*4 + 17*6];
void init_emitter() {
rom_cache_watermark = 0;
rom_cache_watermark = INITIAL_ROM_WATERMARK;
init_bios_hooks();
// Generate handler table

View File

@ -3424,6 +3424,7 @@ void init_bios_hooks(void)
// Pre-generate this entry point so that we can safely invoke fast
// SWI calls from ROM and RAM regardless of cache flushes.
rom_translation_ptr = &rom_translation_cache[rom_cache_watermark];
last_rom_translation_ptr = rom_translation_ptr;
bios_swi_entrypoint = block_lookup_address_arm(0x8);
rom_cache_watermark = (u32)(rom_translation_ptr - rom_translation_cache);
}