summaryrefslogtreecommitdiffstats
path: root/ShellPkg
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2019-07-18 18:04:58 -0700
committerJaben Carsey <jaben.carsey@intel.com>2019-07-19 08:32:53 -0700
commit527a36859d09ee11f59126e4b8d91cecd8b6052d (patch)
tree42a2bac1a5fdcb04d5046d3e0eb0435c7833bf93 /ShellPkg
parentcca8826cc05350a99d495c0aaf86c9da8c22aa64 (diff)
downloadedk2-527a36859d09ee11f59126e4b8d91cecd8b6052d.tar.gz
edk2-527a36859d09ee11f59126e4b8d91cecd8b6052d.tar.bz2
edk2-527a36859d09ee11f59126e4b8d91cecd8b6052d.zip
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>
Diffstat (limited to 'ShellPkg')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c64
1 files changed, 18 insertions, 46 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
index 075ff2a141..03d28d5284 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Srat/SratParser.c
@@ -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