board_inspector: fix scope opening in the AML parser

According to section 19 of ACPI spec 6.4, the following clauses open name
scopes (in addition to the Scope clauses).

  - Function
  - Device
  - Method
  - Power Resource
  - Thermal Zone

The current AML parser only opens a scope when parsing DefMethod and
DefDevice, however. This patch fixes the AML parsing by opening a scope on
visiting a DefPowerRes or DefThermalZone clause.

Note: Functions in ASL are equivalent to Methods at AML level.

Tracked-On: #6298
Signed-off-by: Junjie Mao <junjie.mao@intel.com>
This commit is contained in:
Junjie Mao 2021-07-21 14:17:32 +08:00 committed by wenlingz
parent a5f5ed0865
commit 1ad836e9a8

View File

@ -588,10 +588,18 @@ def DefOpRegion_hook_named(context, tree, name):
def DefPowerRes_hook_named(context, tree, name): def DefPowerRes_hook_named(context, tree, name):
sym = NamedDecl(name, tree) sym = NamedDecl(name, tree)
context.register_symbol(sym) context.register_symbol(sym)
context.change_scope(name)
def DefPowerRes_hook_post(context, tree):
context.pop_scope()
def DefThermalZone_hook_named(context, tree, name): def DefThermalZone_hook_named(context, tree, name):
sym = NamedDecl(name, tree) sym = NamedDecl(name, tree)
context.register_symbol(sym) context.register_symbol(sym)
context.change_scope(name)
def DefThermalZone_hook_post(context, tree):
context.pop_scope()
################################################################################ ################################################################################
# Instantiate parsers # Instantiate parsers