ShellPkg: acpiview: SRAT: Remove redundant forward declarations

Remove redundant forward function declarations by repositioning
blocks of code. This way the code structure is consistent across
ACPI table parsers and the code becomes more concise.

Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com>
Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
This commit is contained in:
Krzysztof Koch 2019-07-18 18:04:58 -07:00 committed by Jaben Carsey
parent cca8826cc0
commit 527a36859d
1 changed files with 18 additions and 46 deletions
ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat

View File

@ -1,7 +1,7 @@
/** @file
SRAT table parser
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
Copyright (c) 2016 - 2019, ARM Limited. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
@par Reference(s):
@ -32,7 +32,13 @@ EFIAPI
ValidateSratReserved (
IN UINT8* Ptr,
IN VOID* Context
);
)
{
if (*(UINT32*)Ptr != 1) {
IncrementErrorCount ();
Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n");
}
}
/**
This function traces the APIC Proximity Domain field.
@ -44,9 +50,16 @@ STATIC
VOID
EFIAPI
DumpSratApicProximity (
IN CONST CHAR16* Format,
IN UINT8* Ptr
);
IN CONST CHAR16* Format,
IN UINT8* Ptr
)
{
UINT32 ProximityDomain;
ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);
Print (Format, ProximityDomain);
}
/**
An ACPI_PARSER array describing the SRAT Table.
@ -139,47 +152,6 @@ STATIC CONST ACPI_PARSER SratX2ApciAffinityParser[] = {
{L"Reserved", 4, 20, L"0x%x", NULL, NULL, NULL, NULL}
};
/** This function validates the Reserved field in the SRAT table header.
@param [in] Ptr Pointer to the start of the field data.
@param [in] Context Pointer to context specific information e.g. this
could be a pointer to the ACPI table header.
**/
STATIC
VOID
EFIAPI
ValidateSratReserved (
IN UINT8* Ptr,
IN VOID* Context
)
{
if (*(UINT32*)Ptr != 1) {
IncrementErrorCount ();
Print (L"\nERROR: Reserved should be 1 for backward compatibility.\n");
}
}
/**
This function traces the APIC Proximity Domain field.
@param [in] Format Format string for tracing the data.
@param [in] Ptr Pointer to the start of the buffer.
**/
STATIC
VOID
EFIAPI
DumpSratApicProximity (
IN CONST CHAR16* Format,
IN UINT8* Ptr
)
{
UINT32 ProximityDomain;
ProximityDomain = Ptr[0] | (Ptr[1] << 8) | (Ptr[2] << 16);
Print (Format, ProximityDomain);
}
/**
This function parses the ACPI SRAT table.
When trace is enabled this function parses the SRAT table and