TianoCore EDK2 master
Loading...
Searching...
No Matches
SsdtCpuTopologyGenerator.c File Reference

Go to the source code of this file.

Macros

#define SSDT_CPU_TOPOLOGY_GENERATOR_REVISION   CREATE_REVISION (1, 0)
 

Functions

 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjProcHierarchyInfo, CM_ARCH_COMMON_PROC_HIERARCHY_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjCmRef, CM_ARCH_COMMON_OBJ_REF)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjLpiInfo, CM_ARCH_COMMON_LPI_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjCpcInfo, CM_ARCH_COMMON_CPC_INFO)
 
 GET_OBJECT_LIST (EObjNameSpaceArchCommon, EArchCommonObjPsdInfo, CM_ARCH_COMMON_PSD_INFO)
 
STATIC EFI_STATUS EFIAPI TokenTableInitialize (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN UINT32 Count)
 
STATIC VOID EFIAPI TokenTableFree (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator)
 
STATIC UINT32 EFIAPI TokenTableAdd (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CM_OBJECT_TOKEN Token)
 
EFI_STATUS EFIAPI WriteAslName (IN CHAR8 LeadChar, IN UINT32 Value, IN OUT CHAR8 *AslName)
 
STATIC EFI_STATUS EFIAPI CreateAmlPsdNode (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CM_OBJECT_TOKEN PsdToken, IN AML_OBJECT_NODE_HANDLE *Node)
 
EFI_STATUS EFIAPI CreateAmlCpcNode (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CM_OBJECT_TOKEN CpcToken, IN AML_OBJECT_NODE_HANDLE *Node)
 
STATIC EFI_STATUS EFIAPI CreateAmlLpiMethod (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CM_ARCH_COMMON_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo, IN AML_OBJECT_NODE_HANDLE *Node)
 
STATIC EFI_STATUS EFIAPI GenerateLpiStates (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN AML_OBJECT_NODE_HANDLE ScopeNode)
 
EFI_STATUS EFIAPI CreateAmlCpu (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN AML_NODE_HANDLE ParentNode, IN UINT32 AcpiProcessorUid, IN UINT32 CpuName, OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL)
 
STATIC EFI_STATUS EFIAPI CreateAmlCpuFromProcHierarchy (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN AML_NODE_HANDLE ParentNode, IN UINT32 CpuName, IN CM_ARCH_COMMON_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo)
 
STATIC EFI_STATUS EFIAPI CreateAmlProcessorContainer (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN AML_NODE_HANDLE ParentNode, IN CM_ARCH_COMMON_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo, IN UINT16 ProcContainerName, IN UINT32 ProcContainerUid, OUT AML_OBJECT_NODE_HANDLE *ProcContainerNodePtr)
 
STATIC EFI_STATUS EFIAPI CheckProcNode (UINT32 NodeFlags, BOOLEAN IsLeaf, CM_OBJECT_TOKEN NodeToken, CM_OBJECT_TOKEN ParentNodeToken, BOOLEAN PackageNodeSeen)
 
STATIC EFI_STATUS EFIAPI CreateAmlCpuTopologyTree (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN CM_OBJECT_TOKEN NodeToken, IN AML_NODE_HANDLE ParentNode, IN OUT UINT32 *ProcContainerIndex, IN BOOLEAN PackageNodeSeen)
 
STATIC EFI_STATUS EFIAPI CreateTopologyFromProcHierarchy (IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN AML_OBJECT_NODE_HANDLE ScopeNode)
 
