소스 검색

Add predefined root namespaces to the level data structure

Isaac Woods 5 년 전
부모
커밋
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
     }