Explorar el Código

Add predefined root namespaces to the level data structure

Isaac Woods hace 5 años
padre
commit
81b4146be8
Se han modificado 1 ficheros con 11 adiciones y 0 borrados
  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
     }