Skip to content
Snippets Groups Projects
Unverified Commit 9408e71d authored by Connor Wood's avatar Connor Wood
Browse files

Converted BufferField into Buffer

parent 82762863
No related branches found
No related tags found
1 merge request!48Fully implemented AML parser, some amendments to ACPI infrastructure
...@@ -150,6 +150,17 @@ impl AmlValue { ...@@ -150,6 +150,17 @@ impl AmlValue {
AmlValue::String(ref s) => { AmlValue::String(ref s) => {
Ok(s.clone().into_bytes()) Ok(s.clone().into_bytes())
}, },
AmlValue::BufferField { ref source_buf, ref index, ref length } => {
let buf = source_buf.get_as_buffer()?;
let idx = index.get_as_integer()? as usize;
let len = length.get_as_integer()? as usize;
if idx + len > buf.len() {
return Err(AmlError::AmlValueError);
}
Ok(buf[idx .. idx + len].to_vec())
},
_ => Err(AmlError::AmlValueError) _ => Err(AmlError::AmlValueError)
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment