浏览代码

Add predefined root namespaces to the level data structure

Isaac Woods 4 年之前
父节点
当前提交
81b4146be8
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      aml/src/lib.rs

+ 11 - 0
aml/src/lib.rs

@@ -148,6 +148,17 @@ impl AmlContext {
             debug_verbosity,
         };
 
+        /*
+         * Add the predefined root namespaces.
+         */
+        context.namespace.add_level(AmlName::from_str("\\_GPE").unwrap(), LevelType::Scope).unwrap();
+        context.namespace.add_level(AmlName::from_str("\\_SB").unwrap(), LevelType::Scope).unwrap();
+        context.namespace.add_level(AmlName::from_str("\\_SI").unwrap(), LevelType::Scope).unwrap();
+        if legacy_mode {
+            context.namespace.add_level(AmlName::from_str("\\_PR").unwrap(), LevelType::Scope).unwrap();
+            context.namespace.add_level(AmlName::from_str("\\_TZ").unwrap(), LevelType::Scope).unwrap();
+        }
+
         context
     }