DynamicTablesPkg: Correct _PSD package format
The _PSD structure should have nested packages. The current implementation generates Name (_PSD, Package() { NumEntries // Integer Revision // Integer (BYTE) Domain // Integer (DWORD) CoordType // Integer (DWORD) NumProcessors // Integer (DWORD) }) when this should be Name (_PSD, Package() { Package() { NumEntries // Integer Revision // Integer (BYTE) Domain // Integer (DWORD) CoordType // Integer (DWORD) NumProcessors // Integer (DWORD) } }) REF: https://uefi.org/specs/ACPI/6.5/08_Processor_Configuration_and_Control.html#psd-p-state-dependency Signed-off-by: Jeff Brasen <jbrasen@nvidia.com>
This commit is contained in:
parent
54469a6918
commit
8cce048d48
|
@ -4183,11 +4183,13 @@ exit_handler:
|
||||||
Creates and optionally adds the following node
|
Creates and optionally adds the following node
|
||||||
Name(_PSD, Package()
|
Name(_PSD, Package()
|
||||||
{
|
{
|
||||||
|
Package () {
|
||||||
NumEntries, // Integer
|
NumEntries, // Integer
|
||||||
Revision, // Integer
|
Revision, // Integer
|
||||||
Domain, // Integer
|
Domain, // Integer
|
||||||
CoordType, // Integer
|
CoordType, // Integer
|
||||||
NumProc, // Integer
|
NumProc, // Integer
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)
|
Cf. ACPI 6.5, s8.4.5.5 _PSD (P-State Dependency)
|
||||||
|
@ -4213,10 +4215,14 @@ AmlCreatePsdNode (
|
||||||
{
|
{
|
||||||
EFI_STATUS Status;
|
EFI_STATUS Status;
|
||||||
AML_OBJECT_NODE_HANDLE PsdNode;
|
AML_OBJECT_NODE_HANDLE PsdNode;
|
||||||
|
AML_OBJECT_NODE_HANDLE PsdParentPackage;
|
||||||
AML_OBJECT_NODE_HANDLE PsdPackage;
|
AML_OBJECT_NODE_HANDLE PsdPackage;
|
||||||
AML_OBJECT_NODE_HANDLE IntegerNode;
|
AML_OBJECT_NODE_HANDLE IntegerNode;
|
||||||
UINT32 NumberOfEntries;
|
UINT32 NumberOfEntries;
|
||||||
|
|
||||||
|
PsdParentPackage = NULL;
|
||||||
|
PsdPackage = NULL;
|
||||||
|
|
||||||
if ((PsdInfo == NULL) ||
|
if ((PsdInfo == NULL) ||
|
||||||
((ParentNode == NULL) && (NewPsdNode == NULL)))
|
((ParentNode == NULL) && (NewPsdNode == NULL)))
|
||||||
{
|
{
|
||||||
|
@ -4253,19 +4259,25 @@ AmlCreatePsdNode (
|
||||||
|
|
||||||
// Get the Package object node of the _PSD node,
|
// Get the Package object node of the _PSD node,
|
||||||
// which is the 2nd fixed argument (i.e. index 1).
|
// which is the 2nd fixed argument (i.e. index 1).
|
||||||
PsdPackage = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
|
PsdParentPackage = (AML_OBJECT_NODE_HANDLE)AmlGetFixedArgument (
|
||||||
PsdNode,
|
PsdNode,
|
||||||
EAmlParseIndexTerm1
|
EAmlParseIndexTerm1
|
||||||
);
|
);
|
||||||
if ((PsdPackage == NULL) ||
|
if ((PsdParentPackage == NULL) ||
|
||||||
(AmlGetNodeType ((AML_NODE_HANDLE)PsdPackage) != EAmlNodeObject) ||
|
(AmlGetNodeType ((AML_NODE_HANDLE)PsdParentPackage) != EAmlNodeObject) ||
|
||||||
(!AmlNodeHasOpCode (PsdPackage, AML_PACKAGE_OP, 0)))
|
(!AmlNodeHasOpCode (PsdParentPackage, AML_PACKAGE_OP, 0)))
|
||||||
{
|
{
|
||||||
Status = EFI_INVALID_PARAMETER;
|
Status = EFI_INVALID_PARAMETER;
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = AmlCodeGenPackage (&PsdPackage);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
goto error_handler;
|
||||||
|
}
|
||||||
|
|
||||||
// NumEntries
|
// NumEntries
|
||||||
Status = AmlCodeGenInteger (NumberOfEntries, &IntegerNode);
|
Status = AmlCodeGenInteger (NumberOfEntries, &IntegerNode);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
|
@ -4351,6 +4363,17 @@ AmlCreatePsdNode (
|
||||||
goto error_handler;
|
goto error_handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Status = AmlVarListAddTail (
|
||||||
|
(AML_NODE_HANDLE)PsdParentPackage,
|
||||||
|
(AML_NODE_HANDLE)PsdPackage
|
||||||
|
);
|
||||||
|
if (EFI_ERROR (Status)) {
|
||||||
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
goto error_handler;
|
||||||
|
}
|
||||||
|
|
||||||
|
PsdPackage = NULL; // Prevent double free if error occurs after this point
|
||||||
|
|
||||||
Status = LinkNode (PsdNode, ParentNode, NewPsdNode);
|
Status = LinkNode (PsdNode, ParentNode, NewPsdNode);
|
||||||
if (EFI_ERROR (Status)) {
|
if (EFI_ERROR (Status)) {
|
||||||
ASSERT_EFI_ERROR (Status);
|
ASSERT_EFI_ERROR (Status);
|
||||||
|
@ -4360,6 +4383,13 @@ AmlCreatePsdNode (
|
||||||
return Status;
|
return Status;
|
||||||
|
|
||||||
error_handler:
|
error_handler:
|
||||||
AmlDeleteTree ((AML_NODE_HANDLE)PsdNode);
|
if (PsdPackage != NULL) {
|
||||||
|
AmlDeleteTree ((AML_NODE_HANDLE)PsdPackage);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PsdParentPackage != NULL) {
|
||||||
|
AmlDeleteTree ((AML_NODE_HANDLE)PsdParentPackage);
|
||||||
|
}
|
||||||
|
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue