|
@@ -101,6 +101,7 @@ where
|
|
|
def_create_bit_field(),
|
|
|
def_create_byte_field(),
|
|
|
def_create_word_field(),
|
|
|
+ def_create_dword_field(),
|
|
|
def_op_region(),
|
|
|
def_field(),
|
|
|
def_method(),
|
|
@@ -277,6 +278,40 @@ where
|
|
|
))
|
|
|
.discard_result()
|
|
|
}
|
|
|
+
|
|
|
+pub fn def_create_dword_field<'a, 'c>() -> impl Parser<'a, 'c, ()>
|
|
|
+where
|
|
|
+ 'c: 'a,
|
|
|
+{
|
|
|
+ /*
|
|
|
+ * DefCreateDWordField := 0x8a SourceBuf ByteIndex NameString
|
|
|
+ * SourceBuf := TermArg => Buffer
|
|
|
+ * ByteIndex := TermArg => Integer
|
|
|
+ */
|
|
|
+ opcode(opcode::DEF_CREATE_DWORD_FIELD_OP)
|
|
|
+ .then(comment_scope(
|
|
|
+ DebugVerbosity::AllScopes,
|
|
|
+ "DefCreateDWordField",
|
|
|
+ term_arg().then(term_arg()).then(name_string()).map_with_context(
|
|
|
+ |((source, index), name), context| {
|
|
|
+ let source_data: Arc<Vec<u8>> = try_with_context!(context, source.as_buffer(context)).clone();
|
|
|
+ let index = try_with_context!(context, index.as_integer(context));
|
|
|
+
|
|
|
+ try_with_context!(
|
|
|
+ context,
|
|
|
+ context.namespace.add_value_at_resolved_path(
|
|
|
+ name,
|
|
|
+ &context.current_scope,
|
|
|
+ AmlValue::BufferField { buffer_data: source_data, offset: index * 8, length: 32 }
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ (Ok(()), context)
|
|
|
+ },
|
|
|
+ ),
|
|
|
+ ))
|
|
|
+ .discard_result()
|
|
|
+}
|
|
|
pub fn def_op_region<'a, 'c>() -> impl Parser<'a, 'c, ()>
|
|
|
where
|
|
|
'c: 'a,
|