mirror of
https://github.com/stenzek/duckstation.git
synced 2025-06-08 04:25:37 +00:00
CPU/Recompiler: Call RaiseBreakException() on BP
For pcdrv.
This commit is contained in:
parent
559f831c30
commit
740758fdda
@ -695,12 +695,20 @@ void CPU::ARM32Recompiler::EndBlockWithException(Exception excode)
|
|||||||
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
||||||
|
|
||||||
// TODO: flush load delay
|
// TODO: flush load delay
|
||||||
// TODO: break for pcdrv
|
|
||||||
|
|
||||||
EmitMov(RARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
EmitMov(RARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
||||||
inst->cop.cop_n));
|
inst->cop.cop_n));
|
||||||
EmitMov(RARG2, m_current_instruction_pc);
|
EmitMov(RARG2, m_current_instruction_pc);
|
||||||
|
if (excode != Exception::BP)
|
||||||
|
{
|
||||||
EmitCall(reinterpret_cast<const void*>(static_cast<void (*)(u32, u32)>(&CPU::RaiseException)));
|
EmitCall(reinterpret_cast<const void*>(static_cast<void (*)(u32, u32)>(&CPU::RaiseException)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EmitMov(RARG3, inst->bits);
|
||||||
|
EmitCall(reinterpret_cast<const void*>(&CPU::RaiseBreakException));
|
||||||
|
}
|
||||||
|
|
||||||
m_dirty_pc = false;
|
m_dirty_pc = false;
|
||||||
|
|
||||||
EndAndLinkBlock(std::nullopt, true, false);
|
EndAndLinkBlock(std::nullopt, true, false);
|
||||||
|
@ -859,12 +859,19 @@ void CPU::ARM64Recompiler::EndBlockWithException(Exception excode)
|
|||||||
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
||||||
|
|
||||||
// TODO: flush load delay
|
// TODO: flush load delay
|
||||||
// TODO: break for pcdrv
|
|
||||||
|
|
||||||
EmitMov(RWARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
EmitMov(RWARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
||||||
inst->cop.cop_n));
|
inst->cop.cop_n));
|
||||||
EmitMov(RWARG2, m_current_instruction_pc);
|
EmitMov(RWARG2, m_current_instruction_pc);
|
||||||
|
if (excode != Exception::BP)
|
||||||
|
{
|
||||||
EmitCall(reinterpret_cast<const void*>(static_cast<void (*)(u32, u32)>(&CPU::RaiseException)));
|
EmitCall(reinterpret_cast<const void*>(static_cast<void (*)(u32, u32)>(&CPU::RaiseException)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EmitMov(RWARG3, inst->bits);
|
||||||
|
EmitCall(reinterpret_cast<const void*>(&CPU::RaiseBreakException));
|
||||||
|
}
|
||||||
m_dirty_pc = false;
|
m_dirty_pc = false;
|
||||||
|
|
||||||
EndAndLinkBlock(std::nullopt, true, false);
|
EndAndLinkBlock(std::nullopt, true, false);
|
||||||
|
@ -659,12 +659,19 @@ void CPU::RISCV64Recompiler::EndBlockWithException(Exception excode)
|
|||||||
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
||||||
|
|
||||||
// TODO: flush load delay
|
// TODO: flush load delay
|
||||||
// TODO: break for pcdrv
|
|
||||||
|
|
||||||
EmitMov(RARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
EmitMov(RARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
||||||
inst->cop.cop_n));
|
inst->cop.cop_n));
|
||||||
EmitMov(RARG2, m_current_instruction_pc);
|
EmitMov(RARG2, m_current_instruction_pc);
|
||||||
|
if (excode != Exception::BP)
|
||||||
|
{
|
||||||
EmitCall(reinterpret_cast<const void*>(static_cast<void (*)(u32, u32)>(&CPU::RaiseException)));
|
EmitCall(reinterpret_cast<const void*>(static_cast<void (*)(u32, u32)>(&CPU::RaiseException)));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EmitMov(RARG3, inst->bits);
|
||||||
|
EmitCall(reinterpret_cast<const void*>(&CPU::RaiseBreakException));
|
||||||
|
}
|
||||||
m_dirty_pc = false;
|
m_dirty_pc = false;
|
||||||
|
|
||||||
EndAndLinkBlock(std::nullopt, true, false);
|
EndAndLinkBlock(std::nullopt, true, false);
|
||||||
|
@ -598,12 +598,21 @@ void CPU::X64Recompiler::EndBlockWithException(Exception excode)
|
|||||||
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
Flush(FLUSH_END_BLOCK | FLUSH_FOR_EXCEPTION | FLUSH_FOR_C_CALL);
|
||||||
|
|
||||||
// TODO: flush load delay
|
// TODO: flush load delay
|
||||||
// TODO: break for pcdrv
|
|
||||||
|
|
||||||
cg->mov(RWARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
cg->mov(RWARG1, Cop0Registers::CAUSE::MakeValueForException(excode, m_current_instruction_branch_delay_slot, false,
|
||||||
inst->cop.cop_n));
|
inst->cop.cop_n));
|
||||||
cg->mov(RWARG2, m_current_instruction_pc);
|
cg->mov(RWARG2, m_current_instruction_pc);
|
||||||
|
|
||||||
|
if (excode != Exception::BP)
|
||||||
|
{
|
||||||
cg->call(static_cast<void (*)(u32, u32)>(&CPU::RaiseException));
|
cg->call(static_cast<void (*)(u32, u32)>(&CPU::RaiseException));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
cg->mov(RWARG3, inst->bits);
|
||||||
|
cg->call(&CPU::RaiseBreakException);
|
||||||
|
}
|
||||||
|
|
||||||
m_dirty_pc = false;
|
m_dirty_pc = false;
|
||||||
|
|
||||||
EndAndLinkBlock(std::nullopt, true, false);
|
EndAndLinkBlock(std::nullopt, true, false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user