From 0652bc8099d941ef83e8066a0735bfd43db345b9 Mon Sep 17 00:00:00 2001
From: Connor Wood <connorwood71@gmail.com>
Date: Tue, 25 Jul 2017 11:29:32 +0100
Subject: [PATCH] Implemented ToBuffer

---
 src/acpi/aml/type2opcode.rs | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/acpi/aml/type2opcode.rs b/src/acpi/aml/type2opcode.rs
index 2d7946bb..1d235d49 100644
--- a/src/acpi/aml/type2opcode.rs
+++ b/src/acpi/aml/type2opcode.rs
@@ -601,15 +601,16 @@ fn parse_def_to_buffer(data: &[u8],
         })
     }
     
-    // TODO: Compute the result
-    // TODO: Store the result, if appropriate
     parser_opcode!(data, 0x96);
 
     let operand = parse_term_arg(&data[2..], ctx)?;
     let target = parse_target(&data[2 + operand.len..], ctx)?;
 
+    let res = AmlValue::Buffer(operand.val.get_as_buffer()?);
+    ctx.modify(target.val, res.clone());
+
     Ok(AmlParseType {
-        val: AmlValue::Uninitialized,
+        val: res,
         len: 1 + operand.len + target.len
     })
 }
-- 
GitLab