STATIC EFI_STATUS EFIAPI BuildSsdtCpuTopologyTable (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
STATIC EFI_STATUS EFIAPI FreeSsdtCpuTopologyTableResources (IN CONST ACPI_TABLE_GENERATOR *CONST This, IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo, IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol, IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST Table)
 
EFI_STATUS EFIAPI AcpiSsdtCpuTopologyLibConstructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 
EFI_STATUS EFIAPI AcpiSsdtCpuTopologyLibDestructor (IN EFI_HANDLE ImageHandle, IN EFI_SYSTEM_TABLE *SystemTable)
 

Variables

STATIC ACPI_CPU_TOPOLOGY_GENERATOR SsdtCpuTopologyGenerator
 

Detailed Description

SSDT Cpu Topology Table Generator.

Copyright (c) 2021 - 2023, Arm Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Reference(s):
Glossary:
  • ETE - Embedded Trace Extension.
  • ETM - Embedded Trace Macrocell.

Definition in file SsdtCpuTopologyGenerator.c.

Macro Definition Documentation

◆ SSDT_CPU_TOPOLOGY_GENERATOR_REVISION

#define SSDT_CPU_TOPOLOGY_GENERATOR_REVISION   CREATE_REVISION (1, 0)

This macro defines the SSDT Cpu Topology Table Generator revision.

Definition at line 1343 of file SsdtCpuTopologyGenerator.c.

Function Documentation

◆ AcpiSsdtCpuTopologyLibConstructor()

EFI_STATUS EFIAPI AcpiSsdtCpuTopologyLibConstructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Register the Generator with the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is registered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_ALREADY_STARTEDThe Generator for the Table ID is already registered.

Definition at line 1403 of file SsdtCpuTopologyGenerator.c.

◆ AcpiSsdtCpuTopologyLibDestructor()

EFI_STATUS EFIAPI AcpiSsdtCpuTopologyLibDestructor ( IN EFI_HANDLE  ImageHandle,
IN EFI_SYSTEM_TABLE SystemTable 
)

Deregister the Generator from the ACPI Table Factory.

Parameters
[in]ImageHandleThe handle to the image.
[in]SystemTablePointer to the System Table.
Return values
EFI_SUCCESSThe Generator is deregistered.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe Generator is not registered.

Definition at line 1432 of file SsdtCpuTopologyGenerator.c.

◆ BuildSsdtCpuTopologyTable()

STATIC EFI_STATUS EFIAPI BuildSsdtCpuTopologyTable ( IN CONST ACPI_TABLE_GENERATOR *CONST  This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST  AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
OUT EFI_ACPI_DESCRIPTION_HEADER **CONST  Table 
)

Construct the SSDT Cpu Topology ACPI table.

This function invokes the Configuration Manager protocol interface to get the required hardware information for generating the ACPI table.

If this function allocates any resources then they must be freed in the FreeXXXXTableResources function.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[out]TablePointer to the constructed ACPI Table.
Return values
EFI_SUCCESSTable generated successfully.
EFI_INVALID_PARAMETERA parameter is invalid.
EFI_NOT_FOUNDThe required object was not found.
EFI_BAD_BUFFER_SIZEThe size returned by the Configuration Manager is less than the Object size for the requested object.

Definition at line 1206 of file SsdtCpuTopologyGenerator.c.

◆ CheckProcNode()

STATIC EFI_STATUS EFIAPI CheckProcNode ( UINT32  NodeFlags,
BOOLEAN  IsLeaf,
CM_OBJECT_TOKEN  NodeToken,
CM_OBJECT_TOKEN  ParentNodeToken,
BOOLEAN  PackageNodeSeen 
)

Check flags and topology of a ProcNode.

Parameters
[in]NodeFlagsFlags of the ProcNode to check.
[in]IsLeafThe ProcNode is a leaf.
[in]NodeTokenNodeToken of the ProcNode.
[in]ParentNodeTokenParent NodeToken of the ProcNode.
[in]PackageNodeSeenA parent of the ProcNode has the physical package flag set.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 919 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlCpcNode()

EFI_STATUS EFIAPI CreateAmlCpcNode ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN CM_OBJECT_TOKEN  CpcToken,
IN AML_OBJECT_NODE_HANDLE Node 
)

Create and add an _CPC Node to Cpu Node.

For instance, transform an AML node from: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") }

