Namespaces can now be concatenated, handling of SSDTs is now performed
This commit is contained in:
@@ -59,13 +59,11 @@ pub fn parse_aml_table(sdt: &'static Sdt) -> Result<BTreeMap<String, AmlValue>,
|
||||
let mut global_namespace = BTreeMap::new();
|
||||
term_list.execute(&mut global_namespace, global_namespace_specifier.clone());
|
||||
|
||||
println!("{:#?}", global_namespace);
|
||||
|
||||
Ok(global_namespace)
|
||||
}
|
||||
|
||||
pub fn is_aml_table(sdt: &'static Sdt) -> bool {
|
||||
if &sdt.signature == b"DSDT" {//|| &sdt.signature == b"SSDT" {
|
||||
if &sdt.signature == b"DSDT" || &sdt.signature == b"SSDT" {
|
||||
true
|
||||
} else {
|
||||
false
|
||||
|
||||
@@ -5,6 +5,7 @@ use core::intrinsics::{atomic_load, atomic_store};
|
||||
use core::sync::atomic::Ordering;
|
||||
use collections::btree_map::BTreeMap;
|
||||
use collections::string::String;
|
||||
use alloc::boxed::Box;
|
||||
|
||||
use spin::Mutex;
|
||||
|
||||
@@ -198,14 +199,20 @@ fn parse_sdt(sdt: &'static Sdt, active_table: &mut ActivePageTable) {
|
||||
}
|
||||
}
|
||||
} else if is_aml_table(sdt) {
|
||||
ACPI_TABLE.lock().namespace = match parse_aml_table(sdt) {
|
||||
match parse_aml_table(sdt) {
|
||||
Ok(res) => {
|
||||
println!(": Parsed");
|
||||
Some(res)
|
||||
let ref mut namespace = ACPI_TABLE.lock().namespace;
|
||||
|
||||
if let Some(ref mut ns) = *namespace {
|
||||
let mut res = res.clone();
|
||||
ns.append(&mut res);
|
||||
} else {
|
||||
*namespace = Some(res);
|
||||
}
|
||||
},
|
||||
Err(AmlError::AmlParseError(e)) => {
|
||||
println!(": {}", e);
|
||||
None
|
||||
}
|
||||
};
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user