mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 06:45:33 +00:00
tcg/mips: Make direct jump patching thread-safe
Ensure direct jump patching in MIPS is atomic by using atomic_read()/atomic_set() for code patching. Backports commit c82460a560176ef69c2f0662bd280612e274db96 from qemu
This commit is contained in:
parent
7538001da9
commit
87c3382dc8
|
@ -1886,7 +1886,6 @@ static void tcg_target_init(TCGContext *s)
|
|||
|
||||
void tb_set_jmp_target1(uintptr_t jmp_addr, uintptr_t addr)
|
||||
{
|
||||
uint32_t *ptr = (uint32_t *)jmp_addr;
|
||||
*ptr = deposit32(*ptr, 0, 26, addr >> 2);
|
||||
atomic_set((uint32_t *)jmp_addr, deposit32(OPC_J, 0, 26, addr >> 2));
|
||||
flush_icache_range(jmp_addr, jmp_addr + 4);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue