diff options
Diffstat (limited to 'DynamicTablesPkg/Library/Acpi/Arm')
17 files changed, 1382 insertions, 1289 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c index a7508d4a88..3d513dbd1f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiDbg2LibArm/Dbg2Generator.c @@ -40,48 +40,48 @@ Requirements: /** The number of debug ports represented by the Table.
*/
-#define DBG2_NUM_DEBUG_PORTS 1
+#define DBG2_NUM_DEBUG_PORTS 1
/** The number of Generic Address Registers
presented in the debug device information.
*/
-#define DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1
+#define DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS 1
/** The index for the debug port 0 in the Debug port information list.
*/
-#define INDEX_DBG_PORT0 0
+#define INDEX_DBG_PORT0 0
/** A string representing the name of the debug port 0.
*/
-#define NAME_STR_DBG_PORT0 "COM0"
+#define NAME_STR_DBG_PORT0 "COM0"
/** An UID representing the debug port 0.
*/
-#define UID_DBG_PORT0 0
+#define UID_DBG_PORT0 0
/** The length of the namespace string.
*/
-#define DBG2_NAMESPACESTRING_FIELD_SIZE sizeof (NAME_STR_DBG_PORT0)
+#define DBG2_NAMESPACESTRING_FIELD_SIZE sizeof (NAME_STR_DBG_PORT0)
/** The PL011 UART address range length.
*/
-#define PL011_UART_LENGTH 0x1000
+#define PL011_UART_LENGTH 0x1000
/** A structure that provides the OS with the required information
for initializing a debugger connection.
*/
typedef struct {
/// The debug device information for the platform
- EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;
+ EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT Dbg2Device;
/// The base address register for the serial port
- EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister;
+ EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister;
/// The address size
- UINT32 AddressSize;
+ UINT32 AddressSize;
/// The debug port name string
- UINT8 NameSpaceString[DBG2_NAMESPACESTRING_FIELD_SIZE];
+ UINT8 NameSpaceString[DBG2_NAMESPACESTRING_FIELD_SIZE];
} DBG2_DEBUG_DEVICE_INFORMATION;
/** A structure representing the information about the debug port(s)
@@ -89,10 +89,10 @@ typedef struct { */
typedef struct {
/// The DBG2 table header
- EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description;
+ EFI_ACPI_DEBUG_PORT_2_DESCRIPTION_TABLE Description;
/// Debug port information list
- DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[DBG2_NUM_DEBUG_PORTS];
+ DBG2_DEBUG_DEVICE_INFORMATION Dbg2DeviceInfo[DBG2_NUM_DEBUG_PORTS];
} DBG2_TABLE;
/** A helper macro used for initializing the debug port device
@@ -104,42 +104,42 @@ typedef struct { @param [in] UartNameStr The UART port name string.
**/
#define DBG2_DEBUG_PORT_DDI( \
- SubType, \
- UartBase, \
- UartAddrLen, \
- UartNameStr \
- ) { \
+ SubType, \
+ UartBase, \
+ UartAddrLen, \
+ UartNameStr \
+ ) {\
{ \
- /* UINT8 Revision */ \
+ /* UINT8 Revision */ \
EFI_ACPI_DBG2_DEBUG_DEVICE_INFORMATION_STRUCT_REVISION, \
- /* UINT16 Length */ \
+ /* UINT16 Length */ \
sizeof (DBG2_DEBUG_DEVICE_INFORMATION), \
- /* UINT8 NumberofGenericAddressRegisters */ \
+ /* UINT8 NumberofGenericAddressRegisters */ \
DBG2_NUMBER_OF_GENERIC_ADDRESS_REGISTERS, \
- /* UINT16 NameSpaceStringLength */ \
+ /* UINT16 NameSpaceStringLength */ \
DBG2_NAMESPACESTRING_FIELD_SIZE, \
- /* UINT16 NameSpaceStringOffset */ \
+ /* UINT16 NameSpaceStringOffset */ \
OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, NameSpaceString), \
- /* UINT16 OemDataLength */ \
+ /* UINT16 OemDataLength */ \
0, \
- /* UINT16 OemDataOffset */ \
+ /* UINT16 OemDataOffset */ \
0, \
- /* UINT16 Port Type */ \
+ /* UINT16 Port Type */ \
EFI_ACPI_DBG2_PORT_TYPE_SERIAL, \
- /* UINT16 Port Subtype */ \
+ /* UINT16 Port Subtype */ \
SubType, \
- /* UINT8 Reserved[2] */ \
+ /* UINT8 Reserved[2] */ \
{EFI_ACPI_RESERVED_BYTE, EFI_ACPI_RESERVED_BYTE}, \
- /* UINT16 BaseAddressRegister Offset */ \
+ /* UINT16 BaseAddressRegister Offset */ \
OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, BaseAddressRegister), \
- /* UINT16 AddressSize Offset */ \
+ /* UINT16 AddressSize Offset */ \
OFFSET_OF (DBG2_DEBUG_DEVICE_INFORMATION, AddressSize) \
}, \
- /* EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister */ \
+ /* EFI_ACPI_6_2_GENERIC_ADDRESS_STRUCTURE BaseAddressRegister */ \
ARM_GAS32 (UartBase), \
- /* UINT32 AddressSize */ \
+ /* UINT32 AddressSize */ \
UartAddrLen, \
- /* UINT8 NameSpaceString[MAX_DBG2_NAME_LEN] */ \
+ /* UINT8 NameSpaceString[MAX_DBG2_NAME_LEN] */ \
UartNameStr \
}
@@ -148,7 +148,7 @@ typedef struct { Note: fields marked with "{Template}" will be set dynamically
*/
STATIC
-DBG2_TABLE AcpiDbg2 = {
+DBG2_TABLE AcpiDbg2 = {
{
ACPI_HEADER (
EFI_ACPI_6_2_DEBUG_PORT_2_TABLE_SIGNATURE,
@@ -194,7 +194,7 @@ GET_OBJECT_LIST ( STATIC
EFI_STATUS
SetupDebugUart (
- IN CONST CM_ARM_SERIAL_PORT_INFO * CONST SerialPortInfo
+ IN CONST CM_ARM_SERIAL_PORT_INFO *CONST SerialPortInfo
)
{
EFI_STATUS Status;
@@ -209,20 +209,20 @@ SetupDebugUart ( // Initialize the Serial Debug UART
DEBUG ((DEBUG_INFO, "Initializing Serial Debug UART...\n"));
ReceiveFifoDepth = 0; // Use the default value for FIFO depth
- Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);
- DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);
- StopBits = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);
+ Parity = (EFI_PARITY_TYPE)FixedPcdGet8 (PcdUartDefaultParity);
+ DataBits = FixedPcdGet8 (PcdUartDefaultDataBits);
+ StopBits = (EFI_STOP_BITS_TYPE)FixedPcdGet8 (PcdUartDefaultStopBits);
BaudRate = SerialPortInfo->BaudRate;
- Status = PL011UartInitializePort (
- (UINTN)SerialPortInfo->BaseAddress,
- SerialPortInfo->Clock,
- &BaudRate,
- &ReceiveFifoDepth,
- &Parity,
- &DataBits,
- &StopBits
- );
+ Status = PL011UartInitializePort (
+ (UINTN)SerialPortInfo->BaseAddress,
+ SerialPortInfo->Clock,
+ &BaudRate,
+ &ReceiveFifoDepth,
+ &Parity,
+ &DataBits,
+ &StopBits
+ );
ASSERT_EFI_ERROR (Status);
return Status;
@@ -245,15 +245,15 @@ STATIC EFI_STATUS
EFIAPI
FreeDbg2TableEx (
- 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,
+ 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,
IN CONST UINTN TableCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
+ EFI_STATUS Status;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -263,7 +263,8 @@ FreeDbg2TableEx ( if ((Table == NULL) ||
(*Table == NULL) ||
- (TableCount != 2)) {
+ (TableCount != 2))
+ {
DEBUG ((DEBUG_ERROR, "ERROR: DBG2: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER;
}
@@ -272,7 +273,8 @@ FreeDbg2TableEx ( if ((TableList[1] == NULL) ||
(TableList[1]->Signature !=
- EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) {
+ EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
+ {
DEBUG ((DEBUG_ERROR, "ERROR: DBG2: Invalid SSDT table pointer.\n"));
return EFI_INVALID_PARAMETER;
}
@@ -316,17 +318,17 @@ STATIC EFI_STATUS
EFIAPI
BuildDbg2TableEx (
- IN CONST ACPI_TABLE_GENERATOR * This,
- IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- OUT EFI_ACPI_DESCRIPTION_HEADER *** Table,
- OUT UINTN * CONST TableCount
+ IN CONST ACPI_TABLE_GENERATOR *This,
+ IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ OUT EFI_ACPI_DESCRIPTION_HEADER ***Table,
+ OUT UINTN *CONST TableCount
)
{
- EFI_STATUS Status;
- CM_ARM_SERIAL_PORT_INFO * SerialPortInfo;
- UINT32 SerialPortCount;
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
+ EFI_STATUS Status;
+ CM_ARM_SERIAL_PORT_INFO *SerialPortInfo;
+ UINT32 SerialPortCount;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -337,7 +339,8 @@ BuildDbg2TableEx ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: DBG2: Requested table revision = %d, is not supported."
@@ -387,8 +390,8 @@ BuildDbg2TableEx ( }
// Allocate a table to store pointers to the DBG2 and SSDT tables.
- TableList = (EFI_ACPI_DESCRIPTION_HEADER**)
- AllocateZeroPool (sizeof (EFI_ACPI_DESCRIPTION_HEADER*) * 2);
+ TableList = (EFI_ACPI_DESCRIPTION_HEADER **)
+ AllocateZeroPool (sizeof (EFI_ACPI_DESCRIPTION_HEADER *) * 2);
if (TableList == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -403,7 +406,7 @@ BuildDbg2TableEx ( Status = AddAcpiHeader (
CfgMgrProtocol,
This,
- (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2,
+ (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiDbg2,
AcpiTableInfo,
sizeof (DBG2_TABLE)
);
@@ -447,11 +450,12 @@ BuildDbg2TableEx ( SerialPortInfo->PortSubtype;
if ((SerialPortInfo->PortSubtype ==
- EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART) ||
+ EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_PL011_UART) ||
(SerialPortInfo->PortSubtype ==
- EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) ||
+ EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART_2X) ||
(SerialPortInfo->PortSubtype ==
- EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART)) {
+ EFI_ACPI_DBG2_PORT_SUBTYPE_SERIAL_ARM_SBSA_GENERIC_UART))
+ {
// Initialize the serial port
Status = SetupDebugUart (SerialPortInfo);
if (EFI_ERROR (Status)) {
@@ -464,7 +468,7 @@ BuildDbg2TableEx ( }
}
- TableList[0] = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiDbg2;
+ TableList[0] = (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiDbg2;
// Build a SSDT table describing the serial port.
Status = BuildSsdtSerialPortTable (
@@ -484,7 +488,7 @@ BuildDbg2TableEx ( }
*TableCount = 2;
- *Table = TableList;
+ *Table = TableList;
return Status;
@@ -498,13 +502,13 @@ error_handler: /** This macro defines the DBG2 Table Generator revision.
*/
-#define DBG2_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define DBG2_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the DBG2 Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR Dbg2Generator = {
+ACPI_TABLE_GENERATOR Dbg2Generator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdDbg2),
// Generator Description
@@ -542,11 +546,12 @@ ACPI_TABLE_GENERATOR Dbg2Generator = { EFI_STATUS
EFIAPI
AcpiDbg2LibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&Dbg2Generator);
DEBUG ((DEBUG_INFO, "DBG2: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -565,11 +570,12 @@ AcpiDbg2LibConstructor ( EFI_STATUS
EFIAPI
AcpiDbg2LibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&Dbg2Generator);
DEBUG ((DEBUG_INFO, "DBG2: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c index b4ebd463da..96295f539f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiFadtLibArm/FadtGenerator.c @@ -78,7 +78,7 @@ Requirements: Note: fields marked with "{Template}" will be updated dynamically.
*/
STATIC
-EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
+EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE AcpiFadt = {
ACPI_HEADER (
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE_SIGNATURE,
EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE,
@@ -250,11 +250,11 @@ STATIC EFI_STATUS
EFIAPI
FadtAddPmProfileInfo (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol
-)
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol
+ )
{
- EFI_STATUS Status;
- CM_ARM_POWER_MANAGEMENT_PROFILE_INFO * PmProfile;
+ EFI_STATUS Status;
+ CM_ARM_POWER_MANAGEMENT_PROFILE_INFO *PmProfile;
ASSERT (CfgMgrProtocol != NULL);
@@ -303,11 +303,11 @@ STATIC EFI_STATUS
EFIAPI
FadtAddBootArchInfo (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol
-)
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol
+ )
{
- EFI_STATUS Status;
- CM_ARM_BOOT_ARCH_INFO * BootArchInfo;
+ EFI_STATUS Status;
+ CM_ARM_BOOT_ARCH_INFO *BootArchInfo;
ASSERT (CfgMgrProtocol != NULL);
@@ -355,11 +355,11 @@ STATIC EFI_STATUS
EFIAPI
FadtAddHypervisorVendorId (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol
-)
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol
+ )
{
- EFI_STATUS Status;
- CM_ARM_HYPERVISOR_VENDOR_ID * HypervisorVendorInfo;
+ EFI_STATUS Status;
+ CM_ARM_HYPERVISOR_VENDOR_ID *HypervisorVendorInfo;
ASSERT (CfgMgrProtocol != NULL);
@@ -385,6 +385,7 @@ FadtAddHypervisorVendorId ( Status
));
}
+
goto error_handler;
}
@@ -416,11 +417,11 @@ STATIC EFI_STATUS
EFIAPI
FadtAddFixedFeatureFlags (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol
-)
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol
+ )
{
- EFI_STATUS Status;
- CM_ARM_FIXED_FEATURE_FLAGS * FixedFeatureFlags;
+ EFI_STATUS Status;
+ CM_ARM_FIXED_FEATURE_FLAGS *FixedFeatureFlags;
ASSERT (CfgMgrProtocol != NULL);
@@ -446,6 +447,7 @@ FadtAddFixedFeatureFlags ( Status
));
}
+
goto error_handler;
}
@@ -497,10 +499,10 @@ STATIC EFI_STATUS
EFIAPI
BuildFadtTable (
- 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
+ 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
)
{
EFI_STATUS Status;
@@ -513,7 +515,8 @@ BuildFadtTable ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: FADT: Requested table revision = %d, is not supported."
@@ -530,7 +533,7 @@ BuildFadtTable ( Status = AddAcpiHeader (
CfgMgrProtocol,
This,
- (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt,
+ (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiFadt,
AcpiTableInfo,
sizeof (EFI_ACPI_6_4_FIXED_ACPI_DESCRIPTION_TABLE)
);
@@ -595,20 +598,20 @@ BuildFadtTable ( }
}
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiFadt;
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiFadt;
error_handler:
return Status;
}
/** This macro defines the FADT Table Generator revision.
*/
-#define FADT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define FADT_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the FADT Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR FadtGenerator = {
+ACPI_TABLE_GENERATOR FadtGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdFadt),
// Generator Description
@@ -648,11 +651,12 @@ ACPI_TABLE_GENERATOR FadtGenerator = { EFI_STATUS
EFIAPI
AcpiFadtLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&FadtGenerator);
DEBUG ((DEBUG_INFO, "FADT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -671,11 +675,12 @@ AcpiFadtLibConstructor ( EFI_STATUS
EFIAPI
AcpiFadtLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&FadtGenerator);
DEBUG ((DEBUG_INFO, "FADT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c index 06a23876ae..2b5fb30871 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiGtdtLibArm/GtdtGenerator.c @@ -90,14 +90,14 @@ STATIC EFI_STATUS
EFIAPI
AddGenericTimerInfo (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST Gtdt,
IN CONST UINT32 PlatformTimerCount,
IN CONST UINT32 AcpiTableRevision
-)
+ )
{
- EFI_STATUS Status;
- CM_ARM_GENERIC_TIMER_INFO * GenericTimerInfo;
+ EFI_STATUS Status;
+ CM_ARM_GENERIC_TIMER_INFO *GenericTimerInfo;
ASSERT (CfgMgrProtocol != NULL);
ASSERT (Gtdt != NULL);
@@ -120,23 +120,23 @@ AddGenericTimerInfo ( Gtdt->CntControlBasePhysicalAddress =
GenericTimerInfo->CounterControlBaseAddress;
- Gtdt->Reserved = EFI_ACPI_RESERVED_DWORD;
- Gtdt->SecurePL1TimerGSIV = GenericTimerInfo->SecurePL1TimerGSIV;
- Gtdt->SecurePL1TimerFlags = GenericTimerInfo->SecurePL1TimerFlags;
- Gtdt->NonSecurePL1TimerGSIV = GenericTimerInfo->NonSecurePL1TimerGSIV;
- Gtdt->NonSecurePL1TimerFlags = GenericTimerInfo->NonSecurePL1TimerFlags;
- Gtdt->VirtualTimerGSIV = GenericTimerInfo->VirtualTimerGSIV;
- Gtdt->VirtualTimerFlags = GenericTimerInfo->VirtualTimerFlags;
- Gtdt->NonSecurePL2TimerGSIV = GenericTimerInfo->NonSecurePL2TimerGSIV;
- Gtdt->NonSecurePL2TimerFlags = GenericTimerInfo->NonSecurePL2TimerFlags;
+ Gtdt->Reserved = EFI_ACPI_RESERVED_DWORD;
+ Gtdt->SecurePL1TimerGSIV = GenericTimerInfo->SecurePL1TimerGSIV;
+ Gtdt->SecurePL1TimerFlags = GenericTimerInfo->SecurePL1TimerFlags;
+ Gtdt->NonSecurePL1TimerGSIV = GenericTimerInfo->NonSecurePL1TimerGSIV;
+ Gtdt->NonSecurePL1TimerFlags = GenericTimerInfo->NonSecurePL1TimerFlags;
+ Gtdt->VirtualTimerGSIV = GenericTimerInfo->VirtualTimerGSIV;
+ Gtdt->VirtualTimerFlags = GenericTimerInfo->VirtualTimerFlags;
+ Gtdt->NonSecurePL2TimerGSIV = GenericTimerInfo->NonSecurePL2TimerGSIV;
+ Gtdt->NonSecurePL2TimerFlags = GenericTimerInfo->NonSecurePL2TimerFlags;
Gtdt->CntReadBasePhysicalAddress =
GenericTimerInfo->CounterReadBaseAddress;
- Gtdt->PlatformTimerCount = PlatformTimerCount;
+ Gtdt->PlatformTimerCount = PlatformTimerCount;
Gtdt->PlatformTimerOffset = (PlatformTimerCount == 0) ? 0 :
- sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
+ sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
if (AcpiTableRevision > EFI_ACPI_6_2_GENERIC_TIMER_DESCRIPTION_TABLE_REVISION) {
- Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
+ Gtdt->VirtualPL2TimerGSIV = GenericTimerInfo->VirtualPL2TimerGSIV;
Gtdt->VirtualPL2TimerFlags = GenericTimerInfo->VirtualPL2TimerFlags;
}
@@ -154,32 +154,32 @@ AddGenericTimerInfo ( STATIC
VOID
AddGenericWatchdogList (
- IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
+ IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST Gtdt,
IN CONST UINT32 WatchdogOffset,
- IN CONST CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList,
+ IN CONST CM_ARM_GENERIC_WATCHDOG_INFO *WatchdogInfoList,
IN UINT32 WatchdogCount
)
{
- EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE * Watchdog;
+ EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE *Watchdog;
ASSERT (Gtdt != NULL);
ASSERT (WatchdogInfoList != NULL);
Watchdog = (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE *)
- ((UINT8*)Gtdt + WatchdogOffset);
+ ((UINT8 *)Gtdt + WatchdogOffset);
while (WatchdogCount-- != 0) {
// Add watchdog entry
DEBUG ((DEBUG_INFO, "GTDT: Watchdog = 0x%p\n", Watchdog));
- Watchdog->Type = EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG;
+ Watchdog->Type = EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG;
Watchdog->Length =
sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE);
- Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
+ Watchdog->Reserved = EFI_ACPI_RESERVED_BYTE;
Watchdog->RefreshFramePhysicalAddress =
WatchdogInfoList->RefreshFrameAddress;
Watchdog->WatchdogControlFramePhysicalAddress =
WatchdogInfoList->ControlFrameAddress;
- Watchdog->WatchdogTimerGSIV = WatchdogInfoList->TimerGSIV;
+ Watchdog->WatchdogTimerGSIV = WatchdogInfoList->TimerGSIV;
Watchdog->WatchdogTimerFlags = WatchdogInfoList->Flags;
Watchdog++;
WatchdogInfoList++;
@@ -206,19 +206,19 @@ AddGenericWatchdogList ( BOOLEAN
EFIAPI
IsGtFrameNumberEqual (
- IN CONST VOID * Frame1,
- IN CONST VOID * Frame2,
- IN UINTN Index1,
- IN UINTN Index2
+ IN CONST VOID *Frame1,
+ IN CONST VOID *Frame2,
+ IN UINTN Index1,
+ IN UINTN Index2
)
{
- UINT8 FrameNumber1;
- UINT8 FrameNumber2;
+ UINT8 FrameNumber1;
+ UINT8 FrameNumber2;
ASSERT ((Frame1 != NULL) && (Frame2 != NULL));
- FrameNumber1 = ((CM_ARM_GTBLOCK_TIMER_FRAME_INFO*)Frame1)->FrameNumber;
- FrameNumber2 = ((CM_ARM_GTBLOCK_TIMER_FRAME_INFO*)Frame2)->FrameNumber;
+ FrameNumber1 = ((CM_ARM_GTBLOCK_TIMER_FRAME_INFO *)Frame1)->FrameNumber;
+ FrameNumber2 = ((CM_ARM_GTBLOCK_TIMER_FRAME_INFO *)Frame2)->FrameNumber;
if (FrameNumber1 == FrameNumber2) {
DEBUG ((
@@ -249,12 +249,12 @@ IsGtFrameNumberEqual ( STATIC
EFI_STATUS
AddGTBlockTimerFrames (
- IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame,
- IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList,
- IN UINT32 GTBlockFrameCount
-)
+ IN EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE *GtBlockFrame,
+ IN CONST CM_ARM_GTBLOCK_TIMER_FRAME_INFO *GTBlockTimerFrameList,
+ IN UINT32 GTBlockFrameCount
+ )
{
- BOOLEAN IsFrameNumberDuplicated;
+ BOOLEAN IsFrameNumberDuplicated;
ASSERT (GtBlockFrame != NULL);
ASSERT (GTBlockTimerFrameList != NULL);
@@ -282,16 +282,16 @@ AddGTBlockTimerFrames ( DEBUG_ERROR,
"ERROR: GTDT: Frame number %d is not in the range 0-7\n",
GTBlockTimerFrameList->FrameNumber
- ));
+ ));
return EFI_INVALID_PARAMETER;
}
GtBlockFrame->GTFrameNumber = GTBlockTimerFrameList->FrameNumber;
- GtBlockFrame->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
- GtBlockFrame->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
- GtBlockFrame->Reserved[2] = EFI_ACPI_RESERVED_BYTE;
+ GtBlockFrame->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
+ GtBlockFrame->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
+ GtBlockFrame->Reserved[2] = EFI_ACPI_RESERVED_BYTE;
- GtBlockFrame->CntBaseX = GTBlockTimerFrameList->PhysicalAddressCntBase;
+ GtBlockFrame->CntBaseX = GTBlockTimerFrameList->PhysicalAddressCntBase;
GtBlockFrame->CntEL0BaseX =
GTBlockTimerFrameList->PhysicalAddressCntEL0Base;
@@ -300,7 +300,7 @@ AddGTBlockTimerFrames ( GtBlockFrame->GTxPhysicalTimerFlags =
GTBlockTimerFrameList->PhysicalTimerFlags;
- GtBlockFrame->GTxVirtualTimerGSIV = GTBlockTimerFrameList->VirtualTimerGSIV;
+ GtBlockFrame->GTxVirtualTimerGSIV = GTBlockTimerFrameList->VirtualTimerGSIV;
GtBlockFrame->GTxVirtualTimerFlags =
GTBlockTimerFrameList->VirtualTimerFlags;
@@ -308,6 +308,7 @@ AddGTBlockTimerFrames ( GtBlockFrame++;
GTBlockTimerFrameList++;
} // for
+
return EFI_SUCCESS;
}
@@ -328,25 +329,25 @@ AddGTBlockTimerFrames ( STATIC
EFI_STATUS
AddGTBlockList (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * CONST Gtdt,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *CONST Gtdt,
IN CONST UINT32 GTBlockOffset,
- IN CONST CM_ARM_GTBLOCK_INFO * GTBlockInfo,
+ IN CONST CM_ARM_GTBLOCK_INFO *GTBlockInfo,
IN UINT32 BlockTimerCount
-)
+ )
{
- EFI_STATUS Status;
- EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE * GTBlock;
- EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE * GtBlockFrame;
- CM_ARM_GTBLOCK_TIMER_FRAME_INFO * GTBlockTimerFrameList;
- UINT32 GTBlockTimerFrameCount;
- UINTN Length;
+ EFI_STATUS Status;
+ EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *GTBlock;
+ EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE *GtBlockFrame;
+ CM_ARM_GTBLOCK_TIMER_FRAME_INFO *GTBlockTimerFrameList;
+ UINT32 GTBlockTimerFrameCount;
+ UINTN Length;
ASSERT (Gtdt != NULL);
ASSERT (GTBlockInfo != NULL);
- GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)Gtdt +
- GTBlockOffset);
+ GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8 *)Gtdt +
+ GTBlockOffset);
while (BlockTimerCount-- != 0) {
DEBUG ((DEBUG_INFO, "GTDT: GTBlock = 0x%p\n", GTBlock));
@@ -358,7 +359,8 @@ AddGTBlockList ( >BlockTimerFrameCount
);
if (EFI_ERROR (Status) ||
- (GTBlockTimerFrameCount != GTBlockInfo->GTBlockTimerFrameCount)) {
+ (GTBlockTimerFrameCount != GTBlockInfo->GTBlockTimerFrameCount))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: GTDT: Failed to get Generic Timer Frames. Status = %r\n",
@@ -368,8 +370,8 @@ AddGTBlockList ( }
Length = sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) +
- (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
- GTBlockInfo->GTBlockTimerFrameCount);
+ (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
+ GTBlockInfo->GTBlockTimerFrameCount);
// Check that the length of the GT block does not
// exceed MAX_UINT16
@@ -386,16 +388,16 @@ AddGTBlockList ( return Status;
}
- GTBlock->Type = EFI_ACPI_6_4_GTDT_GT_BLOCK;
- GTBlock->Length = (UINT16)Length;
- GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
- GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
- GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
+ GTBlock->Type = EFI_ACPI_6_4_GTDT_GT_BLOCK;
+ GTBlock->Length = (UINT16)Length;
+ GTBlock->Reserved = EFI_ACPI_RESERVED_BYTE;
+ GTBlock->CntCtlBase = GTBlockInfo->GTBlockPhysicalAddress;
+ GTBlock->GTBlockTimerCount = GTBlockInfo->GTBlockTimerFrameCount;
GTBlock->GTBlockTimerOffset =
sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE);
- GtBlockFrame = (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE*)
- ((UINT8*)GTBlock + GTBlock->GTBlockTimerOffset);
+ GtBlockFrame = (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE *)
+ ((UINT8 *)GTBlock + GTBlock->GTBlockTimerOffset);
// Add GT Block Timer frames
Status = AddGTBlockTimerFrames (
@@ -413,10 +415,11 @@ AddGTBlockList ( }
// Next GTBlock
- GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8*)GTBlock +
- GTBlock->Length);
+ GTBlock = (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE *)((UINT8 *)GTBlock +
+ GTBlock->Length);
GTBlockInfo++;
}// for
+
return EFI_SUCCESS;
}
@@ -447,23 +450,23 @@ STATIC EFI_STATUS
EFIAPI
BuildGtdtTable (
- 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
+ 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
)
{
- EFI_STATUS Status;
- UINT32 TableSize;
- UINT32 PlatformTimerCount;
- UINT32 WatchdogCount;
- UINT32 BlockTimerCount;
- CM_ARM_GENERIC_WATCHDOG_INFO * WatchdogInfoList;
- CM_ARM_GTBLOCK_INFO * GTBlockInfo;
- EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE * Gtdt;
- UINT32 Idx;
- UINT32 GTBlockOffset;
- UINT32 WatchdogOffset;
+ EFI_STATUS Status;
+ UINT32 TableSize;
+ UINT32 PlatformTimerCount;
+ UINT32 WatchdogCount;
+ UINT32 BlockTimerCount;
+ CM_ARM_GENERIC_WATCHDOG_INFO *WatchdogInfoList;
+ CM_ARM_GTBLOCK_INFO *GTBlockInfo;
+ EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *Gtdt;
+ UINT32 Idx;
+ UINT32 GTBlockOffset;
+ UINT32 WatchdogOffset;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -473,7 +476,8 @@ BuildGtdtTable ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: GTDT: Requested table revision = %d, is not supported."
@@ -527,12 +531,12 @@ BuildGtdtTable ( // Calculate the GTDT Table Size
PlatformTimerCount = 0;
- TableSize = sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
+ TableSize = sizeof (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE);
if (BlockTimerCount != 0) {
- GTBlockOffset = TableSize;
+ GTBlockOffset = TableSize;
PlatformTimerCount += BlockTimerCount;
- TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) *
- BlockTimerCount);
+ TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_STRUCTURE) *
+ BlockTimerCount);
for (Idx = 0; Idx < BlockTimerCount; Idx++) {
if (GTBlockInfo[Idx].GTBlockTimerFrameCount > 8) {
@@ -546,8 +550,9 @@ BuildGtdtTable ( ));
goto error_handler;
}
+
TableSize += (sizeof (EFI_ACPI_6_4_GTDT_GT_BLOCK_TIMER_STRUCTURE) *
- GTBlockInfo[Idx].GTBlockTimerFrameCount);
+ GTBlockInfo[Idx].GTBlockTimerFrameCount);
}
DEBUG ((
@@ -560,10 +565,10 @@ BuildGtdtTable ( WatchdogOffset = 0;
if (WatchdogCount != 0) {
- WatchdogOffset = TableSize;
+ WatchdogOffset = TableSize;
PlatformTimerCount += WatchdogCount;
- TableSize += (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE) *
- WatchdogCount);
+ TableSize += (sizeof (EFI_ACPI_6_4_GTDT_ARM_GENERIC_WATCHDOG_STRUCTURE) *
+ WatchdogCount);
DEBUG ((
DEBUG_INFO,
"GTDT: WatchdogOffset = 0x%x, PLATFORM_TIMER_COUNT = %d\n",
@@ -572,7 +577,7 @@ BuildGtdtTable ( ));
}
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
if (*Table == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -585,7 +590,7 @@ BuildGtdtTable ( goto error_handler;
}
- Gtdt = (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE*)*Table;
+ Gtdt = (EFI_ACPI_6_4_GENERIC_TIMER_DESCRIPTION_TABLE *)*Table;
DEBUG ((
DEBUG_INFO,
"GTDT: Gtdt = 0x%p TableSize = 0x%x\n",
@@ -658,6 +663,7 @@ error_handler: FreePool (*Table);
*Table = NULL;
}
+
return Status;
}
@@ -675,11 +681,11 @@ error_handler: STATIC
EFI_STATUS
FreeGtdtTableResources (
- 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
-)
+ 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
+ )
{
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -700,13 +706,13 @@ FreeGtdtTableResources ( /** This macro defines the GTDT Table Generator revision.
*/
-#define GTDT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define GTDT_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the GTDT Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR GtdtGenerator = {
+ACPI_TABLE_GENERATOR GtdtGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdGtdt),
// Generator Description
@@ -745,11 +751,12 @@ ACPI_TABLE_GENERATOR GtdtGenerator = { EFI_STATUS
EFIAPI
AcpiGtdtLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&GtdtGenerator);
DEBUG ((DEBUG_INFO, "GTDT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -768,11 +775,12 @@ AcpiGtdtLibConstructor ( EFI_STATUS
EFIAPI
AcpiGtdtLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&GtdtGenerator);
DEBUG ((DEBUG_INFO, "GTDT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 349caa8006..0f13c32b83 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -132,7 +132,7 @@ GET_OBJECT_LIST ( STATIC
UINT32
GetItsGroupNodeSize (
- IN CONST CM_ARM_ITS_GROUP_NODE * Node
+ IN CONST CM_ARM_ITS_GROUP_NODE *Node
)
{
ASSERT (Node != NULL);
@@ -141,7 +141,7 @@ GetItsGroupNodeSize ( Size of ITS Identifier array
*/
return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE) +
- (Node->ItsIdCount * sizeof (UINT32)));
+ (Node->ItsIdCount * sizeof (UINT32)));
}
/** Returns the total size required for the ITS Group nodes and
@@ -163,9 +163,9 @@ STATIC UINT64
GetSizeofItsGroupNodes (
IN CONST UINT32 NodeStartOffset,
- IN CONST CM_ARM_ITS_GROUP_NODE * NodeList,
+ IN CONST CM_ARM_ITS_GROUP_NODE *NodeList,
IN UINT32 NodeCount,
- IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer
+ IN OUT IORT_NODE_INDEXER **CONST NodeIndexer
)
{
UINT64 Size;
@@ -174,8 +174,8 @@ GetSizeofItsGroupNodes ( Size = 0;
while (NodeCount-- != 0) {
- (*NodeIndexer)->Token = NodeList->Token;
- (*NodeIndexer)->Object = (VOID*)NodeList;
+ (*NodeIndexer)->Token = NodeList->Token;
+ (*NodeIndexer)->Object = (VOID *)NodeList;
(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
DEBUG ((
DEBUG_INFO,
@@ -190,6 +190,7 @@ GetSizeofItsGroupNodes ( (*NodeIndexer)++;
NodeList++;
}
+
return Size;
}
@@ -202,7 +203,7 @@ GetSizeofItsGroupNodes ( STATIC
UINT32
GetNamedComponentNodeSize (
- IN CONST CM_ARM_NAMED_COMPONENT_NODE * Node
+ IN CONST CM_ARM_NAMED_COMPONENT_NODE *Node
)
{
ASSERT (Node != NULL);
@@ -212,9 +213,9 @@ GetNamedComponentNodeSize ( Size of ASCII string + 'padding to 32-bit word aligned'.
*/
return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) +
- (Node->IdMappingCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) +
- ALIGN_VALUE (AsciiStrSize (Node->ObjectName), 4));
+ (Node->IdMappingCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) +
+ ALIGN_VALUE (AsciiStrSize (Node->ObjectName), 4));
}
/** Returns the total size required for the Named Component nodes and
@@ -236,9 +237,9 @@ STATIC UINT64
GetSizeofNamedComponentNodes (
IN CONST UINT32 NodeStartOffset,
- IN CONST CM_ARM_NAMED_COMPONENT_NODE * NodeList,
+ IN CONST CM_ARM_NAMED_COMPONENT_NODE *NodeList,
IN UINT32 NodeCount,
- IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer
+ IN OUT IORT_NODE_INDEXER **CONST NodeIndexer
)
{
UINT64 Size;
@@ -247,8 +248,8 @@ GetSizeofNamedComponentNodes ( Size = 0;
while (NodeCount-- != 0) {
- (*NodeIndexer)->Token = NodeList->Token;
- (*NodeIndexer)->Object = (VOID*)NodeList;
+ (*NodeIndexer)->Token = NodeList->Token;
+ (*NodeIndexer)->Object = (VOID *)NodeList;
(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
DEBUG ((
DEBUG_INFO,
@@ -276,7 +277,7 @@ GetSizeofNamedComponentNodes ( STATIC
UINT32
GetRootComplexNodeSize (
- IN CONST CM_ARM_ROOT_COMPLEX_NODE * Node
+ IN CONST CM_ARM_ROOT_COMPLEX_NODE *Node
)
{
ASSERT (Node != NULL);
@@ -285,8 +286,8 @@ GetRootComplexNodeSize ( Size of ID mapping array
*/
return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE) +
- (Node->IdMappingCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)));
+ (Node->IdMappingCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)));
}
/** Returns the total size required for the Root Complex nodes and
@@ -308,9 +309,9 @@ STATIC UINT64
GetSizeofRootComplexNodes (
IN CONST UINT32 NodeStartOffset,
- IN CONST CM_ARM_ROOT_COMPLEX_NODE * NodeList,
+ IN CONST CM_ARM_ROOT_COMPLEX_NODE *NodeList,
IN UINT32 NodeCount,
- IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer
+ IN OUT IORT_NODE_INDEXER **CONST NodeIndexer
)
{
UINT64 Size;
@@ -319,8 +320,8 @@ GetSizeofRootComplexNodes ( Size = 0;
while (NodeCount-- != 0) {
- (*NodeIndexer)->Token = NodeList->Token;
- (*NodeIndexer)->Object = (VOID*)NodeList;
+ (*NodeIndexer)->Token = NodeList->Token;
+ (*NodeIndexer)->Object = (VOID *)NodeList;
(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
DEBUG ((
DEBUG_INFO,
@@ -348,7 +349,7 @@ GetSizeofRootComplexNodes ( STATIC
UINT32
GetSmmuV1V2NodeSize (
- IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * Node
+ IN CONST CM_ARM_SMMUV1_SMMUV2_NODE *Node
)
{
ASSERT (Node != NULL);
@@ -359,12 +360,12 @@ GetSmmuV1V2NodeSize ( Size of PMU interrupt array
*/
return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) +
- (Node->IdMappingCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) +
- (Node->ContextInterruptCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) +
- (Node->PmuInterruptCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)));
+ (Node->IdMappingCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)) +
+ (Node->ContextInterruptCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) +
+ (Node->PmuInterruptCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)));
}
/** Returns the total size required for the SMMUv1/SMMUv2 nodes and
@@ -386,9 +387,9 @@ STATIC UINT64
GetSizeofSmmuV1V2Nodes (
IN CONST UINT32 NodeStartOffset,
- IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * NodeList,
+ IN CONST CM_ARM_SMMUV1_SMMUV2_NODE *NodeList,
IN UINT32 NodeCount,
- IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer
+ IN OUT IORT_NODE_INDEXER **CONST NodeIndexer
)
{
UINT64 Size;
@@ -397,8 +398,8 @@ GetSizeofSmmuV1V2Nodes ( Size = 0;
while (NodeCount-- != 0) {
- (*NodeIndexer)->Token = NodeList->Token;
- (*NodeIndexer)->Object = (VOID*)NodeList;
+ (*NodeIndexer)->Token = NodeList->Token;
+ (*NodeIndexer)->Object = (VOID *)NodeList;
(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
DEBUG ((
DEBUG_INFO,
@@ -413,6 +414,7 @@ GetSizeofSmmuV1V2Nodes ( (*NodeIndexer)++;
NodeList++;
}
+
return Size;
}
@@ -425,7 +427,7 @@ GetSizeofSmmuV1V2Nodes ( STATIC
UINT32
GetSmmuV3NodeSize (
- IN CONST CM_ARM_SMMUV3_NODE * Node
+ IN CONST CM_ARM_SMMUV3_NODE *Node
)
{
ASSERT (Node != NULL);
@@ -434,8 +436,8 @@ GetSmmuV3NodeSize ( Size of ID mapping array
*/
return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE) +
- (Node->IdMappingCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)));
+ (Node->IdMappingCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)));
}
/** Returns the total size required for the SMMUv3 nodes and
@@ -457,9 +459,9 @@ STATIC UINT64
GetSizeofSmmuV3Nodes (
IN CONST UINT32 NodeStartOffset,
- IN CONST CM_ARM_SMMUV3_NODE * NodeList,
+ IN CONST CM_ARM_SMMUV3_NODE *NodeList,
IN UINT32 NodeCount,
- IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer
+ IN OUT IORT_NODE_INDEXER **CONST NodeIndexer
)
{
UINT64 Size;
@@ -468,8 +470,8 @@ GetSizeofSmmuV3Nodes ( Size = 0;
while (NodeCount-- != 0) {
- (*NodeIndexer)->Token = NodeList->Token;
- (*NodeIndexer)->Object = (VOID*)NodeList;
+ (*NodeIndexer)->Token = NodeList->Token;
+ (*NodeIndexer)->Object = (VOID *)NodeList;
(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
DEBUG ((
DEBUG_INFO,
@@ -484,6 +486,7 @@ GetSizeofSmmuV3Nodes ( (*NodeIndexer)++;
NodeList++;
}
+
return Size;
}
@@ -496,7 +499,7 @@ GetSizeofSmmuV3Nodes ( STATIC
UINT32
GetPmcgNodeSize (
- IN CONST CM_ARM_PMCG_NODE * Node
+ IN CONST CM_ARM_PMCG_NODE *Node
)
{
ASSERT (Node != NULL);
@@ -505,8 +508,8 @@ GetPmcgNodeSize ( Size of ID mapping array
*/
return (UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE) +
- (Node->IdMappingCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)));
+ (Node->IdMappingCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE)));
}
/** Returns the total size required for the PMCG nodes and
@@ -528,9 +531,9 @@ STATIC UINT64
GetSizeofPmcgNodes (
IN CONST UINT32 NodeStartOffset,
- IN CONST CM_ARM_PMCG_NODE * NodeList,
+ IN CONST CM_ARM_PMCG_NODE *NodeList,
IN UINT32 NodeCount,
- IN OUT IORT_NODE_INDEXER ** CONST NodeIndexer
+ IN OUT IORT_NODE_INDEXER **CONST NodeIndexer
)
{
UINT64 Size;
@@ -539,8 +542,8 @@ GetSizeofPmcgNodes ( Size = 0;
while (NodeCount-- != 0) {
- (*NodeIndexer)->Token = NodeList->Token;
- (*NodeIndexer)->Object = (VOID*)NodeList;
+ (*NodeIndexer)->Token = NodeList->Token;
+ (*NodeIndexer)->Object = (VOID *)NodeList;
(*NodeIndexer)->Offset = (UINT32)(Size + NodeStartOffset);
DEBUG ((
DEBUG_INFO,
@@ -555,6 +558,7 @@ GetSizeofPmcgNodes ( (*NodeIndexer)++;
NodeList++;
}
+
return Size;
}
@@ -573,17 +577,17 @@ GetSizeofPmcgNodes ( STATIC
EFI_STATUS
GetNodeOffsetReferencedByToken (
- IN IORT_NODE_INDEXER * NodeIndexer,
- IN UINT32 NodeCount,
- IN CM_OBJECT_TOKEN Token,
- OUT UINT32 * NodeOffset
+ IN IORT_NODE_INDEXER *NodeIndexer,
+ IN UINT32 NodeCount,
+ IN CM_OBJECT_TOKEN Token,
+ OUT UINT32 *NodeOffset
)
{
DEBUG ((
- DEBUG_INFO,
- "IORT: Node Indexer: Search Token = %p\n",
- Token
- ));
+ DEBUG_INFO,
+ "IORT: Node Indexer: Search Token = %p\n",
+ Token
+ ));
while (NodeCount-- != 0) {
DEBUG ((
DEBUG_INFO,
@@ -600,8 +604,10 @@ GetNodeOffsetReferencedByToken ( ));
return EFI_SUCCESS;
}
+
NodeIndexer++;
}
+
DEBUG ((
DEBUG_INFO,
"IORT: Node Indexer: Token = %p, Not Found\n",
@@ -630,21 +636,21 @@ GetNodeOffsetReferencedByToken ( STATIC
EFI_STATUS
AddIdMappingArray (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *IdMapArray,
IN UINT32 IdCount,
IN CONST CM_OBJECT_TOKEN IdMappingToken
)
{
- EFI_STATUS Status;
- CM_ARM_ID_MAPPING * IdMappings;
- UINT32 IdMappingCount;
- ACPI_IORT_GENERATOR * Generator;
+ EFI_STATUS Status;
+ CM_ARM_ID_MAPPING *IdMappings;
+ UINT32 IdMappingCount;
+ ACPI_IORT_GENERATOR *Generator;
ASSERT (IdMapArray != NULL);
- Generator = (ACPI_IORT_GENERATOR*)This;
+ Generator = (ACPI_IORT_GENERATOR *)This;
// Get the Id Mapping Array
Status = GetEArmObjIdMappingArray (
@@ -673,11 +679,11 @@ AddIdMappingArray ( // Populate the Id Mapping array
while (IdCount-- != 0) {
Status = GetNodeOffsetReferencedByToken (
- Generator->NodeIndexer,
- Generator->IortNodeCount,
- IdMappings->OutputReferenceToken,
- &IdMapArray->OutputReference
- );
+ Generator->NodeIndexer,
+ Generator->IortNodeCount,
+ IdMappings->OutputReferenceToken,
+ &IdMapArray->OutputReference
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -690,10 +696,10 @@ AddIdMappingArray ( return Status;
}
- IdMapArray->InputBase = IdMappings->InputBase;
- IdMapArray->NumIds = IdMappings->NumIds;
+ IdMapArray->InputBase = IdMappings->InputBase;
+ IdMapArray->NumIds = IdMappings->NumIds;
IdMapArray->OutputBase = IdMappings->OutputBase;
- IdMapArray->Flags = IdMappings->Flags;
+ IdMapArray->Flags = IdMappings->Flags;
IdMapArray++;
IdMappings++;
@@ -721,26 +727,26 @@ AddIdMappingArray ( STATIC
EFI_STATUS
AddItsGroupNodes (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort,
IN CONST UINT32 NodesStartOffset,
- IN CONST CM_ARM_ITS_GROUP_NODE * NodeList,
+ IN CONST CM_ARM_ITS_GROUP_NODE *NodeList,
IN UINT32 NodeCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE * ItsGroupNode;
- UINT32 * ItsIds;
- CM_ARM_ITS_IDENTIFIER * ItsIdentifier;
- UINT32 ItsIdentifierCount;
- UINT32 IdIndex;
- UINT64 NodeLength;
+ EFI_STATUS Status;
+ EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE *ItsGroupNode;
+ UINT32 *ItsIds;
+ CM_ARM_ITS_IDENTIFIER *ItsIdentifier;
+ UINT32 ItsIdentifierCount;
+ UINT32 IdIndex;
+ UINT64 NodeLength;
ASSERT (Iort != NULL);
- ItsGroupNode = (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE*)((UINT8*)Iort +
- NodesStartOffset);
+ ItsGroupNode = (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE *)((UINT8 *)Iort +
+ NodesStartOffset);
while (NodeCount-- != 0) {
NodeLength = GetItsGroupNodeSize (NodeList);
@@ -757,17 +763,17 @@ AddItsGroupNodes ( }
// Populate the node header
- ItsGroupNode->Node.Type = EFI_ACPI_IORT_TYPE_ITS_GROUP;
- ItsGroupNode->Node.Length = (UINT16)NodeLength;
- ItsGroupNode->Node.Revision = 0;
- ItsGroupNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
+ ItsGroupNode->Node.Type = EFI_ACPI_IORT_TYPE_ITS_GROUP;
+ ItsGroupNode->Node.Length = (UINT16)NodeLength;
+ ItsGroupNode->Node.Revision = 0;
+ ItsGroupNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
ItsGroupNode->Node.NumIdMappings = 0;
- ItsGroupNode->Node.IdReference = 0;
+ ItsGroupNode->Node.IdReference = 0;
// IORT specific data
ItsGroupNode->NumItsIdentifiers = NodeList->ItsIdCount;
- ItsIds = (UINT32*)((UINT8*)ItsGroupNode +
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE));
+ ItsIds = (UINT32 *)((UINT8 *)ItsGroupNode +
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE));
Status = GetEArmObjGicItsIdentifierArray (
CfgMgrProtocol,
@@ -798,8 +804,8 @@ AddItsGroupNodes ( } // ITS identifier array
// Next IORT Group Node
- ItsGroupNode = (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE*)((UINT8*)ItsGroupNode +
- ItsGroupNode->Node.Length);
+ ItsGroupNode = (EFI_ACPI_6_0_IO_REMAPPING_ITS_NODE *)((UINT8 *)ItsGroupNode +
+ ItsGroupNode->Node.Length);
NodeList++;
} // IORT Group Node
@@ -828,25 +834,25 @@ AddItsGroupNodes ( STATIC
EFI_STATUS
AddNamedComponentNodes (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort,
IN CONST UINT32 NodesStartOffset,
- IN CONST CM_ARM_NAMED_COMPONENT_NODE * NodeList,
+ IN CONST CM_ARM_NAMED_COMPONENT_NODE *NodeList,
IN UINT32 NodeCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE * NcNode;
- EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray;
- CHAR8 * ObjectName;
- UINTN ObjectNameLength;
- UINT64 NodeLength;
+ EFI_STATUS Status;
+ EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE *NcNode;
+ EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *IdMapArray;
+ CHAR8 *ObjectName;
+ UINTN ObjectNameLength;
+ UINT64 NodeLength;
ASSERT (Iort != NULL);
- NcNode = (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE*)((UINT8*)Iort +
- NodesStartOffset);
+ NcNode = (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE *)((UINT8 *)Iort +
+ NodesStartOffset);
while (NodeCount-- != 0) {
NodeLength = GetNamedComponentNodeSize (NodeList);
@@ -863,28 +869,28 @@ AddNamedComponentNodes ( }
// Populate the node header
- NcNode->Node.Type = EFI_ACPI_IORT_TYPE_NAMED_COMP;
- NcNode->Node.Length = (UINT16)NodeLength;
- NcNode->Node.Revision = 2;
- NcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
+ NcNode->Node.Type = EFI_ACPI_IORT_TYPE_NAMED_COMP;
+ NcNode->Node.Length = (UINT16)NodeLength;
+ NcNode->Node.Revision = 2;
+ NcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
NcNode->Node.NumIdMappings = NodeList->IdMappingCount;
- ObjectNameLength = AsciiStrLen (NodeList->ObjectName) + 1;
+ ObjectNameLength = AsciiStrLen (NodeList->ObjectName) + 1;
NcNode->Node.IdReference =
(UINT32)(sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE) +
- (ALIGN_VALUE (ObjectNameLength, 4)));
+ (ALIGN_VALUE (ObjectNameLength, 4)));
// Named Component specific data
- NcNode->Flags = NodeList->Flags;
- NcNode->CacheCoherent = NodeList->CacheCoherent;
- NcNode->AllocationHints = NodeList->AllocationHints;
- NcNode->Reserved = EFI_ACPI_RESERVED_WORD;
+ NcNode->Flags = NodeList->Flags;
+ NcNode->CacheCoherent = NodeList->CacheCoherent;
+ NcNode->AllocationHints = NodeList->AllocationHints;
+ NcNode->Reserved = EFI_ACPI_RESERVED_WORD;
NcNode->MemoryAccessFlags = NodeList->MemoryAccessFlags;
- NcNode->AddressSizeLimit = NodeList->AddressSizeLimit;
+ NcNode->AddressSizeLimit = NodeList->AddressSizeLimit;
// Copy the object name
- ObjectName = (CHAR8*)((UINT8*)NcNode +
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE));
+ ObjectName = (CHAR8 *)((UINT8 *)NcNode +
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE));
Status = AsciiStrCpyS (
ObjectName,
ObjectNameLength,
@@ -900,10 +906,11 @@ AddNamedComponentNodes ( }
if ((NodeList->IdMappingCount > 0) &&
- (NodeList->IdMappingToken != CM_NULL_TOKEN)) {
+ (NodeList->IdMappingToken != CM_NULL_TOKEN))
+ {
// Ids for Named Component
- IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)NcNode +
- NcNode->Node.IdReference);
+ IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)NcNode +
+ NcNode->Node.IdReference);
Status = AddIdMappingArray (
This,
@@ -923,8 +930,8 @@ AddNamedComponentNodes ( }
// Next Named Component Node
- NcNode = (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE*)((UINT8*)NcNode +
- NcNode->Node.Length);
+ NcNode = (EFI_ACPI_6_0_IO_REMAPPING_NAMED_COMP_NODE *)((UINT8 *)NcNode +
+ NcNode->Node.Length);
NodeList++;
} // Named Component Node
@@ -952,23 +959,23 @@ AddNamedComponentNodes ( STATIC
EFI_STATUS
AddRootComplexNodes (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort,
IN CONST UINT32 NodesStartOffset,
- IN CONST CM_ARM_ROOT_COMPLEX_NODE * NodeList,
+ IN CONST CM_ARM_ROOT_COMPLEX_NODE *NodeList,
IN UINT32 NodeCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_0_IO_REMAPPING_RC_NODE * RcNode;
- EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray;
- UINT64 NodeLength;
+ EFI_STATUS Status;
+ EFI_ACPI_6_0_IO_REMAPPING_RC_NODE *RcNode;
+ EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *IdMapArray;
+ UINT64 NodeLength;
ASSERT (Iort != NULL);
- RcNode = (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE*)((UINT8*)Iort +
- NodesStartOffset);
+ RcNode = (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE *)((UINT8 *)Iort +
+ NodesStartOffset);
while (NodeCount-- != 0) {
NodeLength = GetRootComplexNodeSize (NodeList);
@@ -985,30 +992,31 @@ AddRootComplexNodes ( }
// Populate the node header
- RcNode->Node.Type = EFI_ACPI_IORT_TYPE_ROOT_COMPLEX;
- RcNode->Node.Length = (UINT16)NodeLength;
- RcNode->Node.Revision = 1;
- RcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
+ RcNode->Node.Type = EFI_ACPI_IORT_TYPE_ROOT_COMPLEX;
+ RcNode->Node.Length = (UINT16)NodeLength;
+ RcNode->Node.Revision = 1;
+ RcNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
RcNode->Node.NumIdMappings = NodeList->IdMappingCount;
- RcNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE);
+ RcNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE);
// Root Complex specific data
- RcNode->CacheCoherent = NodeList->CacheCoherent;
- RcNode->AllocationHints = NodeList->AllocationHints;
- RcNode->Reserved = EFI_ACPI_RESERVED_WORD;
+ RcNode->CacheCoherent = NodeList->CacheCoherent;
+ RcNode->AllocationHints = NodeList->AllocationHints;
+ RcNode->Reserved = EFI_ACPI_RESERVED_WORD;
RcNode->MemoryAccessFlags = NodeList->MemoryAccessFlags;
- RcNode->AtsAttribute = NodeList->AtsAttribute;
- RcNode->PciSegmentNumber = NodeList->PciSegmentNumber;
+ RcNode->AtsAttribute = NodeList->AtsAttribute;
+ RcNode->PciSegmentNumber = NodeList->PciSegmentNumber;
RcNode->MemoryAddressSize = NodeList->MemoryAddressSize;
- RcNode->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
- RcNode->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
- RcNode->Reserved1[2] = EFI_ACPI_RESERVED_BYTE;
+ RcNode->Reserved1[0] = EFI_ACPI_RESERVED_BYTE;
+ RcNode->Reserved1[1] = EFI_ACPI_RESERVED_BYTE;
+ RcNode->Reserved1[2] = EFI_ACPI_RESERVED_BYTE;
if ((NodeList->IdMappingCount > 0) &&
- (NodeList->IdMappingToken != CM_NULL_TOKEN)) {
+ (NodeList->IdMappingToken != CM_NULL_TOKEN))
+ {
// Ids for Root Complex
- IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)RcNode +
- RcNode->Node.IdReference);
+ IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)RcNode +
+ RcNode->Node.IdReference);
Status = AddIdMappingArray (
This,
CfgMgrProtocol,
@@ -1027,8 +1035,8 @@ AddRootComplexNodes ( }
// Next Root Complex Node
- RcNode = (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE*)((UINT8*)RcNode +
- RcNode->Node.Length);
+ RcNode = (EFI_ACPI_6_0_IO_REMAPPING_RC_NODE *)((UINT8 *)RcNode +
+ RcNode->Node.Length);
NodeList++;
} // Root Complex Node
@@ -1054,15 +1062,15 @@ AddRootComplexNodes ( STATIC
EFI_STATUS
AddSmmuInterruptArray (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN OUT EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * InterruptArray,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN OUT EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *InterruptArray,
IN UINT32 InterruptCount,
IN CONST CM_OBJECT_TOKEN InterruptToken
)
{
- EFI_STATUS Status;
- CM_ARM_SMMU_INTERRUPT * SmmuInterrupt;
- UINT32 SmmuInterruptCount;
+ EFI_STATUS Status;
+ CM_ARM_SMMU_INTERRUPT *SmmuInterrupt;
+ UINT32 SmmuInterruptCount;
ASSERT (InterruptArray != NULL);
@@ -1092,7 +1100,7 @@ AddSmmuInterruptArray ( // Populate the Id Mapping array
while (InterruptCount-- != 0) {
- InterruptArray->Interrupt = SmmuInterrupt->Interrupt;
+ InterruptArray->Interrupt = SmmuInterrupt->Interrupt;
InterruptArray->InterruptFlags = SmmuInterrupt->Flags;
InterruptArray++;
SmmuInterrupt++;
@@ -1120,26 +1128,26 @@ AddSmmuInterruptArray ( STATIC
EFI_STATUS
AddSmmuV1V2Nodes (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort,
IN CONST UINT32 NodesStartOffset,
- IN CONST CM_ARM_SMMUV1_SMMUV2_NODE * NodeList,
+ IN CONST CM_ARM_SMMUV1_SMMUV2_NODE *NodeList,
IN UINT32 NodeCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE * SmmuNode;
- EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray;
+ EFI_STATUS Status;
+ EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE *SmmuNode;
+ EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *IdMapArray;
- EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * ContextInterruptArray;
- EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT * PmuInterruptArray;
- UINT64 NodeLength;
+ EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *ContextInterruptArray;
+ EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *PmuInterruptArray;
+ UINT64 NodeLength;
ASSERT (Iort != NULL);
- SmmuNode = (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE*)((UINT8*)Iort +
- NodesStartOffset);
+ SmmuNode = (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE *)((UINT8 *)Iort +
+ NodesStartOffset);
while (NodeCount-- != 0) {
NodeLength = GetSmmuV1V2NodeSize (NodeList);
@@ -1155,20 +1163,20 @@ AddSmmuV1V2Nodes ( }
// Populate the node header
- SmmuNode->Node.Type = EFI_ACPI_IORT_TYPE_SMMUv1v2;
- SmmuNode->Node.Length = (UINT16)NodeLength;
- SmmuNode->Node.Revision = 0;
- SmmuNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
+ SmmuNode->Node.Type = EFI_ACPI_IORT_TYPE_SMMUv1v2;
+ SmmuNode->Node.Length = (UINT16)NodeLength;
+ SmmuNode->Node.Revision = 0;
+ SmmuNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
SmmuNode->Node.NumIdMappings = NodeList->IdMappingCount;
- SmmuNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) +
- (NodeList->ContextInterruptCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) +
- (NodeList->PmuInterruptCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
+ SmmuNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE) +
+ (NodeList->ContextInterruptCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT)) +
+ (NodeList->PmuInterruptCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
// SMMU v1/v2 specific data
- SmmuNode->Base = NodeList->BaseAddress;
- SmmuNode->Span = NodeList->Span;
+ SmmuNode->Base = NodeList->BaseAddress;
+ SmmuNode->Span = NodeList->Span;
SmmuNode->Model = NodeList->Model;
SmmuNode->Flags = NodeList->Flags;
@@ -1177,25 +1185,25 @@ AddSmmuV1V2Nodes ( OFFSET_OF (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE, SMMU_NSgIrpt);
// Context Interrupt
- SmmuNode->NumContextInterrupts = NodeList->ContextInterruptCount;
+ SmmuNode->NumContextInterrupts = NodeList->ContextInterruptCount;
SmmuNode->ContextInterruptArrayRef =
sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE);
ContextInterruptArray =
- (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode +
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE));
+ (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode +
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE));
// PMU Interrupt
- SmmuNode->NumPmuInterrupts = NodeList->PmuInterruptCount;
+ SmmuNode->NumPmuInterrupts = NodeList->PmuInterruptCount;
SmmuNode->PmuInterruptArrayRef = SmmuNode->ContextInterruptArrayRef +
- (NodeList->ContextInterruptCount *
- sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
+ (NodeList->ContextInterruptCount *
+ sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT));
PmuInterruptArray =
- (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT*)((UINT8*)SmmuNode +
- SmmuNode->PmuInterruptArrayRef);
+ (EFI_ACPI_6_0_IO_REMAPPING_SMMU_INT *)((UINT8 *)SmmuNode +
+ SmmuNode->PmuInterruptArrayRef);
- SmmuNode->SMMU_NSgIrpt = NodeList->SMMU_NSgIrpt;
- SmmuNode->SMMU_NSgIrptFlags = NodeList->SMMU_NSgIrptFlags;
- SmmuNode->SMMU_NSgCfgIrpt = NodeList->SMMU_NSgCfgIrpt;
+ SmmuNode->SMMU_NSgIrpt = NodeList->SMMU_NSgIrpt;
+ SmmuNode->SMMU_NSgIrptFlags = NodeList->SMMU_NSgIrptFlags;
+ SmmuNode->SMMU_NSgCfgIrpt = NodeList->SMMU_NSgCfgIrpt;
SmmuNode->SMMU_NSgCfgIrptFlags = NodeList->SMMU_NSgCfgIrptFlags;
// Add Context Interrupt Array
@@ -1216,7 +1224,8 @@ AddSmmuV1V2Nodes ( // Add PMU Interrupt Array
if ((SmmuNode->NumPmuInterrupts > 0) &&
- (NodeList->PmuInterruptToken != CM_NULL_TOKEN)) {
+ (NodeList->PmuInterruptToken != CM_NULL_TOKEN))
+ {
Status = AddSmmuInterruptArray (
CfgMgrProtocol,
PmuInterruptArray,
@@ -1234,10 +1243,11 @@ AddSmmuV1V2Nodes ( }
if ((NodeList->IdMappingCount > 0) &&
- (NodeList->IdMappingToken != CM_NULL_TOKEN)) {
+ (NodeList->IdMappingToken != CM_NULL_TOKEN))
+ {
// Ids for SMMU v1/v2 Node
- IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuNode +
- SmmuNode->Node.IdReference);
+ IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuNode +
+ SmmuNode->Node.IdReference);
Status = AddIdMappingArray (
This,
CfgMgrProtocol,
@@ -1254,9 +1264,10 @@ AddSmmuV1V2Nodes ( return Status;
}
}
+
// Next SMMU v1/v2 Node
- SmmuNode = (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE*)((UINT8*)SmmuNode +
- SmmuNode->Node.Length);
+ SmmuNode = (EFI_ACPI_6_0_IO_REMAPPING_SMMU_NODE *)((UINT8 *)SmmuNode +
+ SmmuNode->Node.Length);
NodeList++;
} // SMMU v1/v2 Node
@@ -1282,23 +1293,23 @@ AddSmmuV1V2Nodes ( STATIC
EFI_STATUS
AddSmmuV3Nodes (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort,
IN CONST UINT32 NodesStartOffset,
- IN CONST CM_ARM_SMMUV3_NODE * NodeList,
+ IN CONST CM_ARM_SMMUV3_NODE *NodeList,
IN UINT32 NodeCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE * SmmuV3Node;
- EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray;
- UINT64 NodeLength;
+ EFI_STATUS Status;
+ EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE *SmmuV3Node;
+ EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *IdMapArray;
+ UINT64 NodeLength;
ASSERT (Iort != NULL);
- SmmuV3Node = (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE*)((UINT8*)Iort +
- NodesStartOffset);
+ SmmuV3Node = (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE *)((UINT8 *)Iort +
+ NodesStartOffset);
while (NodeCount-- != 0) {
NodeLength = GetSmmuV3NodeSize (NodeList);
@@ -1314,24 +1325,24 @@ AddSmmuV3Nodes ( }
// Populate the node header
- SmmuV3Node->Node.Type = EFI_ACPI_IORT_TYPE_SMMUv3;
- SmmuV3Node->Node.Length = (UINT16)NodeLength;
- SmmuV3Node->Node.Revision = 2;
- SmmuV3Node->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
+ SmmuV3Node->Node.Type = EFI_ACPI_IORT_TYPE_SMMUv3;
+ SmmuV3Node->Node.Length = (UINT16)NodeLength;
+ SmmuV3Node->Node.Revision = 2;
+ SmmuV3Node->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
SmmuV3Node->Node.NumIdMappings = NodeList->IdMappingCount;
- SmmuV3Node->Node.IdReference =
+ SmmuV3Node->Node.IdReference =
sizeof (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE);
// SMMUv3 specific data
- SmmuV3Node->Base = NodeList->BaseAddress;
- SmmuV3Node->Flags = NodeList->Flags;
- SmmuV3Node->Reserved = EFI_ACPI_RESERVED_WORD;
+ SmmuV3Node->Base = NodeList->BaseAddress;
+ SmmuV3Node->Flags = NodeList->Flags;
+ SmmuV3Node->Reserved = EFI_ACPI_RESERVED_WORD;
SmmuV3Node->VatosAddress = NodeList->VatosAddress;
- SmmuV3Node->Model = NodeList->Model;
- SmmuV3Node->Event = NodeList->EventInterrupt;
- SmmuV3Node->Pri = NodeList->PriInterrupt;
- SmmuV3Node->Gerr = NodeList->GerrInterrupt;
- SmmuV3Node->Sync = NodeList->SyncInterrupt;
+ SmmuV3Node->Model = NodeList->Model;
+ SmmuV3Node->Event = NodeList->EventInterrupt;
+ SmmuV3Node->Pri = NodeList->PriInterrupt;
+ SmmuV3Node->Gerr = NodeList->GerrInterrupt;
+ SmmuV3Node->Sync = NodeList->SyncInterrupt;
if ((SmmuV3Node->Flags & EFI_ACPI_IORT_SMMUv3_FLAG_PROXIMITY_DOMAIN) != 0) {
// The Proximity Domain Valid flag is set to 1
@@ -1341,7 +1352,8 @@ AddSmmuV3Nodes ( }
if ((SmmuV3Node->Event != 0) && (SmmuV3Node->Pri != 0) &&
- (SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0)) {
+ (SmmuV3Node->Gerr != 0) && (SmmuV3Node->Sync != 0))
+ {
// If all the SMMU control interrupts are GSIV based,
// the DeviceID mapping index field is ignored.
SmmuV3Node->DeviceIdMappingIndex = 0;
@@ -1350,10 +1362,11 @@ AddSmmuV3Nodes ( }
if ((NodeList->IdMappingCount > 0) &&
- (NodeList->IdMappingToken != CM_NULL_TOKEN)) {
+ (NodeList->IdMappingToken != CM_NULL_TOKEN))
+ {
// Ids for SMMUv3 node
- IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)SmmuV3Node +
- SmmuV3Node->Node.IdReference);
+ IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)SmmuV3Node +
+ SmmuV3Node->Node.IdReference);
Status = AddIdMappingArray (
This,
CfgMgrProtocol,
@@ -1372,8 +1385,8 @@ AddSmmuV3Nodes ( }
// Next SMMUv3 Node
- SmmuV3Node = (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE*)((UINT8*)SmmuV3Node +
- SmmuV3Node->Node.Length);
+ SmmuV3Node = (EFI_ACPI_6_0_IO_REMAPPING_SMMU3_NODE *)((UINT8 *)SmmuV3Node +
+ SmmuV3Node->Node.Length);
NodeList++;
} // SMMUv3 Node
@@ -1399,25 +1412,25 @@ AddSmmuV3Nodes ( STATIC
EFI_STATUS
AddPmcgNodes (
- IN CONST ACPI_TABLE_GENERATOR * CONST This,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort,
+ IN CONST ACPI_TABLE_GENERATOR *CONST This,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort,
IN CONST UINT32 NodesStartOffset,
- IN CONST CM_ARM_PMCG_NODE * NodeList,
+ IN CONST CM_ARM_PMCG_NODE *NodeList,
IN UINT32 NodeCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE * PmcgNode;
- EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE * IdMapArray;
- ACPI_IORT_GENERATOR * Generator;
- UINT64 NodeLength;
+ EFI_STATUS Status;
+ EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE *PmcgNode;
+ EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *IdMapArray;
+ ACPI_IORT_GENERATOR *Generator;
+ UINT64 NodeLength;
ASSERT (Iort != NULL);
- Generator = (ACPI_IORT_GENERATOR*)This;
- PmcgNode = (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE*)((UINT8*)Iort +
- NodesStartOffset);
+ Generator = (ACPI_IORT_GENERATOR *)This;
+ PmcgNode = (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE *)((UINT8 *)Iort +
+ NodesStartOffset);
while (NodeCount-- != 0) {
NodeLength = GetPmcgNodeSize (NodeList);
@@ -1433,24 +1446,24 @@ AddPmcgNodes ( }
// Populate the node header
- PmcgNode->Node.Type = EFI_ACPI_IORT_TYPE_PMCG;
- PmcgNode->Node.Length = (UINT16)NodeLength;
- PmcgNode->Node.Revision = 1;
- PmcgNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
+ PmcgNode->Node.Type = EFI_ACPI_IORT_TYPE_PMCG;
+ PmcgNode->Node.Length = (UINT16)NodeLength;
+ PmcgNode->Node.Revision = 1;
+ PmcgNode->Node.Reserved = EFI_ACPI_RESERVED_DWORD;
PmcgNode->Node.NumIdMappings = NodeList->IdMappingCount;
- PmcgNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE);
+ PmcgNode->Node.IdReference = sizeof (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE);
// PMCG specific data
- PmcgNode->Base = NodeList->BaseAddress;
+ PmcgNode->Base = NodeList->BaseAddress;
PmcgNode->OverflowInterruptGsiv = NodeList->OverflowInterrupt;
- PmcgNode->Page1Base = NodeList->Page1BaseAddress;
+ PmcgNode->Page1Base = NodeList->Page1BaseAddress;
Status = GetNodeOffsetReferencedByToken (
- Generator->NodeIndexer,
- Generator->IortNodeCount,
- NodeList->ReferenceToken,
- &PmcgNode->NodeReference
- );
+ Generator->NodeIndexer,
+ Generator->IortNodeCount,
+ NodeList->ReferenceToken,
+ &PmcgNode->NodeReference
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -1464,18 +1477,19 @@ AddPmcgNodes ( }
if ((NodeList->IdMappingCount > 0) &&
- (NodeList->IdMappingToken != CM_NULL_TOKEN)) {
+ (NodeList->IdMappingToken != CM_NULL_TOKEN))
+ {
// Ids for PMCG node
- IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE*)((UINT8*)PmcgNode +
- PmcgNode->Node.IdReference);
+ IdMapArray = (EFI_ACPI_6_0_IO_REMAPPING_ID_TABLE *)((UINT8 *)PmcgNode +
+ PmcgNode->Node.IdReference);
Status = AddIdMappingArray (
- This,
- CfgMgrProtocol,
- IdMapArray,
- NodeList->IdMappingCount,
- NodeList->IdMappingToken
- );
+ This,
+ CfgMgrProtocol,
+ IdMapArray,
+ NodeList->IdMappingCount,
+ NodeList->IdMappingToken
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -1487,8 +1501,8 @@ AddPmcgNodes ( }
// Next PMCG Node
- PmcgNode = (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE*)((UINT8*)PmcgNode +
- PmcgNode->Node.Length);
+ PmcgNode = (EFI_ACPI_6_0_IO_REMAPPING_PMCG_NODE *)((UINT8 *)PmcgNode +
+ PmcgNode->Node.Length);
NodeList++;
} // PMCG Node
@@ -1521,42 +1535,42 @@ STATIC EFI_STATUS
EFIAPI
BuildIortTable (
- 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
+ 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
)
{
- EFI_STATUS Status;
-
- UINT64 TableSize;
- UINT64 NodeSize;
-
- UINT32 IortNodeCount;
- UINT32 ItsGroupNodeCount;
- UINT32 NamedComponentNodeCount;
- UINT32 RootComplexNodeCount;
- UINT32 SmmuV1V2NodeCount;
- UINT32 SmmuV3NodeCount;
- UINT32 PmcgNodeCount;
-
- UINT32 ItsGroupOffset;
- UINT32 NamedComponentOffset;
- UINT32 RootComplexOffset;
- UINT32 SmmuV1V2Offset;
- UINT32 SmmuV3Offset;
- UINT32 PmcgOffset;
-
- CM_ARM_ITS_GROUP_NODE * ItsGroupNodeList;
- CM_ARM_NAMED_COMPONENT_NODE * NamedComponentNodeList;
- CM_ARM_ROOT_COMPLEX_NODE * RootComplexNodeList;
- CM_ARM_SMMUV1_SMMUV2_NODE * SmmuV1V2NodeList;
- CM_ARM_SMMUV3_NODE * SmmuV3NodeList;
- CM_ARM_PMCG_NODE * PmcgNodeList;
-
- EFI_ACPI_6_0_IO_REMAPPING_TABLE * Iort;
- IORT_NODE_INDEXER * NodeIndexer;
- ACPI_IORT_GENERATOR * Generator;
+ EFI_STATUS Status;
+
+ UINT64 TableSize;
+ UINT64 NodeSize;
+
+ UINT32 IortNodeCount;
+ UINT32 ItsGroupNodeCount;
+ UINT32 NamedComponentNodeCount;
+ UINT32 RootComplexNodeCount;
+ UINT32 SmmuV1V2NodeCount;
+ UINT32 SmmuV3NodeCount;
+ UINT32 PmcgNodeCount;
+
+ UINT32 ItsGroupOffset;
+ UINT32 NamedComponentOffset;
+ UINT32 RootComplexOffset;
+ UINT32 SmmuV1V2Offset;
+ UINT32 SmmuV3Offset;
+ UINT32 PmcgOffset;
+
+ CM_ARM_ITS_GROUP_NODE *ItsGroupNodeList;
+ CM_ARM_NAMED_COMPONENT_NODE *NamedComponentNodeList;
+ CM_ARM_ROOT_COMPLEX_NODE *RootComplexNodeList;
+ CM_ARM_SMMUV1_SMMUV2_NODE *SmmuV1V2NodeList;
+ CM_ARM_SMMUV3_NODE *SmmuV3NodeList;
+ CM_ARM_PMCG_NODE *PmcgNodeList;
+
+ EFI_ACPI_6_0_IO_REMAPPING_TABLE *Iort;
+ IORT_NODE_INDEXER *NodeIndexer;
+ ACPI_IORT_GENERATOR *Generator;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -1566,7 +1580,8 @@ BuildIortTable ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: IORT: Requested table revision = %d, is not supported."
@@ -1578,8 +1593,8 @@ BuildIortTable ( return EFI_INVALID_PARAMETER;
}
- Generator = (ACPI_IORT_GENERATOR*)This;
- *Table = NULL;
+ Generator = (ACPI_IORT_GENERATOR *)This;
+ *Table = NULL;
// Get the ITS group node info
Status = GetEArmObjItsGroup (
@@ -1696,10 +1711,10 @@ BuildIortTable ( IortNodeCount += PmcgNodeCount;
// Allocate Node Indexer array
- NodeIndexer = (IORT_NODE_INDEXER*)AllocateZeroPool (
- (sizeof (IORT_NODE_INDEXER) *
- IortNodeCount)
- );
+ NodeIndexer = (IORT_NODE_INDEXER *)AllocateZeroPool (
+ (sizeof (IORT_NODE_INDEXER) *
+ IortNodeCount)
+ );
if (NodeIndexer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -1713,7 +1728,7 @@ BuildIortTable ( DEBUG ((DEBUG_INFO, "INFO: NodeIndexer = %p\n", NodeIndexer));
Generator->IortNodeCount = IortNodeCount;
- Generator->NodeIndexer = NodeIndexer;
+ Generator->NodeIndexer = NodeIndexer;
// Calculate the size of the IORT table
TableSize = sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE);
@@ -1737,6 +1752,7 @@ BuildIortTable ( ));
goto error_handler;
}
+
TableSize += NodeSize;
DEBUG ((
@@ -1767,6 +1783,7 @@ BuildIortTable ( ));
goto error_handler;
}
+
TableSize += NodeSize;
DEBUG ((
@@ -1797,6 +1814,7 @@ BuildIortTable ( ));
goto error_handler;
}
+
TableSize += NodeSize;
DEBUG ((
@@ -1827,6 +1845,7 @@ BuildIortTable ( ));
goto error_handler;
}
+
TableSize += NodeSize;
DEBUG ((
@@ -1857,6 +1876,7 @@ BuildIortTable ( ));
goto error_handler;
}
+
TableSize += NodeSize;
DEBUG ((
@@ -1887,6 +1907,7 @@ BuildIortTable ( ));
goto error_handler;
}
+
TableSize += NodeSize;
DEBUG ((
@@ -1920,7 +1941,7 @@ BuildIortTable ( }
// Allocate the Buffer for IORT table
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
if (*Table == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -1933,7 +1954,7 @@ BuildIortTable ( goto error_handler;
}
- Iort = (EFI_ACPI_6_0_IO_REMAPPING_TABLE*)*Table;
+ Iort = (EFI_ACPI_6_0_IO_REMAPPING_TABLE *)*Table;
DEBUG ((
DEBUG_INFO,
@@ -1959,9 +1980,9 @@ BuildIortTable ( }
// Update IORT table
- Iort->NumNodes = IortNodeCount;
+ Iort->NumNodes = IortNodeCount;
Iort->NodeOffset = sizeof (EFI_ACPI_6_0_IO_REMAPPING_TABLE);
- Iort->Reserved = EFI_ACPI_RESERVED_DWORD;
+ Iort->Reserved = EFI_ACPI_RESERVED_DWORD;
if (ItsGroupNodeCount > 0) {
Status = AddItsGroupNodes (
@@ -2089,6 +2110,7 @@ error_handler: FreePool (*Table);
*Table = NULL;
}
+
return Status;
}
@@ -2106,20 +2128,21 @@ error_handler: STATIC
EFI_STATUS
FreeIortTableResources (
- 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
+ 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
)
{
- ACPI_IORT_GENERATOR * Generator;
+ ACPI_IORT_GENERATOR *Generator;
+
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
ASSERT (CfgMgrProtocol != NULL);
ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
- Generator = (ACPI_IORT_GENERATOR*)This;
+ Generator = (ACPI_IORT_GENERATOR *)This;
// Free any memory allocated by the generator
if (Generator->NodeIndexer != NULL) {
@@ -2140,12 +2163,12 @@ FreeIortTableResources ( /** The IORT Table Generator revision.
*/
-#define IORT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define IORT_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the MADT Table Generator.
*/
STATIC
-ACPI_IORT_GENERATOR IortGenerator = {
+ACPI_IORT_GENERATOR IortGenerator = {
// ACPI table generator header
{
// Generator ID
@@ -2194,11 +2217,12 @@ ACPI_IORT_GENERATOR IortGenerator = { EFI_STATUS
EFIAPI
AcpiIortLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&IortGenerator.Header);
DEBUG ((DEBUG_INFO, "IORT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -2217,11 +2241,12 @@ AcpiIortLibConstructor ( EFI_STATUS
EFIAPI
AcpiIortLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&IortGenerator.Header);
DEBUG ((DEBUG_INFO, "Iort: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h index bbf8aaf9ef..61f6b6153f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.h @@ -22,21 +22,21 @@ typedef struct IortNodeIndexer { /// Index token for the Node
CM_OBJECT_TOKEN Token;
/// Pointer to the node
- VOID * Object;
+ VOID *Object;
/// Node offset from the start of the IORT table
UINT32 Offset;
} IORT_NODE_INDEXER;
typedef struct AcpiIortGenerator {
/// ACPI Table generator header
- ACPI_TABLE_GENERATOR Header;
+ ACPI_TABLE_GENERATOR Header;
// IORT Generator private data
/// IORT node count
- UINT32 IortNodeCount;
+ UINT32 IortNodeCount;
/// Pointer to the node indexer array
- IORT_NODE_INDEXER * NodeIndexer;
+ IORT_NODE_INDEXER *NodeIndexer;
} ACPI_IORT_GENERATOR;
#pragma pack()
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c index 7ec800f51c..2102a59faf 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMadtLibArm/MadtGenerator.c @@ -91,8 +91,8 @@ GET_OBJECT_LIST ( STATIC
VOID
AddGICC (
- IN EFI_ACPI_6_3_GIC_STRUCTURE * CONST Gicc,
- IN CONST CM_ARM_GICC_INFO * CONST GicCInfo,
+ IN EFI_ACPI_6_3_GIC_STRUCTURE *CONST Gicc,
+ IN CONST CM_ARM_GICC_INFO *CONST GicCInfo,
IN CONST UINT8 MadtRev
)
{
@@ -167,19 +167,19 @@ AddGICC ( BOOLEAN
EFIAPI
IsAcpiUidEqual (
- IN CONST VOID * GicCInfo1,
- IN CONST VOID * GicCInfo2,
- IN UINTN Index1,
- IN UINTN Index2
+ IN CONST VOID *GicCInfo1,
+ IN CONST VOID *GicCInfo2,
+ IN UINTN Index1,
+ IN UINTN Index2
)
{
- UINT32 Uid1;
- UINT32 Uid2;
+ UINT32 Uid1;
+ UINT32 Uid2;
ASSERT ((GicCInfo1 != NULL) && (GicCInfo2 != NULL));
- Uid1 = ((CM_ARM_GICC_INFO*)GicCInfo1)->AcpiProcessorUid;
- Uid2 = ((CM_ARM_GICC_INFO*)GicCInfo2)->AcpiProcessorUid;
+ Uid1 = ((CM_ARM_GICC_INFO *)GicCInfo1)->AcpiProcessorUid;
+ Uid2 = ((CM_ARM_GICC_INFO *)GicCInfo2)->AcpiProcessorUid;
if (Uid1 == Uid2) {
DEBUG ((
@@ -214,13 +214,13 @@ IsAcpiUidEqual ( STATIC
EFI_STATUS
AddGICCList (
- IN EFI_ACPI_6_3_GIC_STRUCTURE * Gicc,
- IN CONST CM_ARM_GICC_INFO * GicCInfo,
- IN UINT32 GicCCount,
- IN CONST UINT8 MadtRev
+ IN EFI_ACPI_6_3_GIC_STRUCTURE *Gicc,
+ IN CONST CM_ARM_GICC_INFO *GicCInfo,
+ IN UINT32 GicCCount,
+ IN CONST UINT8 MadtRev
)
{
- BOOLEAN IsAcpiProcUidDuplicated;
+ BOOLEAN IsAcpiProcUidDuplicated;
ASSERT (Gicc != NULL);
ASSERT (GicCInfo != NULL);
@@ -252,9 +252,9 @@ AddGICCList ( STATIC
VOID
AddGICD (
- EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE * CONST Gicd,
- CONST CM_ARM_GICD_INFO * CONST GicDInfo
-)
+ EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *CONST Gicd,
+ CONST CM_ARM_GICD_INFO *CONST GicDInfo
+ )
{
ASSERT (Gicd != NULL);
ASSERT (GicDInfo != NULL);
@@ -289,22 +289,22 @@ AddGICD ( STATIC
VOID
AddGICMsiFrame (
- IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE * CONST GicMsiFrame,
- IN CONST CM_ARM_GIC_MSI_FRAME_INFO * CONST GicMsiFrameInfo
-)
+ IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *CONST GicMsiFrame,
+ IN CONST CM_ARM_GIC_MSI_FRAME_INFO *CONST GicMsiFrameInfo
+ )
{
ASSERT (GicMsiFrame != NULL);
ASSERT (GicMsiFrameInfo != NULL);
- GicMsiFrame->Type = EFI_ACPI_6_3_GIC_MSI_FRAME;
- GicMsiFrame->Length = sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE);
- GicMsiFrame->Reserved1 = EFI_ACPI_RESERVED_WORD;
- GicMsiFrame->GicMsiFrameId = GicMsiFrameInfo->GicMsiFrameId;
+ GicMsiFrame->Type = EFI_ACPI_6_3_GIC_MSI_FRAME;
+ GicMsiFrame->Length = sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE);
+ GicMsiFrame->Reserved1 = EFI_ACPI_RESERVED_WORD;
+ GicMsiFrame->GicMsiFrameId = GicMsiFrameInfo->GicMsiFrameId;
GicMsiFrame->PhysicalBaseAddress = GicMsiFrameInfo->PhysicalBaseAddress;
- GicMsiFrame->Flags = GicMsiFrameInfo->Flags;
+ GicMsiFrame->Flags = GicMsiFrameInfo->Flags;
GicMsiFrame->SPICount = GicMsiFrameInfo->SPICount;
- GicMsiFrame->SPIBase = GicMsiFrameInfo->SPIBase;
+ GicMsiFrame->SPIBase = GicMsiFrameInfo->SPIBase;
}
/** Add the GIC MSI Frame Information to the MADT Table.
@@ -316,10 +316,10 @@ AddGICMsiFrame ( STATIC
VOID
AddGICMsiFrameInfoList (
- IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE * GicMsiFrame,
- IN CONST CM_ARM_GIC_MSI_FRAME_INFO * GicMsiFrameInfo,
- IN UINT32 GicMsiFrameCount
-)
+ IN EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *GicMsiFrame,
+ IN CONST CM_ARM_GIC_MSI_FRAME_INFO *GicMsiFrameInfo,
+ IN UINT32 GicMsiFrameCount
+ )
{
ASSERT (GicMsiFrame != NULL);
ASSERT (GicMsiFrameInfo != NULL);
@@ -337,16 +337,16 @@ AddGICMsiFrameInfoList ( STATIC
VOID
AddGICRedistributor (
- IN EFI_ACPI_6_3_GICR_STRUCTURE * CONST Gicr,
- IN CONST CM_ARM_GIC_REDIST_INFO * CONST GicRedistributorInfo
+ IN EFI_ACPI_6_3_GICR_STRUCTURE *CONST Gicr,
+ IN CONST CM_ARM_GIC_REDIST_INFO *CONST GicRedistributorInfo
)
{
ASSERT (Gicr != NULL);
ASSERT (GicRedistributorInfo != NULL);
- Gicr->Type = EFI_ACPI_6_3_GICR;
- Gicr->Length = sizeof (EFI_ACPI_6_3_GICR_STRUCTURE);
- Gicr->Reserved = EFI_ACPI_RESERVED_WORD;
+ Gicr->Type = EFI_ACPI_6_3_GICR;
+ Gicr->Length = sizeof (EFI_ACPI_6_3_GICR_STRUCTURE);
+ Gicr->Reserved = EFI_ACPI_RESERVED_WORD;
Gicr->DiscoveryRangeBaseAddress =
GicRedistributorInfo->DiscoveryRangeBaseAddress;
Gicr->DiscoveryRangeLength = GicRedistributorInfo->DiscoveryRangeLength;
@@ -361,10 +361,10 @@ AddGICRedistributor ( STATIC
VOID
AddGICRedistributorList (
- IN EFI_ACPI_6_3_GICR_STRUCTURE * Gicr,
- IN CONST CM_ARM_GIC_REDIST_INFO * GicRInfo,
- IN UINT32 GicRCount
-)
+ IN EFI_ACPI_6_3_GICR_STRUCTURE *Gicr,
+ IN CONST CM_ARM_GIC_REDIST_INFO *GicRInfo,
+ IN UINT32 GicRCount
+ )
{
ASSERT (Gicr != NULL);
ASSERT (GicRInfo != NULL);
@@ -382,19 +382,19 @@ AddGICRedistributorList ( STATIC
VOID
AddGICInterruptTranslationService (
- IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE * CONST GicIts,
- IN CONST CM_ARM_GIC_ITS_INFO * CONST GicItsInfo
-)
+ IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE *CONST GicIts,
+ IN CONST CM_ARM_GIC_ITS_INFO *CONST GicItsInfo
+ )
{
ASSERT (GicIts != NULL);
ASSERT (GicItsInfo != NULL);
- GicIts->Type = EFI_ACPI_6_3_GIC_ITS;
- GicIts->Length = sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE);
- GicIts->Reserved = EFI_ACPI_RESERVED_WORD;
- GicIts->GicItsId = GicItsInfo->GicItsId;
+ GicIts->Type = EFI_ACPI_6_3_GIC_ITS;
+ GicIts->Length = sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE);
+ GicIts->Reserved = EFI_ACPI_RESERVED_WORD;
+ GicIts->GicItsId = GicItsInfo->GicItsId;
GicIts->PhysicalBaseAddress = GicItsInfo->PhysicalBaseAddress;
- GicIts->Reserved2 = EFI_ACPI_RESERVED_DWORD;
+ GicIts->Reserved2 = EFI_ACPI_RESERVED_DWORD;
}
/** Add the GIC Interrupt Translation Service Information
@@ -407,10 +407,10 @@ AddGICInterruptTranslationService ( STATIC
VOID
AddGICItsList (
- IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE * GicIts,
- IN CONST CM_ARM_GIC_ITS_INFO * GicItsInfo,
- IN UINT32 GicItsCount
-)
+ IN EFI_ACPI_6_3_GIC_ITS_STRUCTURE *GicIts,
+ IN CONST CM_ARM_GIC_ITS_INFO *GicItsInfo,
+ IN UINT32 GicItsCount
+ )
{
ASSERT (GicIts != NULL);
ASSERT (GicItsInfo != NULL);
@@ -446,31 +446,31 @@ STATIC EFI_STATUS
EFIAPI
BuildMadtTable (
- 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
+ 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
)
{
- EFI_STATUS Status;
- UINT32 TableSize;
- UINT32 GicCCount;
- UINT32 GicDCount;
- UINT32 GicMSICount;
- UINT32 GicRedistCount;
- UINT32 GicItsCount;
- CM_ARM_GICC_INFO * GicCInfo;
- CM_ARM_GICD_INFO * GicDInfo;
- CM_ARM_GIC_MSI_FRAME_INFO * GicMSIInfo;
- CM_ARM_GIC_REDIST_INFO * GicRedistInfo;
- CM_ARM_GIC_ITS_INFO * GicItsInfo;
- UINT32 GicCOffset;
- UINT32 GicDOffset;
- UINT32 GicMSIOffset;
- UINT32 GicRedistOffset;
- UINT32 GicItsOffset;
-
- EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER * Madt;
+ EFI_STATUS Status;
+ UINT32 TableSize;
+ UINT32 GicCCount;
+ UINT32 GicDCount;
+ UINT32 GicMSICount;
+ UINT32 GicRedistCount;
+ UINT32 GicItsCount;
+ CM_ARM_GICC_INFO *GicCInfo;
+ CM_ARM_GICD_INFO *GicDInfo;
+ CM_ARM_GIC_MSI_FRAME_INFO *GicMSIInfo;
+ CM_ARM_GIC_REDIST_INFO *GicRedistInfo;
+ CM_ARM_GIC_ITS_INFO *GicItsInfo;
+ UINT32 GicCOffset;
+ UINT32 GicDOffset;
+ UINT32 GicMSIOffset;
+ UINT32 GicRedistOffset;
+ UINT32 GicItsOffset;
+
+ EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *Madt;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -480,7 +480,8 @@ BuildMadtTable ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: MADT: Requested table revision = %d, is not supported."
@@ -610,16 +611,16 @@ BuildMadtTable ( TableSize += (sizeof (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE) * GicDCount);
GicMSIOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE) * GicMSICount);
+ TableSize += (sizeof (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE) * GicMSICount);
GicRedistOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_GICR_STRUCTURE) * GicRedistCount);
+ TableSize += (sizeof (EFI_ACPI_6_3_GICR_STRUCTURE) * GicRedistCount);
GicItsOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE) * GicItsCount);
+ TableSize += (sizeof (EFI_ACPI_6_3_GIC_ITS_STRUCTURE) * GicItsCount);
// Allocate the Buffer for MADT table
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
if (*Table == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -632,7 +633,7 @@ BuildMadtTable ( goto error_handler;
}
- Madt = (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER*)*Table;
+ Madt = (EFI_ACPI_6_3_MULTIPLE_APIC_DESCRIPTION_TABLE_HEADER *)*Table;
DEBUG ((
DEBUG_INFO,
@@ -658,11 +659,11 @@ BuildMadtTable ( }
Status = AddGICCList (
- (EFI_ACPI_6_3_GIC_STRUCTURE*)((UINT8*)Madt + GicCOffset),
- GicCInfo,
- GicCCount,
- Madt->Header.Revision
- );
+ (EFI_ACPI_6_3_GIC_STRUCTURE *)((UINT8 *)Madt + GicCOffset),
+ GicCInfo,
+ GicCCount,
+ Madt->Header.Revision
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -673,13 +674,13 @@ BuildMadtTable ( }
AddGICD (
- (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE*)((UINT8*)Madt + GicDOffset),
+ (EFI_ACPI_6_3_GIC_DISTRIBUTOR_STRUCTURE *)((UINT8 *)Madt + GicDOffset),
GicDInfo
);
if (GicMSICount != 0) {
AddGICMsiFrameInfoList (
- (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE*)((UINT8*)Madt + GicMSIOffset),
+ (EFI_ACPI_6_3_GIC_MSI_FRAME_STRUCTURE *)((UINT8 *)Madt + GicMSIOffset),
GicMSIInfo,
GicMSICount
);
@@ -687,7 +688,7 @@ BuildMadtTable ( if (GicRedistCount != 0) {
AddGICRedistributorList (
- (EFI_ACPI_6_3_GICR_STRUCTURE*)((UINT8*)Madt + GicRedistOffset),
+ (EFI_ACPI_6_3_GICR_STRUCTURE *)((UINT8 *)Madt + GicRedistOffset),
GicRedistInfo,
GicRedistCount
);
@@ -695,7 +696,7 @@ BuildMadtTable ( if (GicItsCount != 0) {
AddGICItsList (
- (EFI_ACPI_6_3_GIC_ITS_STRUCTURE*)((UINT8*)Madt + GicItsOffset),
+ (EFI_ACPI_6_3_GIC_ITS_STRUCTURE *)((UINT8 *)Madt + GicItsOffset),
GicItsInfo,
GicItsCount
);
@@ -708,6 +709,7 @@ error_handler: FreePool (*Table);
*Table = NULL;
}
+
return Status;
}
@@ -725,10 +727,10 @@ error_handler: STATIC
EFI_STATUS
FreeMadtTableResources (
- 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
+ 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
)
{
ASSERT (This != NULL);
@@ -750,13 +752,13 @@ FreeMadtTableResources ( /** The MADT Table Generator revision.
*/
-#define MADT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define MADT_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the MADT Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR MadtGenerator = {
+ACPI_TABLE_GENERATOR MadtGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMadt),
// Generator Description
@@ -795,11 +797,12 @@ ACPI_TABLE_GENERATOR MadtGenerator = { EFI_STATUS
EFIAPI
AcpiMadtLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&MadtGenerator);
DEBUG ((DEBUG_INFO, "MADT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -818,11 +821,12 @@ AcpiMadtLibConstructor ( EFI_STATUS
EFIAPI
AcpiMadtLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&MadtGenerator);
DEBUG ((DEBUG_INFO, "MADT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c index 1293ac8e43..004b794a3c 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiMcfgLibArm/McfgGenerator.c @@ -68,27 +68,27 @@ GET_OBJECT_LIST ( STATIC
VOID
AddPciConfigurationSpaceList (
- IN MCFG_TABLE * CONST Mcfg,
+ IN MCFG_TABLE *CONST Mcfg,
IN CONST UINT32 PciCfgSpaceOffset,
- IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO * PciCfgSpaceInfoList,
+ IN CONST CM_ARM_PCI_CONFIG_SPACE_INFO *PciCfgSpaceInfoList,
IN UINT32 PciCfgSpaceCount
-)
+ )
{
- MCFG_CFG_SPACE_ADDR * PciCfgSpace;
+ MCFG_CFG_SPACE_ADDR *PciCfgSpace;
ASSERT (Mcfg != NULL);
ASSERT (PciCfgSpaceInfoList != NULL);
- PciCfgSpace = (MCFG_CFG_SPACE_ADDR *)((UINT8*)Mcfg + PciCfgSpaceOffset);
+ PciCfgSpace = (MCFG_CFG_SPACE_ADDR *)((UINT8 *)Mcfg + PciCfgSpaceOffset);
while (PciCfgSpaceCount-- != 0) {
// Add PCI Configuration Space entry
- PciCfgSpace->BaseAddress = PciCfgSpaceInfoList->BaseAddress;
+ PciCfgSpace->BaseAddress = PciCfgSpaceInfoList->BaseAddress;
PciCfgSpace->PciSegmentGroupNumber =
PciCfgSpaceInfoList->PciSegmentGroupNumber;
PciCfgSpace->StartBusNumber = PciCfgSpaceInfoList->StartBusNumber;
- PciCfgSpace->EndBusNumber = PciCfgSpaceInfoList->EndBusNumber;
- PciCfgSpace->Reserved = EFI_ACPI_RESERVED_DWORD;
+ PciCfgSpace->EndBusNumber = PciCfgSpaceInfoList->EndBusNumber;
+ PciCfgSpace->Reserved = EFI_ACPI_RESERVED_DWORD;
PciCfgSpace++;
PciCfgSpaceInfoList++;
}
@@ -120,17 +120,17 @@ STATIC EFI_STATUS
EFIAPI
BuildMcfgTable (
- 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
+ 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
)
{
- EFI_STATUS Status;
- UINT32 TableSize;
- UINT32 ConfigurationSpaceCount;
- CM_ARM_PCI_CONFIG_SPACE_INFO * PciConfigSpaceInfoList;
- MCFG_TABLE * Mcfg;
+ EFI_STATUS Status;
+ UINT32 TableSize;
+ UINT32 ConfigurationSpaceCount;
+ CM_ARM_PCI_CONFIG_SPACE_INFO *PciConfigSpaceInfoList;
+ MCFG_TABLE *Mcfg;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -140,7 +140,8 @@ BuildMcfgTable ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: MCFG: Requested table revision = %d, is not supported."
@@ -154,13 +155,14 @@ BuildMcfgTable ( *Table = NULL;
Status = GetEArmObjPciConfigSpaceInfo (
- CfgMgrProtocol,
- CM_NULL_TOKEN,
- &PciConfigSpaceInfoList,
- &ConfigurationSpaceCount
- );
+ CfgMgrProtocol,
+ CM_NULL_TOKEN,
+ &PciConfigSpaceInfoList,
+ &ConfigurationSpaceCount
+ );
if (EFI_ERROR (Status)) {
- DEBUG ((DEBUG_ERROR,
+ DEBUG ((
+ DEBUG_ERROR,
"ERROR: MCFG: Failed to get PCI Configuration Space Information." \
" Status = %r\n",
Status
@@ -187,9 +189,9 @@ BuildMcfgTable ( // Calculate the MCFG Table Size
TableSize = sizeof (MCFG_TABLE) +
- ((sizeof (MCFG_CFG_SPACE_ADDR) * ConfigurationSpaceCount));
+ ((sizeof (MCFG_CFG_SPACE_ADDR) * ConfigurationSpaceCount));
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
if (*Table == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -202,7 +204,7 @@ BuildMcfgTable ( goto error_handler;
}
- Mcfg = (MCFG_TABLE*)*Table;
+ Mcfg = (MCFG_TABLE *)*Table;
DEBUG ((
DEBUG_INFO,
"MCFG: Mcfg = 0x%p TableSize = 0x%x\n",
@@ -242,6 +244,7 @@ error_handler: FreePool (*Table);
*Table = NULL;
}
+
return Status;
}
@@ -259,10 +262,10 @@ error_handler: STATIC
EFI_STATUS
FreeMcfgTableResources (
- 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
+ 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
)
{
ASSERT (This != NULL);
@@ -284,13 +287,13 @@ FreeMcfgTableResources ( /** This macro defines the MCFG Table Generator revision.
*/
-#define MCFG_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define MCFG_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the MCFG Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR McfgGenerator = {
+ACPI_TABLE_GENERATOR McfgGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdMcfg),
// Generator Description
@@ -329,11 +332,12 @@ ACPI_TABLE_GENERATOR McfgGenerator = { EFI_STATUS
EFIAPI
AcpiMcfgLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&McfgGenerator);
DEBUG ((DEBUG_INFO, "MCFG: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -352,11 +356,12 @@ AcpiMcfgLibConstructor ( EFI_STATUS
EFIAPI
AcpiMcfgLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&McfgGenerator);
DEBUG ((DEBUG_INFO, "MCFG: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c index d70fc59e75..f78bbed7c1 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.c @@ -101,14 +101,14 @@ GET_OBJECT_LIST ( STATIC
UINT32
GetProcHierarchyNodeSize (
- IN CONST CM_ARM_PROC_HIERARCHY_INFO * Node
+ IN CONST CM_ARM_PROC_HIERARCHY_INFO *Node
)
{
ASSERT (Node != NULL);
// <size of Processor Hierarchy Node> + <size of Private Resources array>
return sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR) +
- (Node->NoOfPrivateResources * sizeof (UINT32));
+ (Node->NoOfPrivateResources * sizeof (UINT32));
}
/**
@@ -157,10 +157,10 @@ GET_SIZE_OF_PPTT_STRUCTS ( STATIC
EFI_STATUS
GetPpttNodeReferencedByToken (
- IN PPTT_NODE_INDEXER * NodeIndexer,
- IN UINT32 NodeCount,
- IN CONST CM_OBJECT_TOKEN SearchToken,
- OUT PPTT_NODE_INDEXER ** IndexedNodeFound
+ IN PPTT_NODE_INDEXER *NodeIndexer,
+ IN UINT32 NodeCount,
+ IN CONST CM_OBJECT_TOKEN SearchToken,
+ OUT PPTT_NODE_INDEXER **IndexedNodeFound
)
{
EFI_STATUS Status;
@@ -183,7 +183,7 @@ GetPpttNodeReferencedByToken ( if (NodeIndexer->Token == SearchToken) {
*IndexedNodeFound = NodeIndexer;
- Status = EFI_SUCCESS;
+ Status = EFI_SUCCESS;
DEBUG ((
DEBUG_INFO,
"PPTT: Node Indexer: Token = %p. Found, Status = %r\n",
@@ -192,6 +192,7 @@ GetPpttNodeReferencedByToken ( ));
return Status;
}
+
NodeIndexer++;
}
@@ -218,17 +219,17 @@ GetPpttNodeReferencedByToken ( STATIC
EFI_STATUS
DetectCyclesInTopology (
- IN CONST ACPI_PPTT_GENERATOR * CONST Generator
+ IN CONST ACPI_PPTT_GENERATOR *CONST Generator
)
{
- EFI_STATUS Status;
- PPTT_NODE_INDEXER * Iterator;
- PPTT_NODE_INDEXER * CycleDetector;
- UINT32 NodesRemaining;
+ EFI_STATUS Status;
+ PPTT_NODE_INDEXER *Iterator;
+ PPTT_NODE_INDEXER *CycleDetector;
+ UINT32 NodesRemaining;
ASSERT (Generator != NULL);
- Iterator = Generator->NodeIndexer;
+ Iterator = Generator->NodeIndexer;
NodesRemaining = Generator->ProcTopologyStructCount;
while (NodesRemaining != 0) {
@@ -265,7 +266,7 @@ DetectCyclesInTopology ( // Stamp the visited node
CycleDetector->CycleDetectionStamp = NodesRemaining;
- CycleDetector = CycleDetector->TopologyParent;
+ CycleDetector = CycleDetector->TopologyParent;
} // Continue topology tree walk
Iterator++;
@@ -293,17 +294,17 @@ DetectCyclesInTopology ( STATIC
EFI_STATUS
AddPrivateResources (
- IN CONST ACPI_PPTT_GENERATOR * CONST Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN UINT32 * PrivResArray,
+ IN CONST ACPI_PPTT_GENERATOR *CONST Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN UINT32 *PrivResArray,
IN UINT32 PrivResCount,
IN CONST CM_OBJECT_TOKEN PrivResArrayToken
)
{
- EFI_STATUS Status;
- CM_ARM_OBJ_REF * CmObjRefs;
- UINT32 CmObjRefCount;
- PPTT_NODE_INDEXER * PpttNodeFound;
+ EFI_STATUS Status;
+ CM_ARM_OBJ_REF *CmObjRefs;
+ UINT32 CmObjRefCount;
+ PPTT_NODE_INDEXER *PpttNodeFound;
ASSERT (
(Generator != NULL) &&
@@ -422,32 +423,33 @@ AddPrivateResources ( BOOLEAN
EFIAPI
IsGicCTokenEqual (
- IN CONST VOID * Object1,
- IN CONST VOID * Object2,
- IN UINTN Index1,
- IN UINTN Index2
+ IN CONST VOID *Object1,
+ IN CONST VOID *Object2,
+ IN UINTN Index1,
+ IN UINTN Index2
)
{
- PPTT_NODE_INDEXER * IndexedObject1;
- PPTT_NODE_INDEXER * IndexedObject2;
- CM_ARM_PROC_HIERARCHY_INFO * ProcNode1;
- CM_ARM_PROC_HIERARCHY_INFO * ProcNode2;
+ PPTT_NODE_INDEXER *IndexedObject1;
+ PPTT_NODE_INDEXER *IndexedObject2;
+ CM_ARM_PROC_HIERARCHY_INFO *ProcNode1;
+ CM_ARM_PROC_HIERARCHY_INFO *ProcNode2;
ASSERT (
(Object1 != NULL) &&
(Object2 != NULL)
);
- IndexedObject1 = (PPTT_NODE_INDEXER*)Object1;
- IndexedObject2 = (PPTT_NODE_INDEXER*)Object2;
- ProcNode1 = (CM_ARM_PROC_HIERARCHY_INFO*)IndexedObject1->Object;
- ProcNode2 = (CM_ARM_PROC_HIERARCHY_INFO*)IndexedObject2->Object;
+ IndexedObject1 = (PPTT_NODE_INDEXER *)Object1;
+ IndexedObject2 = (PPTT_NODE_INDEXER *)Object2;
+ ProcNode1 = (CM_ARM_PROC_HIERARCHY_INFO *)IndexedObject1->Object;
+ ProcNode2 = (CM_ARM_PROC_HIERARCHY_INFO *)IndexedObject2->Object;
if (IS_ACPI_PROC_ID_VALID (ProcNode1) &&
IS_ACPI_PROC_ID_VALID (ProcNode2) &&
(ProcNode1->GicCToken != CM_NULL_TOKEN) &&
(ProcNode2->GicCToken != CM_NULL_TOKEN) &&
- (ProcNode1->GicCToken == ProcNode2->GicCToken)) {
+ (ProcNode1->GicCToken == ProcNode2->GicCToken))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: Two Processor Hierarchy Info objects (%d and %d) map to " \
@@ -484,27 +486,27 @@ IsGicCTokenEqual ( STATIC
EFI_STATUS
AddProcHierarchyNodes (
- IN CONST ACPI_PPTT_GENERATOR * CONST Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt,
- IN CONST UINT32 NodesStartOffset
+ IN CONST ACPI_PPTT_GENERATOR *CONST Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt,
+ IN CONST UINT32 NodesStartOffset
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR * ProcStruct;
- UINT32 * PrivateResources;
- BOOLEAN IsGicCTokenDuplicated;
+ EFI_STATUS Status;
+ EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR *ProcStruct;
+ UINT32 *PrivateResources;
+ BOOLEAN IsGicCTokenDuplicated;
- CM_ARM_GICC_INFO * GicCInfoList;
- UINT32 GicCInfoCount;
- UINT32 UniqueGicCRefCount;
+ CM_ARM_GICC_INFO *GicCInfoList;
+ UINT32 GicCInfoCount;
+ UINT32 UniqueGicCRefCount;
- PPTT_NODE_INDEXER * PpttNodeFound;
- CM_ARM_PROC_HIERARCHY_INFO * ProcInfoNode;
+ PPTT_NODE_INDEXER *PpttNodeFound;
+ CM_ARM_PROC_HIERARCHY_INFO *ProcInfoNode;
- PPTT_NODE_INDEXER * ProcNodeIterator;
- UINT32 NodeCount;
- UINT32 Length;
+ PPTT_NODE_INDEXER *ProcNodeIterator;
+ UINT32 NodeCount;
+ UINT32 Length;
ASSERT (
(Generator != NULL) &&
@@ -512,11 +514,11 @@ AddProcHierarchyNodes ( (Pptt != NULL)
);
- ProcStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR*)((UINT8*)Pptt +
- NodesStartOffset);
+ ProcStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR *)((UINT8 *)Pptt +
+ NodesStartOffset);
ProcNodeIterator = Generator->ProcHierarchyNodeIndexedList;
- NodeCount = Generator->ProcHierarchyNodeCount;
+ NodeCount = Generator->ProcHierarchyNodeCount;
// Check if every GICC Object is referenced by onlu one Proc Node
IsGicCTokenDuplicated = FindDuplicateValue (
@@ -534,7 +536,7 @@ AddProcHierarchyNodes ( UniqueGicCRefCount = 0;
while (NodeCount-- != 0) {
- ProcInfoNode = (CM_ARM_PROC_HIERARCHY_INFO*)ProcNodeIterator->Object;
+ ProcInfoNode = (CM_ARM_PROC_HIERARCHY_INFO *)ProcNodeIterator->Object;
// Check if the private resource count is within the size limit
// imposed on the Processor Hierarchy node by the specification.
@@ -556,16 +558,16 @@ AddProcHierarchyNodes ( }
// Populate the node header
- ProcStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_PROCESSOR;
- ProcStruct->Length = (UINT8)Length;
+ ProcStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_PROCESSOR;
+ ProcStruct->Length = (UINT8)Length;
ProcStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
ProcStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
// Populate the flags
- ProcStruct->Flags.PhysicalPackage = ProcInfoNode->Flags & BIT0;
- ProcStruct->Flags.AcpiProcessorIdValid = (ProcInfoNode->Flags & BIT1) >> 1;
- ProcStruct->Flags.ProcessorIsAThread = (ProcInfoNode->Flags & BIT2) >> 2;
- ProcStruct->Flags.NodeIsALeaf = (ProcInfoNode->Flags & BIT3) >> 3;
+ ProcStruct->Flags.PhysicalPackage = ProcInfoNode->Flags & BIT0;
+ ProcStruct->Flags.AcpiProcessorIdValid = (ProcInfoNode->Flags & BIT1) >> 1;
+ ProcStruct->Flags.ProcessorIsAThread = (ProcInfoNode->Flags & BIT2) >> 2;
+ ProcStruct->Flags.NodeIsALeaf = (ProcInfoNode->Flags & BIT3) >> 3;
ProcStruct->Flags.IdenticalImplementation =
(ProcInfoNode->Flags & BIT4) >> 4;
ProcStruct->Flags.Reserved = 0;
@@ -594,7 +596,9 @@ AddProcHierarchyNodes ( // Test if the reference is to a 'leaf' node
if (IS_PROC_NODE_LEAF (
- ((CM_ARM_PROC_HIERARCHY_INFO*)PpttNodeFound->Object))) {
+ ((CM_ARM_PROC_HIERARCHY_INFO *)PpttNodeFound->Object)
+ ))
+ {
Status = EFI_INVALID_PARAMETER;
DEBUG ((
DEBUG_ERROR,
@@ -676,18 +680,18 @@ AddProcHierarchyNodes ( }
ProcStruct->NumberOfPrivateResources = ProcInfoNode->NoOfPrivateResources;
- PrivateResources = (UINT32*)((UINT8*)ProcStruct +
- sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR));
+ PrivateResources = (UINT32 *)((UINT8 *)ProcStruct +
+ sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR));
if (ProcStruct->NumberOfPrivateResources != 0) {
// Populate the private resources array
Status = AddPrivateResources (
- Generator,
- CfgMgrProtocol,
- PrivateResources,
- ProcStruct->NumberOfPrivateResources,
- ProcInfoNode->PrivateResourcesArrayToken
- );
+ Generator,
+ CfgMgrProtocol,
+ PrivateResources,
+ ProcStruct->NumberOfPrivateResources,
+ ProcInfoNode->PrivateResourcesArrayToken
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -700,8 +704,8 @@ AddProcHierarchyNodes ( }
// Next Processor Hierarchy Node
- ProcStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR*)((UINT8*)ProcStruct +
- ProcStruct->Length);
+ ProcStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_PROCESSOR *)((UINT8 *)ProcStruct +
+ ProcStruct->Length);
ProcNodeIterator++;
} // Processor Hierarchy Node
@@ -762,18 +766,18 @@ AddProcHierarchyNodes ( STATIC
EFI_STATUS
AddCacheTypeStructures (
- IN CONST ACPI_PPTT_GENERATOR * CONST Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt,
- IN CONST UINT32 NodesStartOffset
+ IN CONST ACPI_PPTT_GENERATOR *CONST Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt,
+ IN CONST UINT32 NodesStartOffset
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE * CacheStruct;
- PPTT_NODE_INDEXER * PpttNodeFound;
- CM_ARM_CACHE_INFO * CacheInfoNode;
- PPTT_NODE_INDEXER * CacheNodeIterator;
- UINT32 NodeCount;
+ EFI_STATUS Status;
+ EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE *CacheStruct;
+ PPTT_NODE_INDEXER *PpttNodeFound;
+ CM_ARM_CACHE_INFO *CacheInfoNode;
+ PPTT_NODE_INDEXER *CacheNodeIterator;
+ UINT32 NodeCount;
ASSERT (
(Generator != NULL) &&
@@ -781,31 +785,31 @@ AddCacheTypeStructures ( (Pptt != NULL)
);
- CacheStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE*)((UINT8*)Pptt +
- NodesStartOffset);
+ CacheStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE *)((UINT8 *)Pptt +
+ NodesStartOffset);
CacheNodeIterator = Generator->CacheStructIndexedList;
- NodeCount = Generator->CacheStructCount;
+ NodeCount = Generator->CacheStructCount;
while (NodeCount-- != 0) {
- CacheInfoNode = (CM_ARM_CACHE_INFO*)CacheNodeIterator->Object;
+ CacheInfoNode = (CM_ARM_CACHE_INFO *)CacheNodeIterator->Object;
// Populate the node header
- CacheStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_CACHE;
- CacheStruct->Length = sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE);
+ CacheStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_CACHE;
+ CacheStruct->Length = sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE);
CacheStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
CacheStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
// "On Arm-based systems, all cache properties must be provided in the
// table." (ACPI 6.3, Section 5.2.29.2)
- CacheStruct->Flags.SizePropertyValid = 1;
- CacheStruct->Flags.NumberOfSetsValid = 1;
- CacheStruct->Flags.AssociativityValid = 1;
+ CacheStruct->Flags.SizePropertyValid = 1;
+ CacheStruct->Flags.NumberOfSetsValid = 1;
+ CacheStruct->Flags.AssociativityValid = 1;
CacheStruct->Flags.AllocationTypeValid = 1;
- CacheStruct->Flags.CacheTypeValid = 1;
- CacheStruct->Flags.WritePolicyValid = 1;
- CacheStruct->Flags.LineSizeValid = 1;
- CacheStruct->Flags.Reserved = 0;
+ CacheStruct->Flags.CacheTypeValid = 1;
+ CacheStruct->Flags.WritePolicyValid = 1;
+ CacheStruct->Flags.LineSizeValid = 1;
+ CacheStruct->Flags.Reserved = 0;
// Populate the reference to the next level of cache
if (CacheInfoNode->NextLevelOfCacheToken == CM_NULL_TOKEN) {
@@ -886,7 +890,7 @@ AddCacheTypeStructures ( // current ACPI specification.
// These checks will be needed in the future when the ACPI specification
// is extended. Disabling this code for now.
-#if 0
+ #if 0
if (CacheInfoNode->Associativity > PPTT_ARM_CCIDX_CACHE_ASSOCIATIVITY_MAX) {
Status = EFI_INVALID_PARAMETER;
DEBUG ((
@@ -909,7 +913,8 @@ AddCacheTypeStructures ( CacheInfoNode->Associativity
));
}
-#endif
+
+ #endif
// Note a typecast is needed as the maximum associativity
// supported by ACPI Cache type structure is MAX_UINT8.
@@ -926,13 +931,13 @@ AddCacheTypeStructures ( // Validate and populate cache line size
if ((CacheInfoNode->LineSize < PPTT_ARM_CACHE_LINE_SIZE_MIN) ||
- (CacheInfoNode->LineSize > PPTT_ARM_CACHE_LINE_SIZE_MAX)) {
-
+ (CacheInfoNode->LineSize > PPTT_ARM_CACHE_LINE_SIZE_MAX))
+ {
Status = EFI_INVALID_PARAMETER;
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: The cache line size must be between %d and %d bytes " \
- "on ARM Platforms. LineSize = %d. Status = %r\n" ,
+ "on ARM Platforms. LineSize = %d. Status = %r\n",
PPTT_ARM_CACHE_LINE_SIZE_MIN,
PPTT_ARM_CACHE_LINE_SIZE_MAX,
CacheInfoNode->LineSize,
@@ -946,7 +951,7 @@ AddCacheTypeStructures ( DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: The cache line size is not a power of 2. " \
- "LineSize = %d. Status = %r\n" ,
+ "LineSize = %d. Status = %r\n",
CacheInfoNode->LineSize,
Status
));
@@ -956,8 +961,8 @@ AddCacheTypeStructures ( CacheStruct->LineSize = CacheInfoNode->LineSize;
// Next Cache Type Structure
- CacheStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE*)((UINT8*)CacheStruct +
- CacheStruct->Length);
+ CacheStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_CACHE *)((UINT8 *)CacheStruct +
+ CacheStruct->Length);
CacheNodeIterator++;
} // Cache Type Structure
@@ -984,17 +989,16 @@ AddCacheTypeStructures ( STATIC
EFI_STATUS
AddIdTypeStructures (
- IN CONST ACPI_PPTT_GENERATOR * CONST Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt,
- IN CONST UINT32 NodesStartOffset
+ IN CONST ACPI_PPTT_GENERATOR *CONST Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN CONST EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt,
+ IN CONST UINT32 NodesStartOffset
)
{
- EFI_ACPI_6_3_PPTT_STRUCTURE_ID * IdStruct;
- CM_ARM_PROC_NODE_ID_INFO * ProcIdInfoNode;
- PPTT_NODE_INDEXER * IdStructIterator;
- UINT32 NodeCount;
-
+ EFI_ACPI_6_3_PPTT_STRUCTURE_ID *IdStruct;
+ CM_ARM_PROC_NODE_ID_INFO *ProcIdInfoNode;
+ PPTT_NODE_INDEXER *IdStructIterator;
+ UINT32 NodeCount;
ASSERT (
(Generator != NULL) &&
@@ -1002,28 +1006,28 @@ AddIdTypeStructures ( (Pptt != NULL)
);
- IdStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_ID*)((UINT8*)Pptt + NodesStartOffset);
+ IdStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_ID *)((UINT8 *)Pptt + NodesStartOffset);
IdStructIterator = Generator->IdStructIndexedList;
- NodeCount = Generator->IdStructCount;
+ NodeCount = Generator->IdStructCount;
while (NodeCount-- != 0) {
- ProcIdInfoNode = (CM_ARM_PROC_NODE_ID_INFO*)IdStructIterator->Object;
+ ProcIdInfoNode = (CM_ARM_PROC_NODE_ID_INFO *)IdStructIterator->Object;
// Populate the node
- IdStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_ID;
- IdStruct->Length = sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_ID);
+ IdStruct->Type = EFI_ACPI_6_3_PPTT_TYPE_ID;
+ IdStruct->Length = sizeof (EFI_ACPI_6_3_PPTT_STRUCTURE_ID);
IdStruct->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
IdStruct->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
- IdStruct->VendorId = ProcIdInfoNode->VendorId;
- IdStruct->Level1Id = ProcIdInfoNode->Level1Id;
- IdStruct->Level2Id = ProcIdInfoNode->Level2Id;
- IdStruct->MajorRev = ProcIdInfoNode->MajorRev;
- IdStruct->MinorRev = ProcIdInfoNode->MinorRev;
- IdStruct->SpinRev = ProcIdInfoNode->SpinRev;
+ IdStruct->VendorId = ProcIdInfoNode->VendorId;
+ IdStruct->Level1Id = ProcIdInfoNode->Level1Id;
+ IdStruct->Level2Id = ProcIdInfoNode->Level2Id;
+ IdStruct->MajorRev = ProcIdInfoNode->MajorRev;
+ IdStruct->MinorRev = ProcIdInfoNode->MinorRev;
+ IdStruct->SpinRev = ProcIdInfoNode->SpinRev;
// Next ID Type Structure
- IdStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_ID*)((UINT8*)IdStruct +
- IdStruct->Length);
+ IdStruct = (EFI_ACPI_6_3_PPTT_STRUCTURE_ID *)((UINT8 *)IdStruct +
+ IdStruct->Length);
IdStructIterator++;
} // ID Type Structure
@@ -1057,33 +1061,33 @@ STATIC EFI_STATUS
EFIAPI
BuildPpttTable (
- 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
+ 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
)
{
- EFI_STATUS Status;
- UINT32 TableSize;
- UINT32 ProcTopologyStructCount;
- UINT32 ProcHierarchyNodeCount;
- UINT32 CacheStructCount;
- UINT32 IdStructCount;
+ EFI_STATUS Status;
+ UINT32 TableSize;
+ UINT32 ProcTopologyStructCount;
+ UINT32 ProcHierarchyNodeCount;
+ UINT32 CacheStructCount;
+ UINT32 IdStructCount;
- UINT32 ProcHierarchyNodeOffset;
- UINT32 CacheStructOffset;
- UINT32 IdStructOffset;
+ UINT32 ProcHierarchyNodeOffset;
+ UINT32 CacheStructOffset;
+ UINT32 IdStructOffset;
- CM_ARM_PROC_HIERARCHY_INFO * ProcHierarchyNodeList;
- CM_ARM_CACHE_INFO * CacheStructList;
- CM_ARM_PROC_NODE_ID_INFO * IdStructList;
+ CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeList;
+ CM_ARM_CACHE_INFO *CacheStructList;
+ CM_ARM_PROC_NODE_ID_INFO *IdStructList;
- ACPI_PPTT_GENERATOR * Generator;
+ ACPI_PPTT_GENERATOR *Generator;
// Pointer to the Node Indexer array
- PPTT_NODE_INDEXER * NodeIndexer;
+ PPTT_NODE_INDEXER *NodeIndexer;
- EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER * Pptt;
+ EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *Pptt;
ASSERT (
(This != NULL) &&
@@ -1095,7 +1099,8 @@ BuildPpttTable ( );
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: PPTT: Requested table revision = %d is not supported. "
@@ -1107,8 +1112,8 @@ BuildPpttTable ( return EFI_INVALID_PARAMETER;
}
- Generator = (ACPI_PPTT_GENERATOR*)This;
- *Table = NULL;
+ Generator = (ACPI_PPTT_GENERATOR *)This;
+ *Table = NULL;
// Get the processor hierarchy info and update the processor topology
// structure count with Processor Hierarchy Nodes (Type 0)
@@ -1127,7 +1132,7 @@ BuildPpttTable ( goto error_handler;
}
- ProcTopologyStructCount = ProcHierarchyNodeCount;
+ ProcTopologyStructCount = ProcHierarchyNodeCount;
Generator->ProcHierarchyNodeCount = ProcHierarchyNodeCount;
// Get the cache info and update the processor topology structure count with
@@ -1147,7 +1152,7 @@ BuildPpttTable ( goto error_handler;
}
- ProcTopologyStructCount += CacheStructCount;
+ ProcTopologyStructCount += CacheStructCount;
Generator->CacheStructCount = CacheStructCount;
// Get the processor hierarchy node ID info and update the processor topology
@@ -1172,10 +1177,10 @@ BuildPpttTable ( Generator->IdStructCount = IdStructCount;
// Allocate Node Indexer array
- NodeIndexer = (PPTT_NODE_INDEXER*)AllocateZeroPool (
- sizeof (PPTT_NODE_INDEXER) *
- ProcTopologyStructCount
- );
+ NodeIndexer = (PPTT_NODE_INDEXER *)AllocateZeroPool (
+ sizeof (PPTT_NODE_INDEXER) *
+ ProcTopologyStructCount
+ );
if (NodeIndexer == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -1188,21 +1193,21 @@ BuildPpttTable ( DEBUG ((DEBUG_INFO, "INFO: NodeIndexer = %p\n", NodeIndexer));
Generator->ProcTopologyStructCount = ProcTopologyStructCount;
- Generator->NodeIndexer = NodeIndexer;
+ Generator->NodeIndexer = NodeIndexer;
// Calculate the size of the PPTT table
TableSize = sizeof (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER);
// Include the size of Processor Hierarchy Nodes and index them
if (Generator->ProcHierarchyNodeCount != 0) {
- ProcHierarchyNodeOffset = TableSize;
+ ProcHierarchyNodeOffset = TableSize;
Generator->ProcHierarchyNodeIndexedList = NodeIndexer;
- TableSize += GetSizeofProcHierarchyNodes (
- ProcHierarchyNodeOffset,
- ProcHierarchyNodeList,
- Generator->ProcHierarchyNodeCount,
- &NodeIndexer
- );
+ TableSize += GetSizeofProcHierarchyNodes (
+ ProcHierarchyNodeOffset,
+ ProcHierarchyNodeList,
+ Generator->ProcHierarchyNodeCount,
+ &NodeIndexer
+ );
DEBUG ((
DEBUG_INFO,
@@ -1213,19 +1218,18 @@ BuildPpttTable ( ProcHierarchyNodeOffset,
Generator->ProcHierarchyNodeIndexedList
));
-
}
// Include the size of Cache Type Structures and index them
if (Generator->CacheStructCount != 0) {
- CacheStructOffset = TableSize;
+ CacheStructOffset = TableSize;
Generator->CacheStructIndexedList = NodeIndexer;
- TableSize += GetSizeofCacheTypeStructs (
- CacheStructOffset,
- CacheStructList,
- Generator->CacheStructCount,
- &NodeIndexer
- );
+ TableSize += GetSizeofCacheTypeStructs (
+ CacheStructOffset,
+ CacheStructList,
+ Generator->CacheStructCount,
+ &NodeIndexer
+ );
DEBUG ((
DEBUG_INFO,
" CacheStructCount = %d\n" \
@@ -1239,14 +1243,14 @@ BuildPpttTable ( // Include the size of ID Type Structures and index them
if (Generator->IdStructCount != 0) {
- IdStructOffset = TableSize;
+ IdStructOffset = TableSize;
Generator->IdStructIndexedList = NodeIndexer;
- TableSize += GetSizeofIdStructs (
- IdStructOffset,
- IdStructList,
- Generator->IdStructCount,
- &NodeIndexer
- );
+ TableSize += GetSizeofIdStructs (
+ IdStructOffset,
+ IdStructList,
+ Generator->IdStructCount,
+ &NodeIndexer
+ );
DEBUG ((
DEBUG_INFO,
" IdStructCount = %d\n" \
@@ -1268,7 +1272,7 @@ BuildPpttTable ( ));
// Allocate the Buffer for the PPTT table
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
if (*Table == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -1281,7 +1285,7 @@ BuildPpttTable ( goto error_handler;
}
- Pptt = (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER*)*Table;
+ Pptt = (EFI_ACPI_6_3_PROCESSOR_PROPERTIES_TOPOLOGY_TABLE_HEADER *)*Table;
DEBUG ((
DEBUG_INFO,
@@ -1403,13 +1407,13 @@ error_handler: STATIC
EFI_STATUS
FreePpttTableResources (
- 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
+ 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
)
{
- ACPI_PPTT_GENERATOR * Generator;
+ ACPI_PPTT_GENERATOR *Generator;
ASSERT (
(This != NULL) &&
@@ -1419,7 +1423,7 @@ FreePpttTableResources ( (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature)
);
- Generator = (ACPI_PPTT_GENERATOR*)This;
+ Generator = (ACPI_PPTT_GENERATOR *)This;
// Free any memory allocated by the generator
if (Generator->NodeIndexer != NULL) {
@@ -1443,12 +1447,12 @@ FreePpttTableResources ( /** The PPTT Table Generator revision.
*/
-#define PPTT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define PPTT_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the PPTT Table Generator.
*/
STATIC
-ACPI_PPTT_GENERATOR PpttGenerator = {
+ACPI_PPTT_GENERATOR PpttGenerator = {
// ACPI table generator header
{
// Generator ID
@@ -1504,11 +1508,12 @@ ACPI_PPTT_GENERATOR PpttGenerator = { EFI_STATUS
EFIAPI
AcpiPpttLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&PpttGenerator.Header);
DEBUG ((DEBUG_INFO, "PPTT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -1528,11 +1533,12 @@ AcpiPpttLibConstructor ( EFI_STATUS
EFIAPI
AcpiPpttLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&PpttGenerator.Header);
DEBUG ((DEBUG_INFO, "PPTT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h index 0a14da502d..f587e67e9f 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiPpttLibArm/PpttGenerator.h @@ -21,30 +21,30 @@ /// Cache parameters allowed by the architecture with
/// ARMv8.3-CCIDX (Cache extended number of sets)
/// Derived from CCSIDR_EL1 when ID_AA64MMFR2_EL1.CCIDX==0001
-#define PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX (1 << 24)
-#define PPTT_ARM_CCIDX_CACHE_ASSOCIATIVITY_MAX (1 << 21)
+#define PPTT_ARM_CCIDX_CACHE_NUMBER_OF_SETS_MAX (1 << 24)
+#define PPTT_ARM_CCIDX_CACHE_ASSOCIATIVITY_MAX (1 << 21)
/// Cache parameters allowed by the architecture without
/// ARMv8.3-CCIDX (Cache extended number of sets)
/// Derived from CCSIDR_EL1 when ID_AA64MMFR2_EL1.CCIDX==0000
-#define PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX (1 << 15)
-#define PPTT_ARM_CACHE_ASSOCIATIVITY_MAX (1 << 10)
+#define PPTT_ARM_CACHE_NUMBER_OF_SETS_MAX (1 << 15)
+#define PPTT_ARM_CACHE_ASSOCIATIVITY_MAX (1 << 10)
/// Common cache parameters
/// Derived from CCSIDR_EL1
/// The LineSize is represented by bits 2:0
/// (Log2(Number of bytes in cache line)) - 4 is used to represent
/// the LineSize bits.
-#define PPTT_ARM_CACHE_LINE_SIZE_MAX (1 << 11)
-#define PPTT_ARM_CACHE_LINE_SIZE_MIN (1 << 4)
+#define PPTT_ARM_CACHE_LINE_SIZE_MAX (1 << 11)
+#define PPTT_ARM_CACHE_LINE_SIZE_MIN (1 << 4)
/// Test if the given Processor Hierarchy Info object has the 'Node is a Leaf'
/// flag set
-#define IS_PROC_NODE_LEAF(Node) ((Node->Flags & BIT3) != 0)
+#define IS_PROC_NODE_LEAF(Node) ((Node->Flags & BIT3) != 0)
/// Test if the given Processor Hierarchy Info object has the 'ACPI Processor
/// ID valid' flag set
-#define IS_ACPI_PROC_ID_VALID(Node) ((Node->Flags & BIT1) != 0)
+#define IS_ACPI_PROC_ID_VALID(Node) ((Node->Flags & BIT1) != 0)
/**
The GET_SIZE_OF_PPTT_STRUCTS macro expands to a function that is used to
@@ -90,10 +90,10 @@ @param [in] CmObjectType Data type of the CM nodes in NodesToIndex.
**/
#define GET_SIZE_OF_PPTT_STRUCTS( \
- PpttObjName, \
- PpttObjSize, \
- CmObjectType \
-) \
+ PpttObjName, \
+ PpttObjSize, \
+ CmObjectType \
+ ) \
STATIC \
UINT32 \
GetSizeof##PpttObjName ( \
@@ -148,7 +148,7 @@ typedef struct PpttNodeIndexer { /// Unique identifier for the node
CM_OBJECT_TOKEN Token;
/// Pointer to the CM object being indexed
- VOID * Object;
+ VOID *Object;
/// Offset from the start of the PPTT table to the PPTT structure which is
/// represented by Object
UINT32 Offset;
@@ -159,29 +159,29 @@ typedef struct PpttNodeIndexer { /// Indexer element in the processor and cache topology
/// e.g For a hardware thread the TopologyParent would point to a CPU node
/// For a L1 cache the TopologyParent would point to a L2 cache
- struct PpttNodeIndexer * TopologyParent;
+ struct PpttNodeIndexer *TopologyParent;
} PPTT_NODE_INDEXER;
typedef struct AcpiPpttGenerator {
/// ACPI Table generator header
- ACPI_TABLE_GENERATOR Header;
+ ACPI_TABLE_GENERATOR Header;
/// PPTT structure count
- UINT32 ProcTopologyStructCount;
+ UINT32 ProcTopologyStructCount;
/// Count of Processor Hierarchy Nodes
- UINT32 ProcHierarchyNodeCount;
+ UINT32 ProcHierarchyNodeCount;
/// Count of Cache Structures
- UINT32 CacheStructCount;
+ UINT32 CacheStructCount;
/// Count of Id Structures
- UINT32 IdStructCount;
+ UINT32 IdStructCount;
/// List of indexed CM objects for PPTT generation
- PPTT_NODE_INDEXER * NodeIndexer;
+ PPTT_NODE_INDEXER *NodeIndexer;
/// Pointer to the start of Processor Hierarchy nodes in
/// the Node Indexer array
- PPTT_NODE_INDEXER * ProcHierarchyNodeIndexedList;
+ PPTT_NODE_INDEXER *ProcHierarchyNodeIndexedList;
/// Pointer to the start of Cache Structures in the Node Indexer array
- PPTT_NODE_INDEXER * CacheStructIndexedList;
+ PPTT_NODE_INDEXER *CacheStructIndexedList;
/// Pointer to the start of Id Structures in the Node Indexer array
- PPTT_NODE_INDEXER * IdStructIndexedList;
+ PPTT_NODE_INDEXER *IdStructIndexedList;
} ACPI_PPTT_GENERATOR;
#pragma pack()
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c index 2facfaa048..a8323ad4ea 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiRawLibArm/RawGenerator.c @@ -38,10 +38,10 @@ STATIC EFI_STATUS
EFIAPI
BuildRawTable (
- 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
+ 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
)
{
ASSERT (This != NULL);
@@ -63,13 +63,13 @@ BuildRawTable ( /** This macro defines the Raw Generator revision.
*/
-#define RAW_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define RAW_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the Raw Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR RawGenerator = {
+ACPI_TABLE_GENERATOR RawGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdRaw),
// Generator Description
@@ -109,11 +109,12 @@ ACPI_TABLE_GENERATOR RawGenerator = { EFI_STATUS
EFIAPI
AcpiRawLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&RawGenerator);
DEBUG ((DEBUG_INFO, "RAW: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -132,11 +133,12 @@ AcpiRawLibConstructor ( EFI_STATUS
EFIAPI
AcpiRawLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&RawGenerator);
DEBUG ((DEBUG_INFO, "RAW: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c index fecfd6bbab..59cbacbfbb 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSpcrLibArm/SpcrGenerator.c @@ -45,22 +45,22 @@ NOTE: This implementation ignores the possibility that the Serial settings may /** A string representing the name of the SPCR port.
*/
-#define NAME_STR_SPCR_PORT "COM1"
+#define NAME_STR_SPCR_PORT "COM1"
/** An UID representing the SPCR port.
*/
-#define UID_SPCR_PORT 1
+#define UID_SPCR_PORT 1
/** This macro defines the no flow control option.
*/
-#define SPCR_FLOW_CONTROL_NONE 0
+#define SPCR_FLOW_CONTROL_NONE 0
/**A template for generating the SPCR Table.
Note: fields marked "{Template}" will be updated dynamically.
*/
STATIC
-EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE AcpiSpcr = {
+EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE AcpiSpcr = {
ACPI_HEADER (
EFI_ACPI_6_2_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE_SIGNATURE,
EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE,
@@ -120,15 +120,15 @@ STATIC EFI_STATUS
EFIAPI
FreeSpcrTableEx (
- 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,
+ 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,
IN CONST UINTN TableCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
+ EFI_STATUS Status;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -138,7 +138,8 @@ FreeSpcrTableEx ( if ((Table == NULL) ||
(*Table == NULL) ||
- (TableCount != 2)) {
+ (TableCount != 2))
+ {
DEBUG ((DEBUG_ERROR, "ERROR: SPCR: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER;
}
@@ -147,7 +148,8 @@ FreeSpcrTableEx ( if ((TableList[1] == NULL) ||
(TableList[1]->Signature !=
- EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) {
+ EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
+ {
DEBUG ((DEBUG_ERROR, "ERROR: SPCR: Invalid SSDT table pointer.\n"));
return EFI_INVALID_PARAMETER;
}
@@ -191,17 +193,17 @@ STATIC EFI_STATUS
EFIAPI
BuildSpcrTableEx (
- IN CONST ACPI_TABLE_GENERATOR * This,
- IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- OUT EFI_ACPI_DESCRIPTION_HEADER *** Table,
- OUT UINTN * CONST TableCount
+ IN CONST ACPI_TABLE_GENERATOR *This,
+ IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ OUT EFI_ACPI_DESCRIPTION_HEADER ***Table,
+ OUT UINTN *CONST TableCount
)
{
- EFI_STATUS Status;
- CM_ARM_SERIAL_PORT_INFO * SerialPortInfo;
- UINT32 SerialPortCount;
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
+ EFI_STATUS Status;
+ CM_ARM_SERIAL_PORT_INFO *SerialPortInfo;
+ UINT32 SerialPortCount;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -212,7 +214,8 @@ BuildSpcrTableEx ( ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SPCR: Requested table revision = %d, is not supported."
@@ -264,8 +267,8 @@ BuildSpcrTableEx ( }
// Allocate a table to store pointers to the SPCR and SSDT tables.
- TableList = (EFI_ACPI_DESCRIPTION_HEADER**)
- AllocateZeroPool (sizeof (EFI_ACPI_DESCRIPTION_HEADER*) * 2);
+ TableList = (EFI_ACPI_DESCRIPTION_HEADER **)
+ AllocateZeroPool (sizeof (EFI_ACPI_DESCRIPTION_HEADER *) * 2);
if (TableList == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -281,7 +284,7 @@ BuildSpcrTableEx ( Status = AddAcpiHeader (
CfgMgrProtocol,
This,
- (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr,
+ (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiSpcr,
AcpiTableInfo,
sizeof (EFI_ACPI_SERIAL_PORT_CONSOLE_REDIRECTION_TABLE)
);
@@ -364,7 +367,7 @@ BuildSpcrTableEx ( goto error_handler;
} // switch
- TableList[0] = (EFI_ACPI_DESCRIPTION_HEADER*)&AcpiSpcr;
+ TableList[0] = (EFI_ACPI_DESCRIPTION_HEADER *)&AcpiSpcr;
// Build a SSDT table describing the serial port.
Status = BuildSsdtSerialPortTable (
@@ -384,7 +387,7 @@ BuildSpcrTableEx ( }
*TableCount = 2;
- *Table = TableList;
+ *Table = TableList;
return Status;
@@ -398,13 +401,13 @@ error_handler: /** This macro defines the SPCR Table Generator revision.
*/
-#define SPCR_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define SPCR_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the SPCR Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR SpcrGenerator = {
+ACPI_TABLE_GENERATOR SpcrGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSpcr),
// Generator Description
@@ -442,11 +445,12 @@ ACPI_TABLE_GENERATOR SpcrGenerator = { EFI_STATUS
EFIAPI
AcpiSpcrLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&SpcrGenerator);
DEBUG ((DEBUG_INFO, "SPCR: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -465,11 +469,12 @@ AcpiSpcrLibConstructor ( EFI_STATUS
EFIAPI
AcpiSpcrLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&SpcrGenerator);
DEBUG ((DEBUG_INFO, "SPCR: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c index 453ca49fcd..431995ed38 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSratLibArm/SratGenerator.c @@ -97,7 +97,6 @@ GET_OBJECT_LIST ( CM_ARM_DEVICE_HANDLE_PCI
);
-
/** Return the PCI Device information in BDF format
PCI Bus Number - Max 256 busses (Bits 15:8 of BDF)
@@ -111,11 +110,12 @@ GET_OBJECT_LIST ( STATIC
UINT16
GetBdf (
- IN CONST CM_ARM_DEVICE_HANDLE_PCI * DeviceHandlePci
+ IN CONST CM_ARM_DEVICE_HANDLE_PCI *DeviceHandlePci
)
{
- UINT16 Bdf;
- Bdf = (UINT16)DeviceHandlePci->BusNumber << 8;
+ UINT16 Bdf;
+
+ Bdf = (UINT16)DeviceHandlePci->BusNumber << 8;
Bdf |= (DeviceHandlePci->DeviceNumber & 0x1F) << 3;
Bdf |= DeviceHandlePci->FunctionNumber & 0x7;
return Bdf;
@@ -136,35 +136,36 @@ GetBdf ( STATIC
EFI_STATUS
AddGICCAffinity (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST Srat,
IN CONST UINT32 GicCAffOffset,
- IN CONST CM_ARM_GICC_INFO * GicCInfo,
+ IN CONST CM_ARM_GICC_INFO *GicCInfo,
IN UINT32 GicCCount
)
{
- EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE * GicCAff;
+ EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *GicCAff;
ASSERT (Srat != NULL);
ASSERT (GicCInfo != NULL);
- GicCAff = (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *)((UINT8*)Srat +
- GicCAffOffset);
+ GicCAff = (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
+ GicCAffOffset);
while (GicCCount-- != 0) {
DEBUG ((DEBUG_INFO, "SRAT: GicCAff = 0x%p\n", GicCAff));
- GicCAff->Type = EFI_ACPI_6_3_GICC_AFFINITY;
- GicCAff->Length = sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE);
- GicCAff->ProximityDomain = GicCInfo->ProximityDomain;
+ GicCAff->Type = EFI_ACPI_6_3_GICC_AFFINITY;
+ GicCAff->Length = sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE);
+ GicCAff->ProximityDomain = GicCInfo->ProximityDomain;
GicCAff->AcpiProcessorUid = GicCInfo->AcpiProcessorUid;
- GicCAff->Flags = GicCInfo->AffinityFlags;
- GicCAff->ClockDomain = GicCInfo->ClockDomain;
+ GicCAff->Flags = GicCInfo->AffinityFlags;
+ GicCAff->ClockDomain = GicCInfo->ClockDomain;
// Next
GicCAff++;
GicCInfo++;
}// while
+
return EFI_SUCCESS;
}
@@ -183,35 +184,36 @@ AddGICCAffinity ( STATIC
EFI_STATUS
AddGICItsAffinity (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST Srat,
IN CONST UINT32 GicItsAffOffset,
- IN CONST CM_ARM_GIC_ITS_INFO * GicItsInfo,
+ IN CONST CM_ARM_GIC_ITS_INFO *GicItsInfo,
IN UINT32 GicItsCount
)
{
- EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE * GicItsAff;
+ EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *GicItsAff;
ASSERT (Srat != NULL);
ASSERT (GicItsInfo != NULL);
- GicItsAff = (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *)((UINT8*)Srat +
- GicItsAffOffset);
+ GicItsAff = (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
+ GicItsAffOffset);
while (GicItsCount-- != 0) {
DEBUG ((DEBUG_INFO, "SRAT: GicItsAff = 0x%p\n", GicItsAff));
- GicItsAff->Type = EFI_ACPI_6_3_GIC_ITS_AFFINITY;
- GicItsAff->Length = sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE);
+ GicItsAff->Type = EFI_ACPI_6_3_GIC_ITS_AFFINITY;
+ GicItsAff->Length = sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE);
GicItsAff->ProximityDomain = GicItsInfo->ProximityDomain;
- GicItsAff->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
- GicItsAff->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
- GicItsAff->ItsId = GicItsInfo->GicItsId;
+ GicItsAff->Reserved[0] = EFI_ACPI_RESERVED_BYTE;
+ GicItsAff->Reserved[1] = EFI_ACPI_RESERVED_BYTE;
+ GicItsAff->ItsId = GicItsInfo->GicItsId;
// Next
GicItsAff++;
GicItsInfo++;
}// while
+
return EFI_SUCCESS;
}
@@ -230,44 +232,44 @@ AddGICItsAffinity ( STATIC
EFI_STATUS
AddMemoryAffinity (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST Srat,
IN CONST UINT32 MemAffOffset,
- IN CONST CM_ARM_MEMORY_AFFINITY_INFO * MemAffInfo,
+ IN CONST CM_ARM_MEMORY_AFFINITY_INFO *MemAffInfo,
IN UINT32 MemAffCount
)
{
- EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE * MemAff;
+ EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE *MemAff;
ASSERT (Srat != NULL);
ASSERT (MemAffInfo != NULL);
- MemAff = (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE *)((UINT8*)Srat +
- MemAffOffset);
+ MemAff = (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE *)((UINT8 *)Srat +
+ MemAffOffset);
while (MemAffCount-- != 0) {
DEBUG ((DEBUG_INFO, "SRAT: MemAff = 0x%p\n", MemAff));
- MemAff->Type = EFI_ACPI_6_3_MEMORY_AFFINITY;
- MemAff->Length = sizeof (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE);
+ MemAff->Type = EFI_ACPI_6_3_MEMORY_AFFINITY;
+ MemAff->Length = sizeof (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE);
MemAff->ProximityDomain = MemAffInfo->ProximityDomain;
- MemAff->Reserved1 = EFI_ACPI_RESERVED_WORD;
- MemAff->AddressBaseLow = (UINT32)(MemAffInfo->BaseAddress & MAX_UINT32);
+ MemAff->Reserved1 = EFI_ACPI_RESERVED_WORD;
+ MemAff->AddressBaseLow = (UINT32)(MemAffInfo->BaseAddress & MAX_UINT32);
MemAff->AddressBaseHigh = (UINT32)(MemAffInfo->BaseAddress >> 32);
- MemAff->LengthLow = (UINT32)(MemAffInfo->Length & MAX_UINT32);
- MemAff->LengthHigh = (UINT32)(MemAffInfo->Length >> 32);
- MemAff->Reserved2 = EFI_ACPI_RESERVED_DWORD;
- MemAff->Flags = MemAffInfo->Flags;
- MemAff->Reserved3 = EFI_ACPI_RESERVED_QWORD;
+ MemAff->LengthLow = (UINT32)(MemAffInfo->Length & MAX_UINT32);
+ MemAff->LengthHigh = (UINT32)(MemAffInfo->Length >> 32);
+ MemAff->Reserved2 = EFI_ACPI_RESERVED_DWORD;
+ MemAff->Flags = MemAffInfo->Flags;
+ MemAff->Reserved3 = EFI_ACPI_RESERVED_QWORD;
// Next
MemAff++;
MemAffInfo++;
}// while
+
return EFI_SUCCESS;
}
-
/** Add the Generic Initiator Affinity Structures in the SRAT Table.
@param [in] CfgMgrProtocol Pointer to the Configuration Manager
@@ -290,34 +292,34 @@ AddMemoryAffinity ( STATIC
EFI_STATUS
AddGenericInitiatorAffinity (
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * CONST Srat,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ IN EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *CONST Srat,
IN CONST UINT32 GenInitAffOff,
- IN CONST CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO * GenInitAffInfo,
+ IN CONST CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO *GenInitAffInfo,
IN UINT32 GenInitAffCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE * GenInitAff;
- CM_ARM_DEVICE_HANDLE_ACPI * DeviceHandleAcpi;
- CM_ARM_DEVICE_HANDLE_PCI * DeviceHandlePci;
- UINT32 DeviceHandleCount;
+ EFI_STATUS Status;
+ EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE *GenInitAff;
+ CM_ARM_DEVICE_HANDLE_ACPI *DeviceHandleAcpi;
+ CM_ARM_DEVICE_HANDLE_PCI *DeviceHandlePci;
+ UINT32 DeviceHandleCount;
ASSERT (Srat != NULL);
ASSERT (GenInitAffInfo != NULL);
GenInitAff = (EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE *)(
- (UINT8*)Srat + GenInitAffOff);
+ (UINT8 *)Srat + GenInitAffOff);
while (GenInitAffCount-- != 0) {
DEBUG ((DEBUG_INFO, "SRAT: GenInitAff = 0x%p\n", GenInitAff));
- GenInitAff->Type = EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY;
+ GenInitAff->Type = EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY;
GenInitAff->Length =
sizeof (EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE);
- GenInitAff->Reserved1 = EFI_ACPI_RESERVED_WORD;
+ GenInitAff->Reserved1 = EFI_ACPI_RESERVED_WORD;
GenInitAff->DeviceHandleType = GenInitAffInfo->DeviceHandleType;
- GenInitAff->ProximityDomain = GenInitAffInfo->ProximityDomain;
+ GenInitAff->ProximityDomain = GenInitAffInfo->ProximityDomain;
if (GenInitAffInfo->DeviceHandleToken == CM_NULL_TOKEN) {
DEBUG ((
@@ -351,14 +353,15 @@ AddGenericInitiatorAffinity ( ASSERT (DeviceHandleCount == 1);
// Populate the ACPI device handle information.
- GenInitAff->DeviceHandle.Acpi.AcpiHid = DeviceHandleAcpi->Hid;
- GenInitAff->DeviceHandle.Acpi.AcpiUid = DeviceHandleAcpi->Uid;
+ GenInitAff->DeviceHandle.Acpi.AcpiHid = DeviceHandleAcpi->Hid;
+ GenInitAff->DeviceHandle.Acpi.AcpiUid = DeviceHandleAcpi->Uid;
GenInitAff->DeviceHandle.Acpi.Reserved[0] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->DeviceHandle.Acpi.Reserved[1] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->DeviceHandle.Acpi.Reserved[2] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->DeviceHandle.Acpi.Reserved[3] = EFI_ACPI_RESERVED_BYTE;
} else if (GenInitAffInfo->DeviceHandleType ==
- EFI_ACPI_6_3_PCI_DEVICE_HANDLE) {
+ EFI_ACPI_6_3_PCI_DEVICE_HANDLE)
+ {
Status = GetEArmObjDeviceHandlePci (
CfgMgrProtocol,
GenInitAffInfo->DeviceHandleToken,
@@ -381,19 +384,19 @@ AddGenericInitiatorAffinity ( ASSERT (DeviceHandleCount == 1);
// Populate the ACPI device handle information.
- GenInitAff->DeviceHandle.Pci.PciSegment = DeviceHandlePci->SegmentNumber;
+ GenInitAff->DeviceHandle.Pci.PciSegment = DeviceHandlePci->SegmentNumber;
GenInitAff->DeviceHandle.Pci.PciBdfNumber = GetBdf (DeviceHandlePci);
- GenInitAff->DeviceHandle.Pci.Reserved[0] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[1] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[2] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[3] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[4] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[5] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[6] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[7] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[8] = EFI_ACPI_RESERVED_BYTE;
- GenInitAff->DeviceHandle.Pci.Reserved[9] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[0] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[1] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[2] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[3] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[4] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[5] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[6] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[7] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[8] = EFI_ACPI_RESERVED_BYTE;
+ GenInitAff->DeviceHandle.Pci.Reserved[9] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->DeviceHandle.Pci.Reserved[10] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->DeviceHandle.Pci.Reserved[11] = EFI_ACPI_RESERVED_BYTE;
} else {
@@ -405,7 +408,7 @@ AddGenericInitiatorAffinity ( return EFI_INVALID_PARAMETER;
}
- GenInitAff->Flags = GenInitAffInfo->Flags;
+ GenInitAff->Flags = GenInitAffInfo->Flags;
GenInitAff->Reserved2[0] = EFI_ACPI_RESERVED_BYTE;
GenInitAff->Reserved2[1] = EFI_ACPI_RESERVED_BYTE;
@@ -413,6 +416,7 @@ AddGenericInitiatorAffinity ( GenInitAff++;
GenInitAffInfo++;
}// while
+
return EFI_SUCCESS;
}
@@ -443,10 +447,10 @@ STATIC EFI_STATUS
EFIAPI
BuildSratTable (
- 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
+ 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
)
{
EFI_STATUS Status;
@@ -456,17 +460,17 @@ BuildSratTable ( UINT32 MemAffCount;
UINT32 GenInitiatorAffCount;
- UINT32 GicCAffOffset;
- UINT32 GicItsAffOffset;
- UINT32 MemAffOffset;
- UINT32 GenInitiatorAffOffset;
+ UINT32 GicCAffOffset;
+ UINT32 GicItsAffOffset;
+ UINT32 MemAffOffset;
+ UINT32 GenInitiatorAffOffset;
- CM_ARM_GICC_INFO * GicCInfo;
- CM_ARM_GIC_ITS_INFO * GicItsInfo;
- CM_ARM_MEMORY_AFFINITY_INFO * MemAffInfo;
- CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO * GenInitiatorAffInfo;
+ CM_ARM_GICC_INFO *GicCInfo;
+ CM_ARM_GIC_ITS_INFO *GicItsInfo;
+ CM_ARM_MEMORY_AFFINITY_INFO *MemAffInfo;
+ CM_ARM_GENERIC_INITIATOR_AFFINITY_INFO *GenInitiatorAffInfo;
- EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER * Srat;
+ EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *Srat;
ASSERT (
(This != NULL) &&
@@ -478,7 +482,8 @@ BuildSratTable ( );
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
- (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision)) {
+ (AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SRAT: Requested table revision = %d is not supported. "
@@ -567,28 +572,28 @@ BuildSratTable ( TableSize = sizeof (EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER);
GicCAffOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE) * GicCCount);
+ TableSize += (sizeof (EFI_ACPI_6_3_GICC_AFFINITY_STRUCTURE) * GicCCount);
if (GicItsCount != 0) {
GicItsAffOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE) *
- GicItsCount);
+ TableSize += (sizeof (EFI_ACPI_6_3_GIC_ITS_AFFINITY_STRUCTURE) *
+ GicItsCount);
}
if (MemAffCount != 0) {
MemAffOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE) *
+ TableSize += (sizeof (EFI_ACPI_6_3_MEMORY_AFFINITY_STRUCTURE) *
MemAffCount);
}
if (GenInitiatorAffCount != 0) {
GenInitiatorAffOffset = TableSize;
- TableSize += (sizeof (EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE) *
- GenInitiatorAffCount);
+ TableSize += (sizeof (EFI_ACPI_6_3_GENERIC_INITIATOR_AFFINITY_STRUCTURE) *
+ GenInitiatorAffCount);
}
// Allocate the Buffer for SRAT table
- *Table = (EFI_ACPI_DESCRIPTION_HEADER*)AllocateZeroPool (TableSize);
+ *Table = (EFI_ACPI_DESCRIPTION_HEADER *)AllocateZeroPool (TableSize);
if (*Table == NULL) {
Status = EFI_OUT_OF_RESOURCES;
DEBUG ((
@@ -601,7 +606,7 @@ BuildSratTable ( goto error_handler;
}
- Srat = (EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER*)*Table;
+ Srat = (EFI_ACPI_6_3_SYSTEM_RESOURCE_AFFINITY_TABLE_HEADER *)*Table;
DEBUG ((
DEBUG_INFO,
@@ -649,12 +654,12 @@ BuildSratTable ( if (GicItsCount != 0) {
Status = AddGICItsAffinity (
- CfgMgrProtocol,
- Srat,
- GicItsAffOffset,
- GicItsInfo,
- GicItsCount
- );
+ CfgMgrProtocol,
+ Srat,
+ GicItsAffOffset,
+ GicItsInfo,
+ GicItsCount
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -667,12 +672,12 @@ BuildSratTable ( if (MemAffCount != 0) {
Status = AddMemoryAffinity (
- CfgMgrProtocol,
- Srat,
- MemAffOffset,
- MemAffInfo,
- MemAffCount
- );
+ CfgMgrProtocol,
+ Srat,
+ MemAffOffset,
+ MemAffInfo,
+ MemAffCount
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -685,12 +690,12 @@ BuildSratTable ( if (GenInitiatorAffCount != 0) {
Status = AddGenericInitiatorAffinity (
- CfgMgrProtocol,
- Srat,
- GenInitiatorAffOffset,
- GenInitiatorAffInfo,
- GenInitiatorAffCount
- );
+ CfgMgrProtocol,
+ Srat,
+ GenInitiatorAffOffset,
+ GenInitiatorAffInfo,
+ GenInitiatorAffCount
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -728,10 +733,10 @@ error_handler: STATIC
EFI_STATUS
FreeSratTableResources (
- 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
+ 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
)
{
ASSERT (
@@ -755,13 +760,13 @@ FreeSratTableResources ( /** The SRAT Table Generator revision.
*/
-#define SRAT_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define SRAT_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the SRAT Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR SratGenerator = {
+ACPI_TABLE_GENERATOR SratGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSrat),
// Generator Description
@@ -800,11 +805,12 @@ ACPI_TABLE_GENERATOR SratGenerator = { EFI_STATUS
EFIAPI
AcpiSratLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&SratGenerator);
DEBUG ((DEBUG_INFO, "SRAT: Register Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
@@ -823,11 +829,12 @@ AcpiSratLibConstructor ( EFI_STATUS
EFIAPI
AcpiSratLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&SratGenerator);
DEBUG ((DEBUG_INFO, "SRAT: Deregister Generator. Status = %r\n", Status));
ASSERT_EFI_ERROR (Status);
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c index 359cbcd428..18c8b8d245 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.c @@ -61,17 +61,18 @@ STATIC EFI_STATUS
EFIAPI
ValidateCmn600Info (
- IN CONST CM_ARM_CMN_600_INFO * Cmn600InfoList,
- IN CONST UINT32 Cmn600Count
+ IN CONST CM_ARM_CMN_600_INFO *Cmn600InfoList,
+ IN CONST UINT32 Cmn600Count
)
{
- UINT32 Index;
- UINT32 DtcIndex;
- CONST CM_ARM_CMN_600_INFO * Cmn600Info;
- CONST CM_ARM_GENERIC_INTERRUPT * DtcInterrupt;
+ UINT32 Index;
+ UINT32 DtcIndex;
+ CONST CM_ARM_CMN_600_INFO *Cmn600Info;
+ CONST CM_ARM_GENERIC_INTERRUPT *DtcInterrupt;
if ((Cmn600InfoList == NULL) ||
- (Cmn600Count == 0)) {
+ (Cmn600Count == 0))
+ {
return EFI_INVALID_PARAMETER;
}
@@ -81,7 +82,8 @@ ValidateCmn600Info ( // At least one DTC is required.
if ((Cmn600Info->DtcCount == 0) ||
- (Cmn600Info->DtcCount > MAX_DTC_COUNT)) {
+ (Cmn600Info->DtcCount > MAX_DTC_COUNT))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CMN-600: Invalid DTC configuration:\n"
@@ -91,7 +93,8 @@ ValidateCmn600Info ( // Check PERIPHBASE and ROOTNODEBASE address spaces are initialized.
if ((Cmn600Info->PeriphBaseAddress == 0) ||
- (Cmn600Info->RootNodeBaseAddress == 0)) {
+ (Cmn600Info->RootNodeBaseAddress == 0))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CMN-600: Invalid PERIPHBASE or ROOTNODEBASE.\n"
@@ -103,7 +106,8 @@ ValidateCmn600Info ( // dimension mesh, and 256MB aligned otherwise.
// Check it is a least 64MB aligned.
if ((Cmn600Info->PeriphBaseAddress &
- (PERIPHBASE_MIN_ADDRESS_LENGTH - 1)) != 0) {
+ (PERIPHBASE_MIN_ADDRESS_LENGTH - 1)) != 0)
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CMN-600: PERIPHBASE address must be 64MB aligned.\n"
@@ -123,7 +127,8 @@ ValidateCmn600Info ( // Check the 16 KB alignment of the ROOTNODEBASE address.
if ((Cmn600Info->PeriphBaseAddress &
- (ROOTNODEBASE_ADDRESS_LENGTH - 1)) != 0) {
+ (ROOTNODEBASE_ADDRESS_LENGTH - 1)) != 0)
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CMN-600: Root base address must be 16KB aligned.\n"
@@ -135,7 +140,8 @@ ValidateCmn600Info ( // address space.
if ((Cmn600Info->PeriphBaseAddress > Cmn600Info->RootNodeBaseAddress) ||
((Cmn600Info->PeriphBaseAddress + Cmn600Info->PeriphBaseAddressLength) <
- (Cmn600Info->RootNodeBaseAddress + ROOTNODEBASE_ADDRESS_LENGTH))) {
+ (Cmn600Info->RootNodeBaseAddress + ROOTNODEBASE_ADDRESS_LENGTH)))
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CMN-600:"
@@ -147,16 +153,16 @@ ValidateCmn600Info ( for (DtcIndex = 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) {
DtcInterrupt = &Cmn600Info->DtcInterrupt[DtcIndex];
if (((DtcInterrupt->Flags &
- EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) == 0)) {
+ EFI_ACPI_EXTENDED_INTERRUPT_FLAG_PRODUCER_CONSUMER_MASK) == 0))
+ {
DEBUG ((
- DEBUG_ERROR,
- "ERROR: SSDT-CMN-600: DTC Interrupt must be consumer.\n"
- ));
+ DEBUG_ERROR,
+ "ERROR: SSDT-CMN-600: DTC Interrupt must be consumer.\n"
+ ));
goto error_handler;
}
} // for DTC Interrupt
-
- } //for Cmn600InfoList
+ } // for Cmn600InfoList
return EFI_SUCCESS;
@@ -174,26 +180,27 @@ error_handler: Cmn600Info->DtcCount
));
- DEBUG_CODE_BEGIN ();
- for (DtcIndex = 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) {
- DtcInterrupt = &Cmn600Info->DtcInterrupt[DtcIndex];
- DEBUG ((
- DEBUG_ERROR,
- " DTC[%d]:\n",
- DtcIndex
- ));
- DEBUG ((
- DEBUG_ERROR,
- " Interrupt = 0x%lx\n",
- DtcInterrupt->Interrupt
- ));
- DEBUG ((
- DEBUG_ERROR,
- " Flags = 0x%lx\n",
- DtcInterrupt->Flags
- ));
- } // for
- DEBUG_CODE_END ();
+ DEBUG_CODE_BEGIN ();
+ for (DtcIndex = 0; DtcIndex < Cmn600Info->DtcCount; DtcIndex++) {
+ DtcInterrupt = &Cmn600Info->DtcInterrupt[DtcIndex];
+ DEBUG ((
+ DEBUG_ERROR,
+ " DTC[%d]:\n",
+ DtcIndex
+ ));
+ DEBUG ((
+ DEBUG_ERROR,
+ " Interrupt = 0x%lx\n",
+ DtcInterrupt->Interrupt
+ ));
+ DEBUG ((
+ DEBUG_ERROR,
+ " Flags = 0x%lx\n",
+ DtcInterrupt->Flags
+ ));
+ } // for
+
+ DEBUG_CODE_END ();
return EFI_INVALID_PARAMETER;
}
@@ -218,34 +225,34 @@ STATIC EFI_STATUS
EFIAPI
FixupCmn600Info (
- IN CONST CM_ARM_CMN_600_INFO * Cmn600Info,
- IN CONST CHAR8 * Name,
- IN CONST UINT64 Uid,
- OUT EFI_ACPI_DESCRIPTION_HEADER ** Table
+ IN CONST CM_ARM_CMN_600_INFO *Cmn600Info,
+ IN CONST CHAR8 *Name,
+ IN CONST UINT64 Uid,
+ OUT EFI_ACPI_DESCRIPTION_HEADER **Table
)
{
- EFI_STATUS Status;
- EFI_STATUS Status1;
- UINT8 Index;
- CONST CM_ARM_GENERIC_INTERRUPT * DtcInt;
-
- EFI_ACPI_DESCRIPTION_HEADER * SsdtCmn600Template;
- AML_ROOT_NODE_HANDLE RootNodeHandle;
- AML_OBJECT_NODE_HANDLE NameOpIdNode;
- AML_OBJECT_NODE_HANDLE NameOpCrsNode;
- AML_DATA_NODE_HANDLE CmnPeriphBaseRdNode;
- AML_DATA_NODE_HANDLE CmnRootNodeBaseRdNode;
- AML_OBJECT_NODE_HANDLE DeviceNode;
+ EFI_STATUS Status;
+ EFI_STATUS Status1;
+ UINT8 Index;
+ CONST CM_ARM_GENERIC_INTERRUPT *DtcInt;
+
+ EFI_ACPI_DESCRIPTION_HEADER *SsdtCmn600Template;
+ AML_ROOT_NODE_HANDLE RootNodeHandle;
+ AML_OBJECT_NODE_HANDLE NameOpIdNode;
+ AML_OBJECT_NODE_HANDLE NameOpCrsNode;
+ AML_DATA_NODE_HANDLE CmnPeriphBaseRdNode;
+ AML_DATA_NODE_HANDLE CmnRootNodeBaseRdNode;
+ AML_OBJECT_NODE_HANDLE DeviceNode;
// Parse the Ssdt CMN-600 Template.
- SsdtCmn600Template = (EFI_ACPI_DESCRIPTION_HEADER*)
- ssdtcmn600template_aml_code;
+ SsdtCmn600Template = (EFI_ACPI_DESCRIPTION_HEADER *)
+ ssdtcmn600template_aml_code;
RootNodeHandle = NULL;
- Status = AmlParseDefinitionBlock (
- SsdtCmn600Template,
- &RootNodeHandle
- );
+ Status = AmlParseDefinitionBlock (
+ SsdtCmn600Template,
+ &RootNodeHandle
+ );
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
@@ -346,7 +353,7 @@ FixupCmn600Info ( EFI_ACPI_EXTENDED_INTERRUPT_FLAG_POLARITY_MASK) != 0),
((DtcInt->Flags &
EFI_ACPI_EXTENDED_INTERRUPT_FLAG_SHARABLE_MASK) != 0),
- (UINT32*)&DtcInt->Interrupt,
+ (UINT32 *)&DtcInt->Interrupt,
1,
NameOpCrsNode,
NULL
@@ -365,7 +372,7 @@ FixupCmn600Info ( }
// Update the CMN600 Device's name.
- Status = AmlDeviceOpUpdateName (DeviceNode, (CHAR8*)Name);
+ Status = AmlDeviceOpUpdateName (DeviceNode, (CHAR8 *)Name);
if (EFI_ERROR (Status)) {
goto error_handler;
}
@@ -423,15 +430,15 @@ STATIC EFI_STATUS
EFIAPI
FreeSsdtCmn600TableResourcesEx (
- 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,
+ 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,
IN CONST UINTN TableCount
)
{
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
- UINTN Index;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
+ UINTN Index;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -441,7 +448,8 @@ FreeSsdtCmn600TableResourcesEx ( if ((Table == NULL) ||
(*Table == NULL) ||
- (TableCount == 0)) {
+ (TableCount == 0))
+ {
DEBUG ((DEBUG_ERROR, "ERROR: SSDT-CMN-600: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER;
}
@@ -451,7 +459,8 @@ FreeSsdtCmn600TableResourcesEx ( for (Index = 0; Index < TableCount; Index++) {
if ((TableList[Index] != NULL) &&
(TableList[Index]->Signature ==
- EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) {
+ EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
+ {
FreePool (TableList[Index]);
} else {
DEBUG ((
@@ -463,7 +472,7 @@ FreeSsdtCmn600TableResourcesEx ( ));
return EFI_INVALID_PARAMETER;
}
- } //for
+ } // for
// Free the table list.
FreePool (*Table);
@@ -500,19 +509,19 @@ STATIC EFI_STATUS
EFIAPI
BuildSsdtCmn600TableEx (
- IN CONST ACPI_TABLE_GENERATOR * This,
- IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- OUT EFI_ACPI_DESCRIPTION_HEADER *** Table,
- OUT UINTN * CONST TableCount
+ IN CONST ACPI_TABLE_GENERATOR *This,
+ IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ OUT EFI_ACPI_DESCRIPTION_HEADER ***Table,
+ OUT UINTN *CONST TableCount
)
{
- EFI_STATUS Status;
- UINT64 Index;
- CM_ARM_CMN_600_INFO * Cmn600Info;
- UINT32 Cmn600Count;
- CHAR8 NewName[AML_NAME_SEG_SIZE + 1];
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
+ EFI_STATUS Status;
+ UINT64 Index;
+ CM_ARM_CMN_600_INFO *Cmn600Info;
+ UINT32 Cmn600Count;
+ CHAR8 NewName[AML_NAME_SEG_SIZE + 1];
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -563,9 +572,9 @@ BuildSsdtCmn600TableEx ( }
// Allocate a table to store pointers to the SSDT tables.
- TableList = (EFI_ACPI_DESCRIPTION_HEADER**)
+ TableList = (EFI_ACPI_DESCRIPTION_HEADER **)
AllocateZeroPool (
- (sizeof (EFI_ACPI_DESCRIPTION_HEADER*) * Cmn600Count)
+ (sizeof (EFI_ACPI_DESCRIPTION_HEADER *) * Cmn600Count)
);
if (TableList == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -619,13 +628,13 @@ BuildSsdtCmn600TableEx ( /** This macro defines the Raw Generator revision.
*/
-#define SSDT_CMN_600_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define SSDT_CMN_600_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the Raw Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR SsdtCmn600Generator = {
+ACPI_TABLE_GENERATOR SsdtCmn600Generator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdtCmn600),
// Generator Description
@@ -663,8 +672,8 @@ ACPI_TABLE_GENERATOR SsdtCmn600Generator = { EFI_STATUS
EFIAPI
AcpiSsdtCmn600LibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
@@ -691,8 +700,8 @@ AcpiSsdtCmn600LibConstructor ( EFI_STATUS
EFIAPI
AcpiSsdtCmn600LibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.h index ab03b72236..08b4053818 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCmn600LibArm/SsdtCmn600Generator.h @@ -20,24 +20,24 @@ /** PeriphBase maximum address length is 256MB (0x10000000)
for a (X >= 4) || (Y >= 4) dimensions mesh.
*/
-#define PERIPHBASE_MAX_ADDRESS_LENGTH SIZE_256MB
+#define PERIPHBASE_MAX_ADDRESS_LENGTH SIZE_256MB
/** PeriphBase minimum address length is 64MB (0x04000000)
for a (X < 4) && (Y < 4) dimensions mesh.
*/
-#define PERIPHBASE_MIN_ADDRESS_LENGTH SIZE_64MB
+#define PERIPHBASE_MIN_ADDRESS_LENGTH SIZE_64MB
/** RootNodeBase address length is 16KB (0x00004000).
*/
-#define ROOTNODEBASE_ADDRESS_LENGTH SIZE_16KB
+#define ROOTNODEBASE_ADDRESS_LENGTH SIZE_16KB
/** Maximum number of CMN-600 Debug and Trace Logic Controllers (DTC).
*/
-#define MAX_DTC_COUNT 4
+#define MAX_DTC_COUNT 4
/** Starting value for the UID to represent the CMN600 devices.
*/
-#define CMN600_DEVICE_START_UID 0
+#define CMN600_DEVICE_START_UID 0
/** Maximum CMN-600 devices supported by this generator.
This generator supports a maximum of 16 CMN-600 devices.
@@ -46,6 +46,6 @@ UID fields describing the serial port.
*/
-#define MAX_CMN600_DEVICES_SUPPORTED 16
+#define MAX_CMN600_DEVICES_SUPPORTED 16
#endif // SSDT_CMN600_GENERATOR_H_
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c index 3f6cef3ba5..3266d8dd98 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.c @@ -96,15 +96,16 @@ STATIC EFI_STATUS
EFIAPI
TokenTableInitialize (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN UINT32 Count
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN UINT32 Count
)
{
- CM_OBJECT_TOKEN * Table;
+ CM_OBJECT_TOKEN *Table;
if ((Generator == NULL) ||
(Count == 0) ||
- (Count >= MAX_NODE_COUNT)) {
+ (Count >= MAX_NODE_COUNT))
+ {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
@@ -128,7 +129,7 @@ STATIC VOID
EFIAPI
TokenTableFree (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator
)
{
ASSERT (Generator != NULL);
@@ -153,18 +154,18 @@ STATIC UINT32
EFIAPI
TokenTableAdd (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CM_OBJECT_TOKEN Token
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CM_OBJECT_TOKEN Token
)
{
- CM_OBJECT_TOKEN * Table;
- UINT32 Index;
- UINT32 LastIndex;
+ CM_OBJECT_TOKEN *Table;
+ UINT32 Index;
+ UINT32 LastIndex;
ASSERT (Generator != NULL);
ASSERT (Generator->TokenTable.Table != NULL);
- Table = Generator->TokenTable.Table;
+ Table = Generator->TokenTable.Table;
LastIndex = Generator->TokenTable.LastIndex;
// Search if there is already an entry with this Token.
@@ -203,20 +204,21 @@ STATIC EFI_STATUS
EFIAPI
WriteAslName (
- IN CHAR8 LeadChar,
- IN UINT32 Value,
- IN OUT CHAR8 * AslName
+ IN CHAR8 LeadChar,
+ IN UINT32 Value,
+ IN OUT CHAR8 *AslName
)
{
- UINT8 Index;
+ UINT8 Index;
if ((Value >= MAX_NODE_COUNT) ||
- (AslName == NULL)) {
+ (AslName == NULL))
+ {
ASSERT (0);
return EFI_INVALID_PARAMETER;
}
- AslName[0] = LeadChar;
+ AslName[0] = LeadChar;
AslName[AML_NAME_SEG_SIZE] = '\0';
for (Index = 0; Index < AML_NAME_SEG_SIZE - 1; Index++) {
@@ -262,14 +264,14 @@ STATIC EFI_STATUS
EFIAPI
CreateAmlLpiMethod (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CM_ARM_PROC_HIERARCHY_INFO * ProcHierarchyNodeInfo,
- IN AML_OBJECT_NODE_HANDLE * Node
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo,
+ IN AML_OBJECT_NODE_HANDLE *Node
)
{
- EFI_STATUS Status;
- UINT32 TokenIndex;
- CHAR8 AslName[SB_SCOPE_PREFIX_SIZE + AML_NAME_SEG_SIZE];
+ EFI_STATUS Status;
+ UINT32 TokenIndex;
+ CHAR8 AslName[SB_SCOPE_PREFIX_SIZE + AML_NAME_SEG_SIZE];
ASSERT (Generator != NULL);
ASSERT (ProcHierarchyNodeInfo != NULL);
@@ -349,22 +351,22 @@ STATIC EFI_STATUS
EFIAPI
GenerateLpiStates (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN AML_OBJECT_NODE_HANDLE ScopeNode
)
{
- EFI_STATUS Status;
+ EFI_STATUS Status;
- UINT32 Index;
- UINT32 LastIndex;
+ UINT32 Index;
+ UINT32 LastIndex;
- AML_OBJECT_NODE_HANDLE LpiNode;
- CM_ARM_OBJ_REF * LpiRefInfo;
- UINT32 LpiRefInfoCount;
- UINT32 LpiRefIndex;
- CM_ARM_LPI_INFO * LpiInfo;
- CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
+ AML_OBJECT_NODE_HANDLE LpiNode;
+ CM_ARM_OBJ_REF *LpiRefInfo;
+ UINT32 LpiRefInfoCount;
+ UINT32 LpiRefIndex;
+ CM_ARM_LPI_INFO *LpiInfo;
+ CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
ASSERT (Generator != NULL);
ASSERT (Generator->TokenTable.Table != NULL);
@@ -422,11 +424,11 @@ GenerateLpiStates ( LpiInfo->ResCntFreq,
LpiInfo->EnableParentState,
LpiInfo->IsInteger ?
- NULL :
- &LpiInfo->RegisterEntryMethod,
+ NULL :
+ &LpiInfo->RegisterEntryMethod,
LpiInfo->IsInteger ?
- LpiInfo->IntegerEntryMethod :
- 0,
+ LpiInfo->IntegerEntryMethod :
+ 0,
&LpiInfo->ResidencyCounterRegister,
&LpiInfo->UsageCounterRegister,
LpiInfo->StateName,
@@ -465,16 +467,16 @@ STATIC EFI_STATUS
EFIAPI
CreateAmlCpu (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN AML_NODE_HANDLE ParentNode,
- IN CM_ARM_GICC_INFO * GicCInfo,
- IN UINT32 CpuIndex,
- OUT AML_OBJECT_NODE_HANDLE * CpuNodePtr OPTIONAL
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN AML_NODE_HANDLE ParentNode,
+ IN CM_ARM_GICC_INFO *GicCInfo,
+ IN UINT32 CpuIndex,
+ OUT AML_OBJECT_NODE_HANDLE *CpuNodePtr OPTIONAL
)
{
- EFI_STATUS Status;
- AML_OBJECT_NODE_HANDLE CpuNode;
- CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
+ EFI_STATUS Status;
+ AML_OBJECT_NODE_HANDLE CpuNode;
+ CHAR8 AslName[AML_NAME_SEG_SIZE + 1];
ASSERT (Generator != NULL);
ASSERT (ParentNode != NULL);
@@ -541,16 +543,16 @@ STATIC EFI_STATUS
EFIAPI
CreateAmlCpuFromProcHierarchy (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN AML_NODE_HANDLE ParentNode,
IN UINT32 CpuIndex,
- IN CM_ARM_PROC_HIERARCHY_INFO * ProcHierarchyNodeInfo
+ IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo
)
{
- EFI_STATUS Status;
- CM_ARM_GICC_INFO * GicCInfo;
- AML_OBJECT_NODE_HANDLE CpuNode;
+ EFI_STATUS Status;
+ CM_ARM_GICC_INFO *GicCInfo;
+ AML_OBJECT_NODE_HANDLE CpuNode;
ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -619,17 +621,17 @@ STATIC EFI_STATUS
EFIAPI
CreateAmlCluster (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN AML_NODE_HANDLE ParentNode,
- IN CM_ARM_PROC_HIERARCHY_INFO * ProcHierarchyNodeInfo,
+ IN CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeInfo,
IN UINT32 ClusterIndex,
- OUT AML_OBJECT_NODE_HANDLE * ClusterNodePtr
+ OUT AML_OBJECT_NODE_HANDLE *ClusterNodePtr
)
{
- EFI_STATUS Status;
- AML_OBJECT_NODE_HANDLE ClusterNode;
- CHAR8 AslNameCluster[AML_NAME_SEG_SIZE + 1];
+ EFI_STATUS Status;
+ AML_OBJECT_NODE_HANDLE ClusterNode;
+ CHAR8 AslNameCluster[AML_NAME_SEG_SIZE + 1];
ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -713,8 +715,8 @@ STATIC EFI_STATUS
EFIAPI
CreateAmlCpuTopologyTree (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN CM_OBJECT_TOKEN NodeToken,
IN AML_NODE_HANDLE ParentNode
)
@@ -732,19 +734,19 @@ CreateAmlCpuTopologyTree ( ASSERT (NodeToken != CM_NULL_TOKEN);
ASSERT (ParentNode != NULL);
- CpuIndex = 0;
+ CpuIndex = 0;
ClusterIndex = 0;
for (Index = 0; Index < Generator->ProcNodeCount; Index++) {
// Find the children of the CM_ARM_PROC_HIERARCHY_INFO
// currently being handled (i.e. ParentToken == NodeToken).
if (Generator->ProcNodeList[Index].ParentToken == NodeToken) {
-
// Only Cpus (leaf nodes in this tree) have a GicCToken.
// Create a Cpu node.
if (Generator->ProcNodeList[Index].GicCToken != CM_NULL_TOKEN) {
if ((Generator->ProcNodeList[Index].Flags & PPTT_PROCESSOR_MASK) !=
- PPTT_CPU_PROCESSOR_MASK) {
+ PPTT_CPU_PROCESSOR_MASK)
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for cpu: 0x%x.\n",
@@ -767,13 +769,13 @@ CreateAmlCpuTopologyTree ( }
CpuIndex++;
-
} else {
// If this is not a Cpu, then this is a cluster.
// Acpi processor Id for clusters is not handled.
if ((Generator->ProcNodeList[Index].Flags & PPTT_PROCESSOR_MASK) !=
- PPTT_CLUSTER_PROCESSOR_MASK) {
+ PPTT_CLUSTER_PROCESSOR_MASK)
+ {
DEBUG ((
DEBUG_ERROR,
"ERROR: SSDT-CPU-TOPOLOGY: Invalid flags for cluster: 0x%x.\n",
@@ -835,8 +837,8 @@ STATIC EFI_STATUS
EFIAPI
CreateTopologyFromProcHierarchy (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN AML_OBJECT_NODE_HANDLE ScopeNode
)
{
@@ -865,7 +867,8 @@ CreateTopologyFromProcHierarchy ( for (Index = 0; Index < Generator->ProcNodeCount; Index++) {
if ((Generator->ProcNodeList[Index].ParentToken == CM_NULL_TOKEN) &&
(Generator->ProcNodeList[Index].Flags &
- EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL)) {
+ EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL))
+ {
if (TopLevelProcNodeIndex != MAX_UINT32) {
DEBUG ((
DEBUG_ERROR,
@@ -875,6 +878,7 @@ CreateTopologyFromProcHierarchy ( ASSERT (0);
goto exit_handler;
}
+
TopLevelProcNodeIndex = Index;
}
} // for
@@ -919,15 +923,15 @@ STATIC EFI_STATUS
EFIAPI
CreateTopologyFromGicC (
- IN ACPI_CPU_TOPOLOGY_GENERATOR * Generator,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
+ IN ACPI_CPU_TOPOLOGY_GENERATOR *Generator,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
IN AML_OBJECT_NODE_HANDLE ScopeNode
)
{
- EFI_STATUS Status;
- CM_ARM_GICC_INFO * GicCInfo;
- UINT32 GicCInfoCount;
- UINT32 Index;
+ EFI_STATUS Status;
+ CM_ARM_GICC_INFO *GicCInfo;
+ UINT32 GicCInfoCount;
+ UINT32 Index;
ASSERT (Generator != NULL);
ASSERT (CfgMgrProtocol != NULL);
@@ -988,18 +992,18 @@ 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
+ 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
)
{
- EFI_STATUS Status;
- AML_ROOT_NODE_HANDLE RootNode;
- AML_OBJECT_NODE_HANDLE ScopeNode;
- CM_ARM_PROC_HIERARCHY_INFO * ProcHierarchyNodeList;
- UINT32 ProcHierarchyNodeCount;
- ACPI_CPU_TOPOLOGY_GENERATOR * Generator;
+ EFI_STATUS Status;
+ AML_ROOT_NODE_HANDLE RootNode;
+ AML_OBJECT_NODE_HANDLE ScopeNode;
+ CM_ARM_PROC_HIERARCHY_INFO *ProcHierarchyNodeList;
+ UINT32 ProcHierarchyNodeCount;
+ ACPI_CPU_TOPOLOGY_GENERATOR *Generator;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -1008,7 +1012,7 @@ BuildSsdtCpuTopologyTable ( ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
- Generator = (ACPI_CPU_TOPOLOGY_GENERATOR*)This;
+ Generator = (ACPI_CPU_TOPOLOGY_GENERATOR *)This;
Status = AddSsdtAcpiHeader (
CfgMgrProtocol,
@@ -1034,7 +1038,8 @@ BuildSsdtCpuTopologyTable ( &ProcHierarchyNodeCount
);
if (EFI_ERROR (Status) &&
- (Status != EFI_NOT_FOUND)) {
+ (Status != EFI_NOT_FOUND))
+ {
goto exit_handler;
}
@@ -1051,7 +1056,7 @@ BuildSsdtCpuTopologyTable ( }
} else {
// Generate the topology from CM_ARM_PROC_HIERARCHY_INFO objects.
- Generator->ProcNodeList = ProcHierarchyNodeList;
+ Generator->ProcNodeList = ProcHierarchyNodeList;
Generator->ProcNodeCount = ProcHierarchyNodeCount;
Status = CreateTopologyFromProcHierarchy (
@@ -1098,10 +1103,10 @@ exit_handler: STATIC
EFI_STATUS
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
+ 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
)
{
ASSERT (This != NULL);
@@ -1123,12 +1128,12 @@ FreeSsdtCpuTopologyTableResources ( /** This macro defines the SSDT Cpu Topology Table Generator revision.
*/
-#define SSDT_CPU_TOPOLOGY_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define SSDT_CPU_TOPOLOGY_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the SSDT Cpu Topology Table Generator.
*/
STATIC
-ACPI_CPU_TOPOLOGY_GENERATOR SsdtCpuTopologyGenerator = {
+ACPI_CPU_TOPOLOGY_GENERATOR SsdtCpuTopologyGenerator = {
// ACPI table generator header
{
// Generator ID
@@ -1160,10 +1165,10 @@ ACPI_CPU_TOPOLOGY_GENERATOR SsdtCpuTopologyGenerator = { // TokenTable
{
- // Table
- NULL,
- // LastIndex
- 0
+ // Table
+ NULL,
+ // LastIndex
+ 0
},
// ProcNodeList
NULL,
@@ -1184,11 +1189,12 @@ ACPI_CPU_TOPOLOGY_GENERATOR SsdtCpuTopologyGenerator = { EFI_STATUS
EFIAPI
AcpiSsdtCpuTopologyLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&SsdtCpuTopologyGenerator.Header);
DEBUG ((
DEBUG_INFO,
@@ -1212,11 +1218,12 @@ AcpiSsdtCpuTopologyLibConstructor ( EFI_STATUS
EFIAPI
AcpiSsdtCpuTopologyLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&SsdtCpuTopologyGenerator.Header);
DEBUG ((
DEBUG_INFO,
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h index f6e8a754af..f174d9c2e2 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtCpuTopologyLibArm/SsdtCpuTopologyGenerator.h @@ -14,13 +14,13 @@ #pragma pack(1)
// Mask for the flags that need to be checked.
-#define PPTT_PROCESSOR_MASK ( \
+#define PPTT_PROCESSOR_MASK ( \
(EFI_ACPI_6_3_PPTT_PACKAGE_PHYSICAL) | \
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
// Mask for the cpu flags.
-#define PPTT_CPU_PROCESSOR_MASK ( \
+#define PPTT_CPU_PROCESSOR_MASK ( \
(EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL) | \
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_VALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_LEAF << 3))
@@ -29,7 +29,7 @@ // Even though a _UID is generated for clusters, it is simpler to use
// EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID and to not match the cluster id of
// the PPTT table (not sure the PPTT table is generated).
-#define PPTT_CLUSTER_PROCESSOR_MASK ( \
+#define PPTT_CLUSTER_PROCESSOR_MASK ( \
(EFI_ACPI_6_3_PPTT_PACKAGE_NOT_PHYSICAL) | \
(EFI_ACPI_6_3_PPTT_PROCESSOR_ID_INVALID << 1) | \
(EFI_ACPI_6_3_PPTT_NODE_IS_NOT_LEAF << 3))
@@ -37,22 +37,22 @@ /** LPI states are stored in the ASL namespace at '\_SB_.Lxxx',
with xxx being the node index of the LPI state.
*/
-#define SB_SCOPE "\\_SB_"
-#define SB_SCOPE_PREFIX SB_SCOPE "."
+#define SB_SCOPE "\\_SB_"
+#define SB_SCOPE_PREFIX SB_SCOPE "."
/// Size of the SB_SCOPE_PREFIX string.
-#define SB_SCOPE_PREFIX_SIZE sizeof (SB_SCOPE_PREFIX)
+#define SB_SCOPE_PREFIX_SIZE sizeof (SB_SCOPE_PREFIX)
/// HID for a processor device.
-#define ACPI_HID_PROCESSOR_DEVICE "ACPI0007"
+#define ACPI_HID_PROCESSOR_DEVICE "ACPI0007"
/// HID for a processor container device.
-#define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010"
+#define ACPI_HID_PROCESSOR_CONTAINER_DEVICE "ACPI0010"
/** Node names of Cpus and Clusters are 'Cxxx', and 'Lxxx' for LPI states.
The 'xxx' is an index on 12 bits is given to node name,
thus the limitation in the number of nodes.
*/
-#define MAX_NODE_COUNT (1 << 12)
+#define MAX_NODE_COUNT (1 << 12)
/** A structure used to handle the Lpi structures referencing.
@@ -106,11 +106,11 @@ typedef struct TokenTable {
/// TokenTable, a table allowing to map:
/// Index <-> CM_OBJECT_TOKEN (to CM_ARM_LPI_INFO structures).
- CM_OBJECT_TOKEN * Table;
+ CM_OBJECT_TOKEN *Table;
/// Last used index of the TokenTable.
/// LastIndex is bound by ProcNodeCount.
- UINT32 LastIndex;
+ UINT32 LastIndex;
} TOKEN_TABLE;
/** A structure holding the Cpu topology generator and additional private data.
@@ -124,7 +124,7 @@ typedef struct AcpiCpuTopologyGenerator { /// Private object used to handle token referencing.
TOKEN_TABLE TokenTable;
/// List of CM_ARM_PROC_HIERARCHY_INFO CM objects.
- CM_ARM_PROC_HIERARCHY_INFO * ProcNodeList;
+ CM_ARM_PROC_HIERARCHY_INFO *ProcNodeList;
/// Count of CM_ARM_PROC_HIERARCHY_INFO CM objects.
UINT32 ProcNodeCount;
} ACPI_CPU_TOPOLOGY_GENERATOR;
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c index d62aee1056..39cfbad959 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiSsdtSerialPortLibArm/SsdtSerialPortGenerator.c @@ -46,7 +46,7 @@ GET_OBJECT_LIST ( respectively. So, the UIDs for serial ports for general use
start at 2.
*/
-#define SERIAL_PORT_START_UID 2
+#define SERIAL_PORT_START_UID 2
/** Maximum serial ports supported by this generator.
This generator supports a maximum of 14 (16 - 2) serial ports.
@@ -57,7 +57,7 @@ GET_OBJECT_LIST ( UID fields describing the serial port.
*/
-#define MAX_SERIAL_PORTS_SUPPORTED 14
+#define MAX_SERIAL_PORTS_SUPPORTED 14
/** Free any resources allocated for constructing the tables.
@@ -76,16 +76,16 @@ STATIC EFI_STATUS
EFIAPI
FreeSsdtSerialPortTableEx (
- 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,
+ 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,
IN CONST UINTN TableCount
)
{
- EFI_STATUS Status;
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
- UINTN Index;
+ EFI_STATUS Status;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
+ UINTN Index;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -95,7 +95,8 @@ FreeSsdtSerialPortTableEx ( if ((Table == NULL) ||
(*Table == NULL) ||
- (TableCount == 0)) {
+ (TableCount == 0))
+ {
DEBUG ((DEBUG_ERROR, "ERROR: SSDT-SERIAL-PORT: Invalid Table Pointer\n"));
return EFI_INVALID_PARAMETER;
}
@@ -105,7 +106,8 @@ FreeSsdtSerialPortTableEx ( for (Index = 0; Index < TableCount; Index++) {
if ((TableList[Index] != NULL) &&
(TableList[Index]->Signature ==
- EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE)) {
+ EFI_ACPI_6_3_SECONDARY_SYSTEM_DESCRIPTION_TABLE_SIGNATURE))
+ {
Status = FreeSsdtSerialPortTable (TableList[Index]);
} else {
Status = EFI_INVALID_PARAMETER;
@@ -121,7 +123,7 @@ FreeSsdtSerialPortTableEx ( ));
return Status;
}
- } //for
+ } // for
// Free the table list.
FreePool (*Table);
@@ -158,20 +160,20 @@ STATIC EFI_STATUS
EFIAPI
BuildSsdtSerialPortTableEx (
- IN CONST ACPI_TABLE_GENERATOR * This,
- IN CONST CM_STD_OBJ_ACPI_TABLE_INFO * CONST AcpiTableInfo,
- IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL * CONST CfgMgrProtocol,
- OUT EFI_ACPI_DESCRIPTION_HEADER *** Table,
- OUT UINTN * CONST TableCount
+ IN CONST ACPI_TABLE_GENERATOR *This,
+ IN CONST CM_STD_OBJ_ACPI_TABLE_INFO *CONST AcpiTableInfo,
+ IN CONST EDKII_CONFIGURATION_MANAGER_PROTOCOL *CONST CfgMgrProtocol,
+ OUT EFI_ACPI_DESCRIPTION_HEADER ***Table,
+ OUT UINTN *CONST TableCount
)
{
- EFI_STATUS Status;
- CM_ARM_SERIAL_PORT_INFO * SerialPortInfo;
- UINT32 SerialPortCount;
- UINTN Index;
- CHAR8 NewName[AML_NAME_SEG_SIZE + 1];
- UINT64 Uid;
- EFI_ACPI_DESCRIPTION_HEADER ** TableList;
+ EFI_STATUS Status;
+ CM_ARM_SERIAL_PORT_INFO *SerialPortInfo;
+ UINT32 SerialPortCount;
+ UINTN Index;
+ CHAR8 NewName[AML_NAME_SEG_SIZE + 1];
+ UINT64 Uid;
+ EFI_ACPI_DESCRIPTION_HEADER **TableList;
ASSERT (This != NULL);
ASSERT (AcpiTableInfo != NULL);
@@ -222,9 +224,9 @@ BuildSsdtSerialPortTableEx ( }
// Allocate a table to store pointers to the SSDT tables.
- TableList = (EFI_ACPI_DESCRIPTION_HEADER**)
+ TableList = (EFI_ACPI_DESCRIPTION_HEADER **)
AllocateZeroPool (
- (sizeof (EFI_ACPI_DESCRIPTION_HEADER*) * SerialPortCount)
+ (sizeof (EFI_ACPI_DESCRIPTION_HEADER *) * SerialPortCount)
);
if (TableList == NULL) {
Status = EFI_OUT_OF_RESOURCES;
@@ -246,7 +248,7 @@ BuildSsdtSerialPortTableEx ( NewName[2] = 'M';
NewName[4] = '\0';
for (Index = 0; Index < SerialPortCount; Index++) {
- Uid = SERIAL_PORT_START_UID + Index;
+ Uid = SERIAL_PORT_START_UID + Index;
NewName[3] = AsciiFromHex ((UINT8)(Uid));
// Build a SSDT table describing the serial port.
@@ -281,13 +283,13 @@ error_handler: /** This macro defines the SSDT Serial Port Table Generator revision.
*/
-#define SSDT_SERIAL_GENERATOR_REVISION CREATE_REVISION (1, 0)
+#define SSDT_SERIAL_GENERATOR_REVISION CREATE_REVISION (1, 0)
/** The interface for the SSDT Serial Port Table Generator.
*/
STATIC
CONST
-ACPI_TABLE_GENERATOR SsdtSerialPortGenerator = {
+ACPI_TABLE_GENERATOR SsdtSerialPortGenerator = {
// Generator ID
CREATE_STD_ACPI_TABLE_GEN_ID (EStdAcpiTableIdSsdtSerialPort),
// Generator Description
@@ -325,11 +327,12 @@ ACPI_TABLE_GENERATOR SsdtSerialPortGenerator = { EFI_STATUS
EFIAPI
AcpiSsdtSerialPortLibConstructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = RegisterAcpiTableGenerator (&SsdtSerialPortGenerator);
DEBUG ((
DEBUG_INFO,
@@ -353,11 +356,12 @@ AcpiSsdtSerialPortLibConstructor ( EFI_STATUS
EFIAPI
AcpiSsdtSerialPortLibDestructor (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE * SystemTable
+ IN EFI_HANDLE ImageHandle,
+ IN EFI_SYSTEM_TABLE *SystemTable
)
{
EFI_STATUS Status;
+
Status = DeregisterAcpiTableGenerator (&SsdtSerialPortGenerator);
DEBUG ((
DEBUG_INFO,
|