diff options
author | Jung-uk Kim <jkim@FreeBSD.org> | 2020-05-28 21:01:08 +0000 |
---|---|---|
committer | Jung-uk Kim <jkim@FreeBSD.org> | 2020-05-28 21:01:08 +0000 |
commit | 93207c1c89bcf8c2291abed617712292c27920f3 (patch) | |
tree | 2d4226b65137f1b2ee6fc8f4273a1afd53462393 /source/compiler | |
parent | a95d9dd0e22ace9a8f960e939af923c79e7a271e (diff) |
Notes
Diffstat (limited to 'source/compiler')
-rw-r--r-- | source/compiler/aslcompiler.l | 1 | ||||
-rw-r--r-- | source/compiler/aslkeywords.y | 1 | ||||
-rw-r--r-- | source/compiler/aslmap.c | 1 | ||||
-rw-r--r-- | source/compiler/aslmethod.c | 5 | ||||
-rw-r--r-- | source/compiler/asltokens.y | 1 | ||||
-rw-r--r-- | source/compiler/aslxref.c | 21 |
6 files changed, 26 insertions, 4 deletions
diff --git a/source/compiler/aslcompiler.l b/source/compiler/aslcompiler.l index c12eb90bbb64..4016faeda806 100644 --- a/source/compiler/aslcompiler.l +++ b/source/compiler/aslcompiler.l @@ -693,6 +693,7 @@ NamePathTail [.]{NameSeg} "GeneralPurposeIo" { count (0); return (PARSEOP_REGIONSPACE_GPIO); } /* ACPI 5.0 */ "GenericSerialBus" { count (0); return (PARSEOP_REGIONSPACE_GSBUS); } /* ACPI 5.0 */ "PCC" { count (0); return (PARSEOP_REGIONSPACE_PCC); } /* ACPI 5.0 */ +"PlatformRtMechanism" { count (0); return (PARSEOP_REGIONSPACE_PRM); } "FFixedHW" { count (0); return (PARSEOP_REGIONSPACE_FFIXEDHW); } /* ResourceTypeKeyword: Resource Usage - Resource Descriptors */ diff --git a/source/compiler/aslkeywords.y b/source/compiler/aslkeywords.y index 84a816325563..8b45622946f2 100644 --- a/source/compiler/aslkeywords.y +++ b/source/compiler/aslkeywords.y @@ -394,6 +394,7 @@ RegionSpaceKeyword | PARSEOP_REGIONSPACE_GPIO {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GPIO);} | PARSEOP_REGIONSPACE_GSBUS {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_GSBUS);} | PARSEOP_REGIONSPACE_PCC {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PCC);} + | PARSEOP_REGIONSPACE_PRM {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_PRM);} | PARSEOP_REGIONSPACE_FFIXEDHW {$$ = TrCreateLeafOp (PARSEOP_REGIONSPACE_FFIXEDHW);} ; diff --git a/source/compiler/aslmap.c b/source/compiler/aslmap.c index 651030495aed..2c03cd0805a4 100644 --- a/source/compiler/aslmap.c +++ b/source/compiler/aslmap.c @@ -485,6 +485,7 @@ const ASL_MAPPING_ENTRY AslKeywordMapping [] = /* REGIONSPACE_PCC */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_COMM, 0, 0), /* REGIONSPACE_PCI */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_CONFIG, 0, 0), /* REGIONSPACE_PCIBAR */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PCI_BAR_TARGET, 0, 0), +/* REGIONSPACE_PRM */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_PLATFORM_RT, 0, 0), /* REGIONSPACE_SMBUS */ OP_TABLE_ENTRY (AML_RAW_DATA_BYTE, ACPI_ADR_SPACE_SMBUS, 0, 0), /* REGISTER */ OP_TABLE_ENTRY (AML_BYTE_OP, 0, 0, 0), /* RELEASE */ OP_TABLE_ENTRY (AML_RELEASE_OP, 0, 0, 0), diff --git a/source/compiler/aslmethod.c b/source/compiler/aslmethod.c index d56f4817c9ef..ff6fd474193d 100644 --- a/source/compiler/aslmethod.c +++ b/source/compiler/aslmethod.c @@ -724,7 +724,7 @@ MtCheckNamedObjectInMethod ( } OpInfo = AcpiPsGetOpcodeInfo (Op->Asl.AmlOpcode); - if (OpInfo->Class == AML_CLASS_NAMED_OBJECT) + if ((OpInfo->Class == AML_CLASS_NAMED_OBJECT) && (Op->Asl.AmlOpcode != AML_FIELD_OP)) { /* * 1) Mark the method as a method that creates named objects. @@ -739,6 +739,9 @@ MtCheckNamedObjectInMethod ( * Reason: If a thread blocks within the method for any reason, and * another thread enters the method, the method will fail because * an attempt will be made to create the same object twice. + * + * Note: The Field opcode is disallowed here because Field() does not + * create a new named object. */ ExternalPath = AcpiNsGetNormalizedPathname (MethodInfo->Op->Asl.Node, TRUE); diff --git a/source/compiler/asltokens.y b/source/compiler/asltokens.y index 0b61469a26e3..49c060a51738 100644 --- a/source/compiler/asltokens.y +++ b/source/compiler/asltokens.y @@ -422,6 +422,7 @@ NoEcho(' %token <i> PARSEOP_REGIONSPACE_PCC %token <i> PARSEOP_REGIONSPACE_PCI %token <i> PARSEOP_REGIONSPACE_PCIBAR +%token <i> PARSEOP_REGIONSPACE_PRM %token <i> PARSEOP_REGIONSPACE_SMBUS %token <i> PARSEOP_REGISTER %token <i> PARSEOP_RELEASE diff --git a/source/compiler/aslxref.c b/source/compiler/aslxref.c index 0df33e3117ff..4bbbe2bd91ec 100644 --- a/source/compiler/aslxref.c +++ b/source/compiler/aslxref.c @@ -821,9 +821,24 @@ XfNamespaceLocateBegin ( Node->Flags |= ANOBJ_IS_REFERENCED; } - /* Attempt to optimize the NamePath */ - - OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node); + /* + * Attempt to optimize the NamePath + * + * One special case: CondRefOf operator - not all AML interpreter + * implementations expect optimized namepaths as a parameter to this + * operator. They require relative name paths with prefix operators or + * namepaths starting with the root scope. + * + * Other AML interpreter implementations do not perform the namespace + * search that starts at the current scope and recursively searching the + * parent scope until the root scope. The lack of search is only known to + * occur for the namestring parameter for the CondRefOf operator. + */ + if ((Op->Asl.Parent) && + (Op->Asl.Parent->Asl.ParseOpcode != PARSEOP_CONDREFOF)) + { + OptOptimizeNamePath (Op, OpInfo->Flags, WalkState, Path, Node); + } /* * 1) Dereference an alias (A name reference that is an alias) |