Skip to content

Commit e4b49be

Browse files
committed
Parse DefBreakPoint
This is very easy for now, as we don't support any sort of AML debugging. This should actually do something if we want to.
1 parent 8b5b457 commit e4b49be

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

aml/src/opcode.rs

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ pub const DEF_IF_ELSE_OP: u8 = 0xa0;
3939
pub const DEF_ELSE_OP: u8 = 0xa1;
4040
pub const DEF_NOOP_OP: u8 = 0xa3;
4141
pub const DEF_RETURN_OP: u8 = 0xa4;
42+
pub const DEF_BREAKPOINT_OP: u8 = 0xcc;
4243

4344
/*
4445
* Type 2 opcodes

aml/src/type1.rs

+19-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,25 @@ where
1717
* DefNotify | DefRelease | DefReset | DefReturn | DefSignal | DefSleep | DefStall |
1818
* DefWhile
1919
*/
20-
comment_scope(DebugVerbosity::AllScopes, "Type1Opcode", choice!(def_if_else(), def_noop(), def_return()))
20+
comment_scope(
21+
DebugVerbosity::AllScopes,
22+
"Type1Opcode",
23+
choice!(def_breakpoint(), def_if_else(), def_noop(), def_return()),
24+
)
25+
}
26+
27+
fn def_breakpoint<'a, 'c>() -> impl Parser<'a, 'c, ()>
28+
where
29+
'c: 'a,
30+
{
31+
/*
32+
* DefBreakPoint := 0xcc
33+
* TODO: there is no debugger, so this doesn't do anything. If there was, this should stop execution and enter
34+
* the AML debugger.
35+
*/
36+
opcode(opcode::DEF_BREAKPOINT_OP)
37+
.then(comment_scope(DebugVerbosity::AllScopes, "DefBreakPoint", id()))
38+
.discard_result()
2139
}
2240

2341
fn def_if_else<'a, 'c>() -> impl Parser<'a, 'c, ()>

0 commit comments

Comments
 (0)