A64: Implement BRK
Currently, we can just implement this as part of the exception interface, similar to how it's done for the A32 interface with BKPT.
This commit is contained in:
parent
b915364c16
commit
6b5ea6ee66
3 changed files with 9 additions and 1 deletions
|
@ -38,6 +38,8 @@ enum class Exception {
|
||||||
SendEventLocal,
|
SendEventLocal,
|
||||||
/// A YIELD instruction was executed.
|
/// A YIELD instruction was executed.
|
||||||
Yield,
|
Yield,
|
||||||
|
/// A BRK instruction was executed.
|
||||||
|
Breakpoint,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class DataCacheOperation {
|
enum class DataCacheOperation {
|
||||||
|
|
|
@ -34,7 +34,7 @@ INST(B_cond, "B.cond", "01010
|
||||||
INST(SVC, "SVC", "11010100000iiiiiiiiiiiiiiii00001")
|
INST(SVC, "SVC", "11010100000iiiiiiiiiiiiiiii00001")
|
||||||
//INST(HVC, "HVC", "11010100000iiiiiiiiiiiiiiii00010")
|
//INST(HVC, "HVC", "11010100000iiiiiiiiiiiiiiii00010")
|
||||||
//INST(SMC, "SMC", "11010100000iiiiiiiiiiiiiiii00011")
|
//INST(SMC, "SMC", "11010100000iiiiiiiiiiiiiiii00011")
|
||||||
//INST(BRK, "BRK", "11010100001iiiiiiiiiiiiiiii00000")
|
INST(BRK, "BRK", "11010100001iiiiiiiiiiiiiiii00000")
|
||||||
//INST(HLT, "HLT", "11010100010iiiiiiiiiiiiiiii00000")
|
//INST(HLT, "HLT", "11010100010iiiiiiiiiiiiiiii00000")
|
||||||
//INST(DCPS1, "DCPS1", "11010100101iiiiiiiiiiiiiiii00001")
|
//INST(DCPS1, "DCPS1", "11010100101iiiiiiiiiiiiiiii00001")
|
||||||
//INST(DCPS2, "DCPS2", "11010100101iiiiiiiiiiiiiiii00010")
|
//INST(DCPS2, "DCPS2", "11010100101iiiiiiiiiiiiiiii00010")
|
||||||
|
|
|
@ -8,6 +8,12 @@
|
||||||
|
|
||||||
namespace Dynarmic::A64 {
|
namespace Dynarmic::A64 {
|
||||||
|
|
||||||
|
bool TranslatorVisitor::BRK([[maybe_unused]] Imm<16> imm16) {
|
||||||
|
ir.ExceptionRaised(Exception::Breakpoint);
|
||||||
|
ir.SetTerm(IR::Term::CheckHalt{IR::Term::ReturnToDispatch{}});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool TranslatorVisitor::SVC(Imm<16> imm16) {
|
bool TranslatorVisitor::SVC(Imm<16> imm16) {
|
||||||
ir.PushRSB(ir.current_location->AdvancePC(4));
|
ir.PushRSB(ir.current_location->AdvancePC(4));
|
||||||
ir.SetPC(ir.Imm64(ir.current_location->PC() + 4));
|
ir.SetPC(ir.Imm64(ir.current_location->PC() + 4));
|
||||||
|
|
Loading…
Reference in a new issue