Moved DDB handles over to using signature scheme
This commit is contained in:
@@ -12,6 +12,8 @@ use super::namedobj::{ RegionSpace, FieldFlags };
|
||||
use super::parser::{AmlExecutionContext, ExecutionState};
|
||||
use super::AmlError;
|
||||
|
||||
use acpi::SdtSignature;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub enum FieldSelector {
|
||||
Region(String),
|
||||
@@ -115,7 +117,7 @@ pub enum AmlValue {
|
||||
Alias(String),
|
||||
Buffer(Vec<u8>),
|
||||
BufferField(BufferField),
|
||||
DDBHandle(Vec<String>),
|
||||
DDBHandle((Vec<String>, SdtSignature)),
|
||||
DebugObject,
|
||||
Device(Device),
|
||||
Event(u64),
|
||||
@@ -252,7 +254,7 @@ impl AmlValue {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_as_ddb_handle(&self) -> Result<Vec<String>, AmlError> {
|
||||
pub fn get_as_ddb_handle(&self) -> Result<(Vec<String>, SdtSignature), AmlError> {
|
||||
// TODO: Integer conversion
|
||||
match *self {
|
||||
AmlValue::DDBHandle(ref v) => Ok(v.clone()),
|
||||
|
||||
@@ -7,7 +7,7 @@ use super::namestring::{parse_name_string, parse_super_name};
|
||||
|
||||
use time::monotonic;
|
||||
|
||||
use acpi::Sdt;
|
||||
use acpi::{Sdt, load_table, get_sdt_signature};
|
||||
use super::{parse_aml_table, is_aml_table};
|
||||
|
||||
pub fn parse_type1_opcode(data: &[u8],
|
||||
@@ -155,8 +155,9 @@ fn parse_def_load(data: &[u8],
|
||||
let sdt = unsafe { &*(tbl.as_ptr() as *const Sdt) };
|
||||
|
||||
if is_aml_table(sdt) {
|
||||
load_table(get_sdt_signature(sdt));
|
||||
let delta = parse_aml_table(sdt)?;
|
||||
ctx.modify(ddb_handle_object.val, AmlValue::DDBHandle(delta));
|
||||
ctx.modify(ddb_handle_object.val, AmlValue::DDBHandle((delta, get_sdt_signature(sdt))));
|
||||
|
||||
Ok(AmlParseType {
|
||||
val: AmlValue::None,
|
||||
@@ -363,7 +364,7 @@ fn parse_def_unload(data: &[u8],
|
||||
let mut namespace = ctx.prelock();
|
||||
|
||||
if let Some(ref mut ns) = *namespace {
|
||||
for o in delta {
|
||||
for o in delta.0 {
|
||||
ns.remove(&o);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1367,7 +1367,7 @@ fn parse_def_load_table(data: &[u8],
|
||||
ctx.modify(parameter_path.val, parameter_data.val);
|
||||
|
||||
return Ok(AmlParseType {
|
||||
val: AmlValue::DDBHandle(hdl),
|
||||
val: AmlValue::DDBHandle((hdl, sdt_signature)),
|
||||
len: 2 + signature.len + oem_id.len + oem_table_id.len + root_path.len + parameter_path.len + parameter_data.len
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user