-/**\r
+/** @file\r
\r
Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.\r
This program and the accompanying materials\r
STATIC BOOLEAN mConsistencyCheck;\r
STATIC BOOLEAN mColourHighlighting;\r
\r
-/** An array of acpiview command line parameters.\r
-*/\r
+/**\r
+ An array of acpiview command line parameters.\r
+**/\r
STATIC CONST SHELL_PARAM_ITEM ParamList[] = {\r
{L"/?", TypeFlag},\r
{L"-c", TypeFlag},\r
{NULL, TypeMax}\r
};\r
\r
-/** This function returns the colour highlighting status.\r
+/**\r
+ This function returns the colour highlighting status.\r
\r
@retval TRUE if colour highlighting is enabled.\r
-*/\r
+**/\r
BOOLEAN\r
GetColourHighlighting (\r
VOID\r
return mColourHighlighting;\r
}\r
\r
-/** This function sets the colour highlighting status.\r
+/**\r
+ This function sets the colour highlighting status.\r
+\r
+ @param Highlight The Highlight status.\r
\r
-*/\r
+**/\r
VOID\r
SetColourHighlighting (\r
BOOLEAN Highlight\r
mColourHighlighting = Highlight;\r
}\r
\r
-/** This function returns the report options.\r
+/**\r
+ This function returns the report options.\r
\r
@retval Returns the report option.\r
-*/\r
+**/\r
STATIC\r
EREPORT_OPTION\r
GetReportOption (\r
return mReportType;\r
}\r
\r
-/** This function returns the selected ACPI table.\r
+/**\r
+ This function returns the selected ACPI table.\r
\r
@retval Returns signature of the selected ACPI table.\r
-*/\r
+**/\r
STATIC\r
UINT32\r
GetSelectedAcpiTable (\r
return mSelectedAcpiTable;\r
}\r
\r
-/** This function dumps the ACPI table to a file.\r
+/**\r
+ This function dumps the ACPI table to a file.\r
+\r
@param [in] Ptr Pointer to the ACPI table data.\r
@param [in] Length The length of the ACPI table.\r
\r
@retval TRUE Success.\r
@retval FALSE Failure.\r
-*/\r
+**/\r
STATIC\r
BOOLEAN\r
DumpAcpiTableToFile (\r
{\r
EFI_STATUS Status;\r
CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN];\r
- SHELL_FILE_HANDLE DumpFileHandle = NULL;\r
- UINTN TransferBytes = Length;\r
+ SHELL_FILE_HANDLE DumpFileHandle;\r
+ UINTN TransferBytes;\r
+\r
+ DumpFileHandle = NULL;\r
+ TransferBytes = Length;\r
\r
UnicodeSPrint (\r
FileNameBuffer,\r
return (Length == TransferBytes);\r
}\r
\r
-/** This function processes the table reporting options for the ACPI table.\r
+/**\r
+ This function processes the table reporting options for the ACPI table.\r
\r
@param [in] Signature The ACPI table Signature.\r
@param [in] TablePtr Pointer to the ACPI table data.\r
@param [in] Length The length fo the ACPI table.\r
\r
@retval Returns TRUE if the ACPI table should be traced.\r
-*/\r
+**/\r
BOOLEAN\r
ProcessTableReportOptions (\r
IN CONST UINT32 Signature,\r
)\r
{\r
UINTN OriginalAttribute;\r
- UINT8* SignaturePtr = (UINT8*)(UINTN)&Signature;\r
- BOOLEAN Log = FALSE;\r
- BOOLEAN HighLight = GetColourHighlighting ();\r
+ UINT8* SignaturePtr;\r
+ BOOLEAN Log;\r
+ BOOLEAN HighLight;\r
+\r
+ SignaturePtr = (UINT8*)(UINTN)&Signature;\r
+ Log = FALSE;\r
+ HighLight = GetColourHighlighting ();\r
+\r
switch (GetReportOption ()) {\r
- case EREPORT_ALL:\r
+ case ReportAll:\r
Log = TRUE;\r
break;\r
- case EREPORT_SELECTED:\r
+ case ReportSelected:\r
if (Signature == GetSelectedAcpiTable ()) {\r
Log = TRUE;\r
mSelectedAcpiTableFound = TRUE;\r
}\r
break;\r
- case EREPORT_TABLE_LIST:\r
+ case ReportTableList:\r
if (mTableCount == 0) {\r
if (HighLight) {\r
OriginalAttribute = gST->ConOut->Mode->Attribute;\r
SignaturePtr[3]\r
);\r
break;\r
- case EREPORT_DUMP_BIN_FILE:\r
+ case ReportDumpBinFile:\r
if (Signature == GetSelectedAcpiTable ()) {\r
mSelectedAcpiTableFound = TRUE;\r
DumpAcpiTableToFile (TablePtr, Length);\r
}\r
break;\r
- case EREPORT_MAX:\r
+ case ReportMax:\r
// We should never be here.\r
// This case is only present to prevent compiler warning.\r
break;\r
return Log;\r
}\r
\r
-/** This function converts a string to ACPI table signature.\r
+/**\r
+ This function converts a string to ACPI table signature.\r
\r
@param [in] Str Pointer to the string to be converted to the\r
ACPI table signature.\r
\r
@retval The ACPI table signature.\r
-*/\r
+**/\r
STATIC\r
UINT32\r
ConvertStrToAcpiSignature (\r
IN CONST CHAR16* Str\r
)\r
{\r
- UINT8 Index = 0;\r
+ UINT8 Index;\r
CHAR8 Ptr[4];\r
\r
+ Index = 0;\r
+\r
// Convert to Upper case and convert to ASCII\r
while ((Index < 4) && (Str[Index] != 0)) {\r
if (Str[Index] >= L'a' && Str[Index] <= L'z') {\r
return *(UINT32*)Ptr;\r
}\r
\r
-/** This function iterates the configuration table entries in the\r
- system table, retrieves the RSDP pointer and starts parsing\r
- the ACPI tables.\r
+/**\r
+ This function iterates the configuration table entries in the\r
+ system table, retrieves the RSDP pointer and starts parsing the ACPI tables.\r
\r
@param [in] SystemTable Pointer to the EFI system table.\r
\r
@retval Returns EFI_NOT_FOUND if the RSDP pointer is not found.\r
Returns EFI_UNSUPPORTED if the RSDP version is less than 2.\r
Returns EFI_SUCCESS if successful.\r
-*/\r
+**/\r
STATIC\r
EFI_STATUS\r
EFIAPI\r
}\r
\r
ReportOption = GetReportOption ();\r
- if (EREPORT_TABLE_LIST != ReportOption) {\r
- if (((EREPORT_SELECTED == ReportOption) ||\r
- (EREPORT_DUMP_BIN_FILE == ReportOption)) &&\r
+ if (ReportTableList != ReportOption) {\r
+ if (((ReportSelected == ReportOption) ||\r
+ (ReportDumpBinFile == ReportOption)) &&\r
(!mSelectedAcpiTableFound)) {\r
Print (L"\nRequested ACPI Table not found.\n");\r
- } else if (EREPORT_DUMP_BIN_FILE != ReportOption) {\r
+ } else if (ReportDumpBinFile != ReportOption) {\r
OriginalAttribute = gST->ConOut->Mode->Attribute;\r
\r
Print (L"\nTable Statistics:\n");\r
\r
@param[in] ImageHandle Handle to the Image (NULL if Internal).\r
@param[in] SystemTable Pointer to the System Table (NULL if Internal).\r
-*/\r
+**/\r
SHELL_STATUS\r
EFIAPI\r
ShellCommandRunAcpiView (\r
)\r
{\r
EFI_STATUS Status;\r
- SHELL_STATUS ShellStatus = SHELL_SUCCESS;\r
- LIST_ENTRY* Package = NULL;\r
+ SHELL_STATUS ShellStatus;\r
+ LIST_ENTRY* Package;\r
CHAR16* ProblemParam;\r
CONST CHAR16* Temp;\r
CHAR8 ColourOption[8];\r
- SHELL_FILE_HANDLE TmpDumpFileHandle = NULL;\r
+ SHELL_FILE_HANDLE TmpDumpFileHandle;\r
\r
// Set Defaults\r
- mReportType = EREPORT_ALL;\r
+ mReportType = ReportAll;\r
mTableCount = 0;\r
mBinTableCount = 0;\r
mSelectedAcpiTable = 0;\r
mVerbose = TRUE;\r
mConsistencyCheck = TRUE;\r
\r
+ ShellStatus = SHELL_SUCCESS;\r
+ Package = NULL;\r
+ TmpDumpFileHandle = NULL;\r
+\r
// Reset The error/warning counters\r
ResetErrorCount ();\r
ResetWarningCount ();\r
}\r
\r
if (ShellCommandLineGetFlag (Package, L"-l")) {\r
- mReportType = EREPORT_TABLE_LIST;\r
+ mReportType = ReportTableList;\r
} else {\r
mSelectedAcpiTableName = ShellCommandLineGetValue (Package, L"-s");\r
if (mSelectedAcpiTableName != NULL) {\r
mSelectedAcpiTable = (UINT32)ConvertStrToAcpiSignature (\r
mSelectedAcpiTableName\r
);\r
- mReportType = EREPORT_SELECTED;\r
+ mReportType = ReportSelected;\r
\r
if (ShellCommandLineGetFlag (Package, L"-d")) {\r
// Create a temporary file to check if the media is writable.\r
CHAR16 FileNameBuffer[MAX_FILE_NAME_LEN];\r
- mReportType = EREPORT_DUMP_BIN_FILE;\r
+ mReportType = ReportDumpBinFile;\r
\r
UnicodeSPrint (\r
FileNameBuffer,\r