To: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") Name(_CPC, Package() { NumEntries, // Integer Revision, // Integer HighestPerformance, // Integer or Buffer (Resource Descriptor) NominalPerformance, // Integer or Buffer (Resource Descriptor) LowestNonlinearPerformance, // Integer or Buffer (Resource Descriptor) LowestPerformance, // Integer or Buffer (Resource Descriptor) GuaranteedPerformanceRegister, // Buffer (Resource Descriptor) DesiredPerformanceRegister , // Buffer (Resource Descriptor) MinimumPerformanceRegister , // Buffer (Resource Descriptor) MaximumPerformanceRegister , // Buffer (Resource Descriptor) PerformanceReductionToleranceRegister, // Buffer (Resource Descriptor) TimeWindowRegister, // Buffer (Resource Descriptor) CounterWraparoundTime, // Integer or Buffer (Resource Descriptor) ReferencePerformanceCounterRegister, // Buffer (Resource Descriptor) DeliveredPerformanceCounterRegister, // Buffer (Resource Descriptor) PerformanceLimitedRegister, // Buffer (Resource Descriptor) CPPCEnableRegister // Buffer (Resource Descriptor) AutonomousSelectionEnable, // Integer or Buffer (Resource Descriptor) AutonomousActivityWindowRegister, // Buffer (Resource Descriptor) EnergyPerformancePreferenceRegister, // Buffer (Resource Descriptor) ReferencePerformance // Integer or Buffer (Resource Descriptor) LowestFrequency, // Integer or Buffer (Resource Descriptor) NominalFrequency // Integer or Buffer (Resource Descriptor) }) }

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]CpcTokenCPC token of the INTC info describing the Cpu.
[in]NodeCPU Node to which the _CPC node is attached.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 372 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlCpu()

EFI_STATUS EFIAPI CreateAmlCpu ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN AML_NODE_HANDLE  ParentNode,
IN UINT32  AcpiProcessorUid,
IN UINT32  CpuName,
OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr  OPTIONAL 
)

Create a Cpu in the AML namespace.

This generates the following ASL code: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") }

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]ParentNodeParent node to attach the Cpu node to.
[in]AcpiProcessorUidACPI processor UID of the CPU.
[in]CpuNameValue used to generate the node name.
[out]CpuNodePtrIf not NULL, return the created Cpu node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 639 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlCpuFromProcHierarchy()

STATIC EFI_STATUS EFIAPI CreateAmlCpuFromProcHierarchy ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN AML_NODE_HANDLE  ParentNode,
IN UINT32  CpuName,
IN CM_ARCH_COMMON_PROC_HIERARCHY_INFO ProcHierarchyNodeInfo 
)

Create a Cpu in the AML namespace from a CM_ARCH_COMMON_PROC_HIERARCHY_INFO CM object.

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]ParentNodeParent node to attach the Cpu node to.
[in]CpuNameValue used to generate the node name.
[in]ProcHierarchyNodeInfoCM_ARCH_COMMON_PROC_HIERARCHY_INFO describing the Cpu.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 714 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlCpuTopologyTree()

STATIC EFI_STATUS EFIAPI CreateAmlCpuTopologyTree ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN CM_OBJECT_TOKEN  NodeToken,
IN AML_NODE_HANDLE  ParentNode,
IN OUT UINT32 *  ProcContainerIndex,
IN BOOLEAN  PackageNodeSeen 
)

Create an AML representation of the Cpu topology.

A processor container is by extension any non-leave device in the cpu topology.

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]NodeTokenToken of the CM_ARCH_COMMON_PROC_HIERARCHY_INFO currently handled.
[in]ParentNodeParent node to attach the created node to.
[in,out]ProcContainerIndexPointer to the current processor container index to be used as UID.
[in]PackageNodeSeenA parent of the ProcNode has the physical package flag set.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 979 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlLpiMethod()

STATIC EFI_STATUS EFIAPI CreateAmlLpiMethod ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CM_ARCH_COMMON_PROC_HIERARCHY_INFO ProcHierarchyNodeInfo,
IN AML_OBJECT_NODE_HANDLE Node 
)

Create and add an _LPI method to Cpu/Cluster Node.

For instance, transform an AML node from: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") }

