@@ -58,6 +58,8 @@ impl<H> Interpreter<H>
58
58
where
59
59
H : Handler ,
60
60
{
61
+ // TODO: new_from_tables helper that does `new` and then loads the DSDT + any SSDTs
62
+
61
63
pub fn new ( handler : H , dsdt_revision : u8 ) -> Interpreter < H > {
62
64
info ! ( "Initializing AML interpreter v{}" , env!( "CARGO_PKG_VERSION" ) ) ;
63
65
Interpreter {
@@ -272,6 +274,11 @@ where
272
274
| Opcode :: LLess => {
273
275
self . do_logical_op ( & mut context, op) ?;
274
276
}
277
+ Opcode :: ToBuffer
278
+ | Opcode :: ToDecimalString
279
+ | Opcode :: ToHexString
280
+ | Opcode :: ToInteger
281
+ | Opcode :: ToString => todo ! ( ) ,
275
282
Opcode :: Mid => self . do_mid ( & mut context, op) ?,
276
283
Opcode :: Concat => self . do_concat ( & mut context, op) ?,
277
284
Opcode :: ConcatRes => {
@@ -412,7 +419,6 @@ where
412
419
else {
413
420
panic ! ( )
414
421
} ;
415
-
416
422
let predicate = predicate. as_integer ( ) ?;
417
423
let remaining_then_length = then_length - ( context. current_block . pc - start_pc) ;
418
424
@@ -697,6 +703,9 @@ where
697
703
*/
698
704
assert ! ( context. block_stack. len( ) > 0 ) ;
699
705
706
+ // TODO: I think we can handle VarPackage here as well because by the
707
+ // time the block finishes, the first arg should be resolvable (the var
708
+ // length) and so can be updated here...
700
709
if let Some ( package_op) = context. in_flight . last_mut ( )
701
710
&& package_op. op == Opcode :: Package
702
711
{
@@ -872,6 +881,7 @@ where
872
881
Opcode :: Signal => todo ! ( ) ,
873
882
Opcode :: Wait => todo ! ( ) ,
874
883
Opcode :: Reset => todo ! ( ) ,
884
+ Opcode :: Notify => todo ! ( ) ,
875
885
Opcode :: FromBCD | Opcode :: ToBCD => context. start_in_flight_op ( OpInFlight :: new ( opcode, 2 ) ) ,
876
886
Opcode :: Revision => {
877
887
context. contribute_arg ( Argument :: Object ( Arc :: new ( Object :: Integer ( INTERPRETER_REVISION ) ) ) ) ;
@@ -1108,10 +1118,16 @@ where
1108
1118
context. start_in_flight_op ( OpInFlight :: new ( opcode, 2 ) )
1109
1119
}
1110
1120
Opcode :: DerefOf => context. start_in_flight_op ( OpInFlight :: new ( opcode, 1 ) ) ,
1111
- Opcode :: Notify => todo ! ( ) ,
1112
1121
Opcode :: ConcatRes => context. start_in_flight_op ( OpInFlight :: new ( opcode, 3 ) ) ,
1113
1122
Opcode :: SizeOf => context. start_in_flight_op ( OpInFlight :: new ( opcode, 1 ) ) ,
1114
1123
Opcode :: Index => context. start_in_flight_op ( OpInFlight :: new ( opcode, 3 ) ) ,
1124
+ /*
1125
+ * TODO
1126
+ * Match is a difficult opcode to parse, as it interleaves dynamic arguments and
1127
+ * random bytes that need to be extracted as you go. I think we'll need to use 1+
1128
+ * internal in-flight ops to parse the static bytedatas as we go, and then retire
1129
+ * the real op at the end.
1130
+ */
1115
1131
Opcode :: Match => todo ! ( ) ,
1116
1132
1117
1133
Opcode :: CreateBitField
0 commit comments