@@ -246,6 +246,32 @@ where
246
246
length : region_length. as_integer ( ) ?,
247
247
parent_device_path : context. current_scope . clone ( ) ,
248
248
} ) ;
249
+ self . namespace . lock ( ) . insert ( name. resolve ( & context. current_scope ) ?, Arc :: new ( region) ) ?;
250
+ }
251
+ Opcode :: DataRegion => {
252
+ let [
253
+ Argument :: Namestring ( name) ,
254
+ Argument :: Object ( signature) ,
255
+ Argument :: Object ( oem_id) ,
256
+ Argument :: Object ( oem_table_id) ,
257
+ ] = & op. arguments [ ..]
258
+ else {
259
+ panic ! ( )
260
+ } ;
261
+ let _signature = signature. as_string ( ) ?;
262
+ let _oem_id = oem_id. as_string ( ) ?;
263
+ let _oem_table_id = oem_table_id. as_string ( ) ?;
264
+
265
+ // TODO: once this is integrated into the rest of the crate, load the table
266
+ log:: warn!(
267
+ "DefDataRegion encountered in AML! We don't actually support these - produced region will be incorrect"
268
+ ) ;
269
+
270
+ let region = Object :: OpRegion ( OpRegion {
271
+ space : RegionSpace :: SystemMemory ,
272
+ base : 0 ,
273
+ length : 0 ,
274
+ parent_device_path : context. current_scope . clone ( ) ,
249
275
} ) ;
250
276
self . namespace . lock ( ) . insert ( name. resolve ( & context. current_scope ) ?, Arc :: new ( region) ) ?;
251
277
}
@@ -792,6 +818,14 @@ where
792
818
2 ,
793
819
) ) ;
794
820
}
821
+ Opcode :: DataRegion => {
822
+ let name = context. namestring ( ) ?;
823
+ context. start_in_flight_op ( OpInFlight :: new_with (
824
+ Opcode :: DataRegion ,
825
+ vec ! [ Argument :: Namestring ( name) ] ,
826
+ 3 ,
827
+ ) ) ;
828
+ }
795
829
Opcode :: Field => {
796
830
let start_pc = context. current_block . pc ;
797
831
let pkg_length = context. pkglength ( ) ?;
@@ -892,7 +926,6 @@ where
892
926
let old_scope = mem:: replace ( & mut context. current_scope , new_scope) ;
893
927
context. start_new_block ( BlockKind :: Scope { old_scope } , remaining_length) ;
894
928
}
895
- Opcode :: DataRegion => todo ! ( ) ,
896
929
Opcode :: Local ( local) => {
897
930
let local = context. locals [ local as usize ] . clone ( ) ;
898
931
context. last_op ( ) ?. arguments . push ( Argument :: Object ( Arc :: new ( Object :: Reference {
0 commit comments