To: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") Method (_LPI, 0, NotSerialized) { Return (_SB.L003) } }

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]ProcHierarchyNodeInfoCM_ARCH_COMMON_PROC_HIERARCHY_INFO describing the Cpu.
[in]NodeNode to which the _LPI method is attached. Can represent a Cpu or a Cluster.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 436 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlProcessorContainer()

STATIC EFI_STATUS EFIAPI CreateAmlProcessorContainer ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN AML_NODE_HANDLE  ParentNode,
IN CM_ARCH_COMMON_PROC_HIERARCHY_INFO ProcHierarchyNodeInfo,
IN UINT16  ProcContainerName,
IN UINT32  ProcContainerUid,
OUT AML_OBJECT_NODE_HANDLE ProcContainerNodePtr 
)

Create a Processor Container in the AML namespace.

Any CM_ARCH_COMMON_PROC_HIERARCHY_INFO object with the following flags is assumed to be a processor container:

  • EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL
  • EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID
  • EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF

This generates the following ASL code: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0010") }

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]ParentNodeParent node to attach the processor container node to.
[in]ProcHierarchyNodeInfoCM_ARCH_COMMON_PROC_HIERARCHY_INFO object used to create the node.
[in]ProcContainerNameName of the processor container.
[in]ProcContainerUidUid of the processor container.
[out]ProcContainerNodePtrIf success, contains the created processor container node.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 830 of file SsdtCpuTopologyGenerator.c.

◆ CreateAmlPsdNode()

STATIC EFI_STATUS EFIAPI CreateAmlPsdNode ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN CM_OBJECT_TOKEN  PsdToken,
IN AML_OBJECT_NODE_HANDLE Node 
)

Create and add an _PSD Node to Cpu Node.

For instance, transform an AML node from: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") }

To: Device (C002) { Name (_UID, 2) Name (_HID, "ACPI0007") Name (_PSD, Package() { NumEntries, // Integer Revision, // Integer Domain, // Integer CoordType, // Integer NumProcessors, // Integer }) }

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]PsdTokenToken to identify the Psd information.
[in]NodeCPU Node to which the _CPC node is attached.
Return values
EFI_SUCCESSThe function completed successfully.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 286 of file SsdtCpuTopologyGenerator.c.

◆ CreateTopologyFromProcHierarchy()

STATIC EFI_STATUS EFIAPI CreateTopologyFromProcHierarchy ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN AML_OBJECT_NODE_HANDLE  ScopeNode 
)

Create the processor hierarchy AML tree from CM_ARCH_COMMON_PROC_HIERARCHY_INFO CM objects.

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]ScopeNodeScope node handle ('_SB' scope).
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 1134 of file SsdtCpuTopologyGenerator.c.

◆ FreeSsdtCpuTopologyTableResources()

STATIC EFI_STATUS EFIAPI FreeSsdtCpuTopologyTableResources ( IN CONST ACPI_TABLE_GENERATOR *CONST  This,
IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST  AcpiTableInfo,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN OUT EFI_ACPI_DESCRIPTION_HEADER **CONST  Table 
)

Free any resources allocated for constructing the SSDT Cpu Topology ACPI table.

Parameters
[in]ThisPointer to the table generator.
[in]AcpiTableInfoPointer to the ACPI Table Info.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in,out]TablePointer to the ACPI Table.
Return values
EFI_SUCCESSThe resources were freed successfully.
EFI_INVALID_PARAMETERThe table pointer is NULL or invalid.

Definition at line 1317 of file SsdtCpuTopologyGenerator.c.

◆ GenerateLpiStates()

STATIC EFI_STATUS EFIAPI GenerateLpiStates ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST  CfgMgrProtocol,
IN AML_OBJECT_NODE_HANDLE  ScopeNode 
)

Generate all the Lpi states under the '_SB' scope.

