arm64 rec: put ngen_FailedToFindBlock at a fixed address

transitioning to MMU will fail it this function's address changes
happens if vmem is disabled (switch)
This commit is contained in:
Flyinghead 2021-07-14 21:03:02 +02:00
parent 8e6dc54b16
commit 8dee648d01
1 changed files with 14 additions and 13 deletions

View File

@ -1295,6 +1295,20 @@ public:
verify((void *)arm64_intc_sched == (void *)CodeCache);
B(&intc_sched);
// Not yet compiled block stub
// WARNING: this function must be at a fixed address, or transitioning to mmu will fail (switch)
ngen_FailedToFindBlock = (void (*)())CC_RW2RX(GetCursorAddress<uintptr_t>());
if (mmu_enabled())
{
GenCallRuntime(rdv_FailedToFindBlock_pc);
}
else
{
Mov(w0, w29);
GenCallRuntime(rdv_FailedToFindBlock);
}
Br(x0);
// void no_update()
Bind(&no_update); // next_pc _MUST_ be on w29
@ -1451,19 +1465,6 @@ public:
GenCallRuntime(rdv_LinkBlock); // returns an RX addr
Br(x0);
// Not yet compiled block stub
ngen_FailedToFindBlock = (void (*)())CC_RW2RX(GetCursorAddress<uintptr_t>());
if (mmu_enabled())
{
GenCallRuntime(rdv_FailedToFindBlock_pc);
}
else
{
Mov(w0, w29);
GenCallRuntime(rdv_FailedToFindBlock);
}
Br(x0);
// Store Queue write handlers
Label writeStoreQueue32Label;
Bind(&writeStoreQueue32Label);