Browse Source

Add predefined root namespaces to the level data structure

Isaac Woods 4 years ago
parent
commit
81b4146be8
1 changed files with 11 additions and 0 deletions
  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
     }