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>
This commit is contained in:
Krzysztof Koch 2019-07-18 18:04:55 -07:00 committed by Jaben Carsey
parent ef2360569d
commit 386fbe1a6b

@ -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):
@ -15,52 +15,6 @@
// Local Variables
STATIC CONST UINT64* XsdtAddress;
/**
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
);
/**
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.
@ -131,6 +85,22 @@ ValidateXsdtAddress (
#endif
}
/**
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.