Moved DefDevice and DefThermalZone to namespace
This commit is contained in:
@@ -163,6 +163,14 @@ impl AmlExecutable for NamedObj {
|
||||
namespace.push_to(local_scope_string, AmlNamespaceContents::Value(
|
||||
AmlValue::Method(method.clone())));
|
||||
},
|
||||
NamedObj::DefDevice { ref name, ref obj_list } => {
|
||||
let local_scope_string = get_namespace_string(scope, name.clone());
|
||||
obj_list.execute(namespace, local_scope_string);
|
||||
},
|
||||
NamedObj::DefThermalZone { ref name, ref obj_list } => {
|
||||
let local_scope_string = get_namespace_string(scope, name.clone());
|
||||
obj_list.execute(namespace, local_scope_string);
|
||||
},
|
||||
_ => ()
|
||||
}
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ use collections::vec::Vec;
|
||||
use core::str::FromStr;
|
||||
|
||||
use super::namedobj::{ RegionSpace, FieldFlags, Method };
|
||||
use super::termlist::Object;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct AmlNamespace {
|
||||
@@ -38,7 +39,7 @@ pub enum AmlValue {
|
||||
BufferField,
|
||||
DDBHandle,
|
||||
DebugObject,
|
||||
Device,
|
||||
Device(Vec<Object>),
|
||||
Event,
|
||||
FieldUnit,
|
||||
Integer,
|
||||
|
||||
@@ -37,6 +37,25 @@ pub struct MethodInvocation {
|
||||
|
||||
}
|
||||
|
||||
impl AmlExecutable for Vec<Object> {
|
||||
fn execute(&self, namespace: &mut AmlNamespace, scope: String) -> Option<AmlValue> {
|
||||
for term in self {
|
||||
term.execute(namespace, scope.clone());
|
||||
}
|
||||
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
impl AmlExecutable for Object {
|
||||
fn execute(&self, namespace: &mut AmlNamespace, scope: String) -> Option<AmlValue> {
|
||||
match *self {
|
||||
Object::NamespaceModifier(ref d) => d.execute(namespace, scope),
|
||||
Object::NamedObj(ref d) => d.execute(namespace, scope)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl AmlExecutable for Vec<TermObj> {
|
||||
fn execute(&self, namespace: &mut AmlNamespace, scope: String) -> Option<AmlValue> {
|
||||
for term in self {
|
||||
|
||||
Reference in New Issue
Block a user