Finalized ACPIType

This commit is contained in:
Connor Wood
2017-06-22 16:25:19 +01:00
parent c83cefee08
commit be1a75e472
3 changed files with 10 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ impl AmlExecutable for DataRefObj {
fn execute(&self, namespace: &mut BTreeMap<String, AmlValue>, scope: String) -> Option<AmlValue> {
match *self {
DataRefObj::DataObj(ref cd) => cd.execute(namespace, scope),
_ => Some(AmlValue::Integer)
_ => Some(AmlValue::Uninitialized)
}
}
}
@@ -57,7 +57,7 @@ impl AmlExecutable for DataObj {
match *self {
DataObj::ComputationalData(ref cd) => cd.execute(namespace, scope),
DataObj::DefPackage(ref pkg) => pkg.execute(namespace, scope),
_ => Some(AmlValue::Integer)
_ => Some(AmlValue::Uninitialized)
}
}
}
@@ -73,7 +73,7 @@ impl AmlExecutable for ComputationalData {
ComputationalData::One => Some(AmlValue::IntegerConstant(1)),
ComputationalData::Ones => Some(AmlValue::IntegerConstant(0xFFFFFFFFFFFFFFFF)),
ComputationalData::String(ref s) => Some(AmlValue::String(s.clone())),
_ => Some(AmlValue::Integer)
_ => Some(AmlValue::Uninitialized)
}
}
}

View File

@@ -8,6 +8,7 @@ use core::str::FromStr;
use super::namedobj::{ RegionSpace, FieldFlags, Method };
use super::termlist::Object;
use super::namestring::SuperName;
use super::type2opcode::Type2OpCode;
#[derive(Debug, Clone)]
pub enum FieldSelector {
@@ -34,7 +35,7 @@ pub enum AmlValue {
index: Box<AmlValue>,
length: Box<AmlValue>
},
DDBHandle,
DDBHandle(u32), // Index into the XSDT
DebugObject,
Device(BTreeMap<String, AmlValue>),
Event,
@@ -45,7 +46,7 @@ pub enum AmlValue {
offset: usize,
length: usize
},
Integer,
Integer(Type2OpCode),
IntegerConstant(u64),
Method(Method),
Mutex(u8),
@@ -67,7 +68,7 @@ pub enum AmlValue {
p_blk: Option<u32>,
obj_list: BTreeMap<String, AmlValue>
},
RawDataBuffer,
RawDataBuffer(Vec<u8>),
ThermalZone(BTreeMap<String, AmlValue>)
}

View File

@@ -70,10 +70,10 @@ impl AmlExecutable for Vec<TermObj> {
impl AmlExecutable for TermArg {
fn execute(&self, namespace: &mut BTreeMap<String, AmlValue>, scope: String) -> Option<AmlValue> {
match *self {
TermArg::LocalObj(ref l) => Some(AmlValue::Integer),
TermArg::LocalObj(ref l) => Some(AmlValue::Uninitialized),
TermArg::DataObj(ref d) => d.execute(namespace, scope),
TermArg::ArgObj(ref a) => Some(AmlValue::Integer),
TermArg::Type2Opcode(ref o) => Some(AmlValue::Integer)
TermArg::ArgObj(ref a) => Some(AmlValue::Uninitialized),
TermArg::Type2Opcode(ref o) => Some(AmlValue::Uninitialized)
}
}
}