From afc93f82a90108f9bc38267d615bc9a01582e3c1 Mon Sep 17 00:00:00 2001 From: Connor Wood <connorwood71@gmail.com> Date: Tue, 25 Jul 2017 13:06:10 +0100 Subject: [PATCH] Implemented RefOf --- src/acpi/aml/type2opcode.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/acpi/aml/type2opcode.rs b/src/acpi/aml/type2opcode.rs index c0b1bc8c..d4591ce6 100644 --- a/src/acpi/aml/type2opcode.rs +++ b/src/acpi/aml/type2opcode.rs @@ -266,13 +266,22 @@ fn parse_def_ref_of(data: &[u8], }) } - // TODO: Perform computation parser_opcode!(data, 0x71); let obj = parse_super_name(&data[1..], ctx)?; + let res = match obj.val { + AmlValue::String(ref s) => { + match ctx.get(AmlValue::String(s.clone())) { + AmlValue::None => return Err(AmlError::AmlValueError), + _ => ObjectReference::Object(s.clone()) + } + }, + AmlValue::ObjectReference(ref o) => o.clone(), + _ => return Err(AmlError::AmlValueError) + }; Ok(AmlParseType { - val: AmlValue::Uninitialized, + val: AmlValue::ObjectReference(res), len: 1 + obj.len }) } -- GitLab