summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers
diff options
context:
space:
mode:
authorKrzysztof Koch <krzysztof.koch@arm.com>2019-07-18 18:04:55 -0700
committerJaben Carsey <jaben.carsey@intel.com>2019-07-19 08:32:36 -0700
commit386fbe1a6bff65f6fd83a64eb72ac663a511655b (patch)
treec6350a89735ddb259d94350a5a5ed295db1bf872 /ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers
parentef2360569d008c440c64d2afd77977861ed0a8df (diff)
downloadedk2-386fbe1a6bff65f6fd83a64eb72ac663a511655b.tar.gz
edk2-386fbe1a6bff65f6fd83a64eb72ac663a511655b.tar.bz2
edk2-386fbe1a6bff65f6fd83a64eb72ac663a511655b.zip
ShellPkg: acpiview: RSDP: 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/Library/UefiShellAcpiViewCommandLib/Parsers')
-rw-r--r--ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c64
1 files changed, 17 insertions, 47 deletions
diff --git a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c
index 586de7cbfb..4bf928139a 100644
--- a/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c
+++ b/ShellPkg/Library/UefiShellAcpiViewCommandLib/Parsers/Rsdp/RsdpParser.c
@@ -1,7 +1,7 @@
/** @file
RSDP 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):
@@ -28,52 +28,6 @@ EFIAPI
ValidateRsdtAddress (
IN UINT8* Ptr,
IN VOID* Context
- );
-
-/**
- This function validates the XSDT Address.
-
- @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
-ValidateXsdtAddress (
- IN UINT8* Ptr,
- IN VOID* Context
- );
-
-/**
- An array describing the ACPI RSDP Table.
-**/
-STATIC CONST ACPI_PARSER RsdpParser[] = {
- {L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL},
- {L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL},
- {L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL},
- {L"RSDT Address", 4, 16, L"0x%x", NULL, NULL, ValidateRsdtAddress, NULL},
- {L"Length", 4, 20, L"%d", NULL, NULL, NULL, NULL},
- {L"XSDT Address", 8, 24, L"0x%lx", NULL, (VOID**)&XsdtAddress,
- ValidateXsdtAddress, NULL},
- {L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL},
- {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
-};
-
-/**
- This function validates the RSDT Address.
-
- @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
-ValidateRsdtAddress (
- IN UINT8* Ptr,
- IN VOID* Context
)
{
#if defined(MDE_CPU_ARM) || defined (MDE_CPU_AARCH64)
@@ -132,6 +86,22 @@ ValidateXsdtAddress (
}
/**
+ An array describing the ACPI RSDP Table.
+**/
+STATIC CONST ACPI_PARSER RsdpParser[] = {
+ {L"Signature", 8, 0, NULL, Dump8Chars, NULL, NULL, NULL},
+ {L"Checksum", 1, 8, L"0x%x", NULL, NULL, NULL, NULL},
+ {L"Oem ID", 6, 9, NULL, Dump6Chars, NULL, NULL, NULL},
+ {L"Revision", 1, 15, L"%d", NULL, NULL, NULL, NULL},
+ {L"RSDT Address", 4, 16, L"0x%x", NULL, NULL, ValidateRsdtAddress, NULL},
+ {L"Length", 4, 20, L"%d", NULL, NULL, NULL, NULL},
+ {L"XSDT Address", 8, 24, L"0x%lx", NULL, (VOID**)&XsdtAddress,
+ ValidateXsdtAddress, NULL},
+ {L"Extended Checksum", 1, 32, L"0x%x", NULL, NULL, NULL, NULL},
+ {L"Reserved", 3, 33, L"%x %x %x", Dump3Chars, NULL, NULL, NULL}
+};
+
+/**
This function parses the ACPI RSDP table.
This function invokes the parser for the XSDT table.