This function generates the following ASL code: Scope (_SB) { Name (L000, Package() { 0, // Version 0, // Level Index X, // Count Package() { [An Lpi state] }, Package() { [Another Lpi state] }, } // Name L000

Name (L001, Package() { ... } // Name L001

... } // Scope /_SB

The Lpi states are fetched from the Configuration Manager. The names of the Lpi states are generated from the TokenTable.

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CfgMgrProtocolPointer to the Configuration Manager Protocol Interface.
[in]ScopeNodeScope node handle ('_SB' scope).
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 523 of file SsdtCpuTopologyGenerator.c.

◆ GET_OBJECT_LIST() [1/5]

This macro expands to a function that retrieves the cross-CM-object- reference information from the Configuration Manager.

◆ GET_OBJECT_LIST() [2/5]

This macro expands to a function that retrieves the CPC information from the Configuration Manager.

◆ GET_OBJECT_LIST() [3/5]

This macro expands to a function that retrieves the Lpi information from the Configuration Manager.

◆ GET_OBJECT_LIST() [4/5]

SSDT Cpu Topology Table Generator.

Requirements: The following Configuration Manager Object(s) are required by this Generator:

  • EArchCommonObjProcHierarchyInfo (OPTIONAL) along with
  • EArchCommonObjCmRef (OPTIONAL)
  • EArchCommonObjLpiInfo (OPTIONAL)
  • EArchCommonObjPsdInfo (OPTIONAL) This macro expands to a function that retrieves the Processor Hierarchy information from the Configuration Manager.

◆ GET_OBJECT_LIST() [5/5]

This macro expands to a function that retrieves the PSD information from the Configuration Manager.

◆ TokenTableAdd()

STATIC UINT32 EFIAPI TokenTableAdd ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN CM_OBJECT_TOKEN  Token 
)

Add a new entry to the TokenTable and return its index.

If an entry with Token is already available in the table, return its index without adding a new entry.

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]TokenNew Token entry to add.
Return values
Theindex of the token entry in the TokenTable.

Definition at line 173 of file SsdtCpuTopologyGenerator.c.

◆ TokenTableFree()

STATIC VOID EFIAPI TokenTableFree ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator)

Free the TokenTable.

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.

Definition at line 148 of file SsdtCpuTopologyGenerator.c.

◆ TokenTableInitialize()

STATIC EFI_STATUS EFIAPI TokenTableInitialize ( IN ACPI_CPU_TOPOLOGY_GENERATOR Generator,
IN UINT32  Count 
)

Initialize the TokenTable.

One entry should be allocated for each CM_ARCH_COMMON_PROC_HIERARCHY_INFO structure of the platform. The TokenTable allows to have a mapping: Index <-> CM_OBJECT_TOKEN (to CM_ARCH_COMMON_LPI_INFO structures).

There will always be less sets of Lpi states (CM_ARCH_COMMON_OBJ_REF) than the number of cpus/clusters (CM_ARCH_COMMON_PROC_HIERARCHY_INFO).

Parameters
[in]GeneratorThe SSDT Cpu Topology generator.
[in]CountNumber of entries to allocate in the TokenTable.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.
EFI_OUT_OF_RESOURCESFailed to allocate memory.

Definition at line 115 of file SsdtCpuTopologyGenerator.c.

◆ WriteAslName()

EFI_STATUS EFIAPI WriteAslName ( IN CHAR8  LeadChar,
IN UINT32  Value,
IN OUT CHAR8 *  AslName 
)

Write a string 'Xxxx\0' in AslName (5 bytes long), with 'X' being the leading char of the name, and with 'xxx' being Value in hexadecimal.

As 'xxx' in hexadecimal represents a number on 12 bits, we have Value < (1 << 12).

Parameters
[in]LeadCharLeading char of the name.
[in]ValueHex value of the name. Must be lower than (2 << 12).
[in,out]AslNamePointer to write the 'Xxxx' string to. Must be at least 5 bytes long.
Return values
EFI_SUCCESSSuccess.
EFI_INVALID_PARAMETERInvalid parameter.

Definition at line 222 of file SsdtCpuTopologyGenerator.c.

Variable Documentation

◆ SsdtCpuTopologyGenerator

STATIC ACPI_CPU_TOPOLOGY_GENERATOR SsdtCpuTopologyGenerator

The interface for the SSDT Cpu Topology Table Generator.

Definition at line 1348 of file SsdtCpuTopologyGenerator.c.