summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ShellPkg/Application/Shell/ShellParametersProtocol.c2
-rw-r--r--ShellPkg/Include/Library/ShellCEntryLib.h2
-rw-r--r--ShellPkg/Include/ShellBase.h6
-rw-r--r--ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h2
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c600
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h336
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c64
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h35
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c164
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h61
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c191
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h53
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h6
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c367
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h28
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c209
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h62
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c426
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h109
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c842
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h20
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c27
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h12
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h36
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c147
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h88
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c1216
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h343
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c674
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h671
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c73
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c58
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h6
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h2
-rw-r--r--ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf2
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c6
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c2
-rw-r--r--ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h2
-rw-r--r--ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h2
-rw-r--r--ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h2
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c19
-rw-r--r--ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h2
-rw-r--r--ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h2
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.h2
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c6
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c30
-rw-r--r--ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h2
47 files changed, 3668 insertions, 3349 deletions
diff --git a/ShellPkg/Application/Shell/ShellParametersProtocol.c b/ShellPkg/Application/Shell/ShellParametersProtocol.c
index 238ccd9681..b90a2c32bb 100644
--- a/ShellPkg/Application/Shell/ShellParametersProtocol.c
+++ b/ShellPkg/Application/Shell/ShellParametersProtocol.c
@@ -455,6 +455,8 @@ IsUnicodeFile(
Strips out quotes sections of a string.
All of the characters between quotes is replaced with spaces.
+
+ @param[in,out] TheString A pointer to the string to update.
**/
VOID
EFIAPI
diff --git a/ShellPkg/Include/Library/ShellCEntryLib.h b/ShellPkg/Include/Library/ShellCEntryLib.h
index 79136a6894..dfbb16f9c3 100644
--- a/ShellPkg/Include/Library/ShellCEntryLib.h
+++ b/ShellPkg/Include/Library/ShellCEntryLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_SHELL_C_ENTRY_LIB_)
+#ifndef _SHELL_C_ENTRY_LIB_
#define _SHELL_C_ENTRY_LIB_
/**
diff --git a/ShellPkg/Include/ShellBase.h b/ShellPkg/Include/ShellBase.h
index 73ef064207..92f5833f14 100644
--- a/ShellPkg/Include/ShellBase.h
+++ b/ShellPkg/Include/ShellBase.h
@@ -12,14 +12,13 @@
**/
-#ifndef __SHELL_BASE__
-#define __SHELL_BASE__
+#ifndef _SHELL_BASE_
+#define _SHELL_BASE_
#define ABS(a) ((a<0)?(-(a)):(a))
typedef VOID *SHELL_FILE_HANDLE;
-#ifndef SHELL_FREE_NON_NULL
#define SHELL_FREE_NON_NULL(Pointer) \
do { \
if ((Pointer) != NULL) { \
@@ -27,7 +26,6 @@ typedef VOID *SHELL_FILE_HANDLE;
(Pointer) = NULL; \
} \
} while(FALSE)
-#endif //SHELL_FREE_NON_NULL
typedef enum {
///
diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
index d519c1d400..de61b7cce6 100644
--- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
+++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_HANDLE_PARSING_LIB_INTERNAL_H_)
+#ifndef _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
#define _UEFI_HANDLE_PARSING_LIB_INTERNAL_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
index 8aa75b419a..469642245d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.c
@@ -74,23 +74,16 @@ BOOLEAN HBufferImageOnlyLineNeedRefresh;
BOOLEAN HBufferImageMouseNeedRefresh;
+/**
+ Initialization function for HBufferImage
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HBufferImageInit (
VOID
)
-/**
- Initialization function for HBufferImage
-
-
-
- None
-
-
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
-**/
{
EFI_STATUS Status;
@@ -144,25 +137,16 @@ HBufferImageInit (
return EFI_SUCCESS;
}
+/**
+ Backup function for HBufferImage. Only a few fields need to be backup.
+ This is for making the file buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImageBackup (
VOID
)
-/**
- Backup function for HBufferImage
- Only a few fields need to be backup.
- This is for making the file buffer refresh
- as few as possible.
-
-
-
- None
-
-
-
- EFI_SUCCESS
-
-**/
{
HBufferImageBackupVar.MousePosition = HBufferImage.MousePosition;
@@ -197,27 +181,20 @@ HBufferImageBackup (
return EFI_SUCCESS;
}
-EFI_STATUS
-HBufferImageFreeLines (
- VOID
- )
-/**
- Free all the lines in HBufferImage
+/**
+ Free all the lines in HBufferImage.
Fields affected:
Lines
CurrentLine
NumLines
ListHead
-
-
- None
-
-
-
- EFI_SUCCESS
-
+ @retval EFI_SUCCESS The operation was successful.
**/
+EFI_STATUS
+HBufferImageFreeLines (
+ VOID
+ )
{
HFreeLines (HBufferImage.ListHead, HBufferImage.Lines);
@@ -228,22 +205,15 @@ HBufferImageFreeLines (
return EFI_SUCCESS;
}
+/**
+ Cleanup function for HBufferImage
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImageCleanup (
VOID
)
-/**
- Cleanup function for HBufferImage
-
-
-
- None
-
-
-
- EFI_SUCCESS
-
-**/
{
EFI_STATUS Status;
@@ -257,12 +227,22 @@ HBufferImageCleanup (
HFileImageCleanup ();
HDiskImageCleanup ();
- HMemImageCleanup ();
return Status;
}
+/**
+ Print Line on Row
+
+ @param[in] Line The lline to print.
+ @param[in] Row The row on screen ( begin from 1 ).
+ @param[in] FRow The FRow.
+ @param[in] Orig The original color.
+ @param[in] New The color to print with.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImagePrintLine (
IN HEFI_EDITOR_LINE *Line,
@@ -272,22 +252,6 @@ HBufferImagePrintLine (
IN HEFI_EDITOR_COLOR_UNION New
)
-/**
- Print Line on Row
-
-
-
- Line - Line to print
- Row - Row on screen ( begin from 1 )
- FRow - FRow
- Orig - Orig
- New - Light display
-
-
-
- EFI_SUCCESS
-
-**/
{
UINTN Index;
@@ -330,7 +294,7 @@ HBufferImagePrintLine (
}
- if (HEditorMouseAction == FALSE) {
+ if (!HEditorMouseAction) {
ShellPrintEx (
0,
(INT32)Row - 1,
@@ -417,7 +381,7 @@ HBufferImagePrintLine (
//
// PRINT the buffer content
//
- if (HEditorMouseAction == FALSE) {
+ if (!HEditorMouseAction) {
for (Index = 0; Index < 0x10 && Index < Line->Size; Index++) {
Pos = ASCII_POSITION + Index;
@@ -456,6 +420,15 @@ HBufferImagePrintLine (
return EFI_SUCCESS;
}
+/**
+ Function to decide if a column number is stored in the high bits.
+
+ @param[in] Column The column to examine.
+ @param[out] FCol The actual column number.
+
+ @retval TRUE The actual column was in high bits and is now in FCol.
+ @retval FALSE There was not a column number in the high bits.
+**/
BOOLEAN
HBufferImageIsAtHighBits (
IN UINTN Column,
@@ -479,7 +452,7 @@ HBufferImageIsAtHighBits (
*FCol = (Column / 3) + 1;
- if (!(Column % 3)) {
+ if (Column % 3 == 0) {
return TRUE;
}
@@ -490,6 +463,15 @@ HBufferImageIsAtHighBits (
return FALSE;
}
+/**
+ Decide if a point is in the already selected area.
+
+ @param[in] MouseRow The row of the point to test.
+ @param[in] MouseCol The col of the point to test.
+
+ @retval TRUE The point is in the selected area.
+ @retval FALSE The point is not in the selected area.
+**/
BOOLEAN
HBufferImageIsInSelectedArea (
IN UINTN MouseRow,
@@ -552,6 +534,11 @@ HBufferImageIsInSelectedArea (
return TRUE;
}
+/**
+ Set mouse position according to HBufferImage.MousePosition.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImageRestoreMousePosition (
VOID
@@ -719,22 +706,15 @@ HBufferImageRestoreMousePosition (
return EFI_SUCCESS;
}
+/**
+ Set cursor position according to HBufferImage.DisplayPosition.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImageRestorePosition (
VOID
)
-/**
- Set cursor position according to HBufferImage.DisplayPosition.
-
-
-
- None
-
-
-
- EFI_SUCCESS
-
-**/
{
//
// set cursor position
@@ -748,7 +728,7 @@ HBufferImageRestorePosition (
return EFI_SUCCESS;
}
-/**
+/**
Refresh function for HBufferImage.
@retval EFI_SUCCESS The operation was successful.
@@ -890,7 +870,7 @@ HBufferImageRefresh (
} while (Link != HBufferImage.ListHead && Row <= EndRow);
while (Row <= EndRow) {
- HEditorClearLine (Row);
+ EditorClearLine (Row, HMainEditor.ScreenSize.Column, HMainEditor.ScreenSize.Row);
Row++;
}
//
@@ -915,8 +895,8 @@ HBufferImageRefresh (
@param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
@param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
@param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] MemoryOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] MemorySize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
@param[in] BufferType The type of buffer to save. IGNORED.
@param[in] Recover TRUE for recovermode, FALSE otherwise.
@@ -980,8 +960,8 @@ HBufferImageRead (
@param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
@param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
@param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
- @param[in] MemoryOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
- @param[in] MemorySize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
@param[in] BufferType The type of buffer to save. IGNORED.
@return EFI_SUCCESS The operation was successful.
@@ -1036,7 +1016,7 @@ HBufferImageSave (
return Status;
}
-/**
+/**
Create a new line and append it to the line list.
Fields affected:
NumLines
@@ -1083,7 +1063,7 @@ HBufferImageCreateLine (
return Line;
}
-/**
+/**
Free the current image.
@retval EFI_SUCCESS The operation was successful.
@@ -1101,160 +1081,6 @@ HBufferImageFree (
return EFI_SUCCESS;
}
-/**
- Dispatch input to different handler
-
- @param[in] Key The input key:
- the keys can be:
- ASCII KEY
- Backspace/Delete
- Direction key: up/down/left/right/pgup/pgdn
- Home/End
- INS
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A Memory allocation failed.
-**/
-EFI_STATUS
-HBufferImageHandleInput (
- IN EFI_INPUT_KEY *Key
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- switch (Key->ScanCode) {
- //
- // ordinary key
- //
- case SCAN_NULL:
- Status = HBufferImageDoCharInput (Key->UnicodeChar);
- break;
-
- //
- // up arrow
- //
- case SCAN_UP:
- Status = HBufferImageScrollUp ();
- break;
-
- //
- // down arrow
- //
- case SCAN_DOWN:
- Status = HBufferImageScrollDown ();
- break;
-
- //
- // right arrow
- //
- case SCAN_RIGHT:
- Status = HBufferImageScrollRight ();
- break;
-
- //
- // left arrow
- //
- case SCAN_LEFT:
- Status = HBufferImageScrollLeft ();
- break;
-
- //
- // page up
- //
- case SCAN_PAGE_UP:
- Status = HBufferImagePageUp ();
- break;
-
- //
- // page down
- //
- case SCAN_PAGE_DOWN:
- Status = HBufferImagePageDown ();
- break;
-
- //
- // delete
- //
- case SCAN_DELETE:
- Status = HBufferImageDoDelete ();
- break;
-
- //
- // home
- //
- case SCAN_HOME:
- Status = HBufferImageHome ();
- break;
-
- //
- // end
- //
- case SCAN_END:
- Status = HBufferImageEnd ();
- break;
-
- default:
- Status = StatusBarSetStatusString (L"Unknown Command");
- break;
- }
-
- return Status;
-}
-
-/**
- ASCII key + Backspace + return.
-
- @param[in] Char The input char.
-
- @retval EFI_SUCCESS The operation was successful.
- @retval EFI_LOAD_ERROR A load error occured.
- @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageDoCharInput (
- IN CHAR16 Char
- )
-{
- EFI_STATUS Status;
-
- Status = EFI_SUCCESS;
-
- switch (Char) {
- case 0:
- break;
-
- case 0x08:
- Status = HBufferImageDoBackspace ();
- break;
-
- case 0x09:
- case 0x0a:
- case 0x0d:
- //
- // Tabs, Returns are thought as nothing
- //
- break;
-
- default:
- //
- // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
- //
- if (Char > 127 || Char < 32) {
- Status = StatusBarSetStatusString (L"Unknown Command");
- } else {
- Status = HBufferImageAddChar (Char);
- }
-
- break;
- }
-
- return Status;
-}
-
/**
change char to int value based on Hex.
@@ -1422,23 +1248,114 @@ HBufferImageAddChar (
}
/**
- Check user specified FileRow and FileCol is in current screen.
+ Delete the previous character.
- @param[in] FileRow Row of file position ( start from 1 ).
+ @retval EFI_SUCCESS The operationw as successful.
+**/
+EFI_STATUS
+EFIAPI
+HBufferImageDoBackspace (
+ VOID
+ )
+{
+ HEFI_EDITOR_LINE *Line;
- @retval TRUE It's on the current screen.
- @retval FALSE It's not on the current screen.
+ UINTN FileColumn;
+ UINTN FPos;
+ BOOLEAN LastLine;
+
+ //
+ // variable initialization
+ //
+ LastLine = FALSE;
+
+ //
+ // already the first character
+ //
+ if (HBufferImage.BufferPosition.Row == 1 && HBufferImage.BufferPosition.Column == 1) {
+ return EFI_SUCCESS;
+ }
+
+ FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
+
+ FileColumn = HBufferImage.BufferPosition.Column;
+
+ Line = HBufferImage.CurrentLine;
+ LastLine = FALSE;
+ if (Line->Link.ForwardLink == HBufferImage.ListHead && FileColumn > 1) {
+ LastLine = TRUE;
+ }
+
+ HBufferImageDeleteCharacterFromBuffer (FPos - 1, 1, NULL);
+
+ //
+ // if is the last line
+ // then only this line need to be refreshed
+ //
+ if (LastLine) {
+ HBufferImageNeedRefresh = FALSE;
+ HBufferImageOnlyLineNeedRefresh = TRUE;
+ } else {
+ HBufferImageNeedRefresh = TRUE;
+ HBufferImageOnlyLineNeedRefresh = FALSE;
+ }
+
+ if (!HBufferImage.Modified) {
+ HBufferImage.Modified = TRUE;
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
+ ASCII key + Backspace + return.
+
+ @param[in] Char The input char.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
**/
-BOOLEAN
-HInCurrentScreen (
- IN UINTN FileRow
+EFI_STATUS
+EFIAPI
+HBufferImageDoCharInput (
+ IN CHAR16 Char
)
{
- if (FileRow >= HBufferImage.LowVisibleRow && FileRow <= HBufferImage.LowVisibleRow + (HMainEditor.ScreenSize.Row - 5) - 1) {
- return TRUE;
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+
+ switch (Char) {
+ case 0:
+ break;
+
+ case 0x08:
+ Status = HBufferImageDoBackspace ();
+ break;
+
+ case 0x09:
+ case 0x0a:
+ case 0x0d:
+ //
+ // Tabs, Returns are thought as nothing
+ //
+ break;
+
+ default:
+ //
+ // DEAL WITH ASCII CHAR, filter out thing like ctrl+f
+ //
+ if (Char > 127 || Char < 32) {
+ Status = StatusBarSetStatusString (L"Unknown Command");
+ } else {
+ Status = HBufferImageAddChar (Char);
+ }
+
+ break;
}
- return FALSE;
+ return Status;
}
/**
@@ -1496,7 +1413,6 @@ HBufferImageMovePosition (
IN UINTN NewFilePosCol,
IN BOOLEAN HighBits
)
-
{
INTN RowGap;
UINTN Abs;
@@ -1972,7 +1888,7 @@ HBufferImageGetTotalSize (
@param[in] Pos Position, Pos starting from 0.
@param[in] Count The Count of characters to delete.
- @param[OUT] DeleteBuffer The DeleteBuffer.
+ @param[out] DeleteBuffer The DeleteBuffer.
@retval EFI_SUCCESS Success
**/
@@ -2210,66 +2126,6 @@ HBufferImageAddCharacterToBuffer (
}
/**
- Delete the previous character.
-
- @retval EFI_SUCCESS The operationw as successful.
-**/
-EFI_STATUS
-EFIAPI
-HBufferImageDoBackspace (
- VOID
- )
-{
- HEFI_EDITOR_LINE *Line;
-
- UINTN FileColumn;
- UINTN FPos;
- BOOLEAN LastLine;
-
- //
- // variable initialization
- //
- LastLine = FALSE;
-
- //
- // already the first character
- //
- if (HBufferImage.BufferPosition.Row == 1 && HBufferImage.BufferPosition.Column == 1) {
- return EFI_SUCCESS;
- }
-
- FPos = (HBufferImage.BufferPosition.Row - 1) * 0x10 + HBufferImage.BufferPosition.Column - 1;
-
- FileColumn = HBufferImage.BufferPosition.Column;
-
- Line = HBufferImage.CurrentLine;
- LastLine = FALSE;
- if (Line->Link.ForwardLink == HBufferImage.ListHead && FileColumn > 1) {
- LastLine = TRUE;
- }
-
- HBufferImageDeleteCharacterFromBuffer (FPos - 1, 1, NULL);
-
- //
- // if is the last line
- // then only this line need to be refreshed
- //
- if (LastLine) {
- HBufferImageNeedRefresh = FALSE;
- HBufferImageOnlyLineNeedRefresh = TRUE;
- } else {
- HBufferImageNeedRefresh = TRUE;
- HBufferImageOnlyLineNeedRefresh = FALSE;
- }
-
- if (!HBufferImage.Modified) {
- HBufferImage.Modified = TRUE;
- }
-
- return EFI_SUCCESS;
-}
-
-/**
Delete current character from line.
@retval EFI_SUCCESS The operationw as successful.
@@ -2534,3 +2390,107 @@ HBufferImageAdjustMousePosition (
}
}
+
+/**
+ Dispatch input to different handler
+
+ @param[in] Key The input key:
+ the keys can be:
+ ASCII KEY
+ Backspace/Delete
+ Direction key: up/down/left/right/pgup/pgdn
+ Home/End
+ INS
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_OUT_OF_RESOURCES A Memory allocation failed.
+**/
+EFI_STATUS
+HBufferImageHandleInput (
+ IN EFI_INPUT_KEY *Key
+ )
+{
+ EFI_STATUS Status;
+
+ Status = EFI_SUCCESS;
+
+ switch (Key->ScanCode) {
+ //
+ // ordinary key
+ //
+ case SCAN_NULL:
+ Status = HBufferImageDoCharInput (Key->UnicodeChar);
+ break;
+
+ //
+ // up arrow
+ //
+ case SCAN_UP:
+ Status = HBufferImageScrollUp ();
+ break;
+
+ //
+ // down arrow
+ //
+ case SCAN_DOWN:
+ Status = HBufferImageScrollDown ();
+ break;
+
+ //
+ // right arrow
+ //
+ case SCAN_RIGHT:
+ Status = HBufferImageScrollRight ();
+ break;
+
+ //
+ // left arrow
+ //
+ case SCAN_LEFT:
+ Status = HBufferImageScrollLeft ();
+ break;
+
+ //
+ // page up
+ //
+ case SCAN_PAGE_UP:
+ Status = HBufferImagePageUp ();
+ break;
+
+ //
+ // page down
+ //
+ case SCAN_PAGE_DOWN:
+ Status = HBufferImagePageDown ();
+ break;
+
+ //
+ // delete
+ //
+ case SCAN_DELETE:
+ Status = HBufferImageDoDelete ();
+ break;
+
+ //
+ // home
+ //
+ case SCAN_HOME:
+ Status = HBufferImageHome ();
+ break;
+
+ //
+ // end
+ //
+ case SCAN_END:
+ Status = HBufferImageEnd ();
+ break;
+
+ default:
+ Status = StatusBarSetStatusString (L"Unknown Command");
+ break;
+ }
+
+ return Status;
+}
+
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
index 5e637ce700..91369b5931 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/BufferImage.h
@@ -18,177 +18,152 @@
#include "HexEditor.h"
+/**
+ Initialization function for HBufferImage
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HBufferImageInit (
VOID
);
+
+/**
+ Cleanup function for HBufferImage
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImageCleanup (
VOID
);
+
+/**
+ Refresh function for HBufferImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A Load error occured.
+
+**/
EFI_STATUS
HBufferImageRefresh (
VOID
);
-EFI_STATUS
-HBufferImageHide (
- VOID
- );
+
+/**
+ Dispatch input to different handler
+
+ @param[in] Key The input key:
+ the keys can be:
+ ASCII KEY
+ Backspace/Delete
+ Direction key: up/down/left/right/pgup/pgdn
+ Home/End
+ INS
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_OUT_OF_RESOURCES A Memory allocation failed.
+**/
EFI_STATUS
HBufferImageHandleInput (
- EFI_INPUT_KEY *
+ IN EFI_INPUT_KEY *Key
);
+
+/**
+ Backup function for HBufferImage. Only a few fields need to be backup.
+ This is for making the file buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HBufferImageBackup (
VOID
);
+/**
+ Read an image into a buffer friom a source.
+
+ @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
+ @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
+ @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
+ @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
+ @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] BufferType The type of buffer to save. IGNORED.
+ @param[in] Recover TRUE for recovermode, FALSE otherwise.
+
+ @return EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
+EFIAPI
HBufferImageRead (
- IN CONST CHAR16 *,
- IN CONST CHAR16 *,
- IN UINTN,
- IN UINTN,
- IN UINTN,
- IN UINTN,
- IN EDIT_FILE_TYPE,
- IN BOOLEAN
+ IN CONST CHAR16 *FileName,
+ IN CONST CHAR16 *DiskName,
+ IN UINTN DiskOffset,
+ IN UINTN DiskSize,
+ IN UINTN MemOffset,
+ IN UINTN MemSize,
+ IN EDIT_FILE_TYPE BufferType,
+ IN BOOLEAN Recover
);
-EFI_STATUS
-HBufferImageSave (
- IN CHAR16 *,
- IN CHAR16 *,
- IN UINTN,
- IN UINTN,
- IN UINTN,
- IN UINTN,
- IN EDIT_FILE_TYPE
- );
+/**
+ Save the current image.
-INTN
-HBufferImageCharToHex (
- IN CHAR16
- );
+ @param[in] FileName Pointer to the file name. OPTIONAL and ignored if not FileTypeFileBuffer.
+ @param[in] DiskName Pointer to the disk name. OPTIONAL and ignored if not FileTypeDiskBuffer.
+ @param[in] DiskOffset Offset into the disk. OPTIONAL and ignored if not FileTypeDiskBuffer.
+ @param[in] DiskSize Size of the disk buffer. OPTIONAL and ignored if not FileTypeDiskBuffer.
+ @param[in] MemOffset Offset into the Memory. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] MemSize Size of the Memory buffer. OPTIONAL and ignored if not FileTypeMemBuffer.
+ @param[in] BufferType The type of buffer to save. IGNORED.
+ @return EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
-HBufferImageRestoreMousePosition (
- VOID
- );
-EFI_STATUS
-HBufferImageRestorePosition (
- VOID
+HBufferImageSave (
+ IN CHAR16 *FileName,
+ IN CHAR16 *DiskName,
+ IN UINTN DiskOffset,
+ IN UINTN DiskSize,
+ IN UINTN MemOffset,
+ IN UINTN MemSize,
+ IN EDIT_FILE_TYPE BufferType
);
+/**
+ According to cursor's file position, adjust screen display.
+
+ @param[in] NewFilePosRow Row of file position ( start from 1 ).
+ @param[in] NewFilePosCol Column of file position ( start from 1 ).
+ @param[in] HighBits Cursor will on high4 bits or low4 bits.
+**/
VOID
HBufferImageMovePosition (
- IN UINTN,
- IN UINTN,
- IN BOOLEAN
+ IN UINTN NewFilePosRow,
+ IN UINTN NewFilePosCol,
+ IN BOOLEAN HighBits
);
-EFI_STATUS
-HBufferImageHandleInput (
- EFI_INPUT_KEY *
- );
-HEFI_EDITOR_LINE *
-HBufferImageCreateLine (
- VOID
- );
+/**
+ Create a new line and append it to the line list.
+ Fields affected:
+ NumLines
+ Lines
-EFI_STATUS
-HBufferImageDoCharInput (
- CHAR16
- );
-EFI_STATUS
-HBufferImageAddChar (
- CHAR16
- );
+ @retval NULL create line failed.
+ @return the line created.
-BOOLEAN
-HInCurrentScreen (
- UINTN
- );
-BOOLEAN
-HAboveCurrentScreen (
- UINTN
- );
-BOOLEAN
-HUnderCurrentScreen (
- UINTN
- );
-
-EFI_STATUS
-HBufferImageScrollRight (
- VOID
- );
-EFI_STATUS
-HBufferImageScrollLeft (
- VOID
- );
-EFI_STATUS
-HBufferImageScrollDown (
- VOID
- );
-EFI_STATUS
-HBufferImageScrollUp (
- VOID
- );
-EFI_STATUS
-HBufferImagePageUp (
- VOID
- );
-EFI_STATUS
-HBufferImagePageDown (
- VOID
- );
-EFI_STATUS
-HBufferImageHome (
- VOID
- );
-EFI_STATUS
-HBufferImageEnd (
- VOID
- );
-
-EFI_STATUS
-HBufferImageDoBackspace (
- VOID
- );
-EFI_STATUS
-HBufferImageDoDelete (
- VOID
- );
-
-EFI_STATUS
-HBufferImageCutLine (
- HEFI_EDITOR_LINE **
- );
-EFI_STATUS
-HBufferImagePasteLine (
+**/
+HEFI_EDITOR_LINE *
+HBufferImageCreateLine (
VOID
);
-EFI_STATUS
-HBufferImageGetFileInfo (
- EFI_FILE_HANDLE,
- CHAR16 *,
- EFI_FILE_INFO **
- );
-
-EFI_STATUS
-HBufferImageSearch (
- CHAR16 *,
- UINTN
- );
-EFI_STATUS
-HBufferImageReplace (
- CHAR16 *,
- UINTN
- );
-
-/**
+/**
Free the current image.
@retval EFI_SUCCESS The operation was successful.
@@ -198,58 +173,105 @@ HBufferImageFree (
VOID
);
+/**
+ Delete character from buffer.
+
+ @param[in] Pos Position, Pos starting from 0.
+ @param[in] Count The Count of characters to delete.
+ @param[out] DeleteBuffer The DeleteBuffer.
+
+ @retval EFI_SUCCESS Success
+**/
EFI_STATUS
HBufferImageDeleteCharacterFromBuffer (
- IN UINTN,
- IN UINTN,
- UINT8 *
+ IN UINTN Pos,
+ IN UINTN Count,
+ OUT UINT8 *DeleteBuffer
);
+/**
+ Add character to buffer, add before pos.
+
+ @param[in] Pos Position, Pos starting from 0.
+ @param[in] Count Count of characters to add.
+ @param[in] AddBuffer Add buffer.
+
+ @retval EFI_SUCCESS Success.
+**/
EFI_STATUS
HBufferImageAddCharacterToBuffer (
- IN UINTN,
- IN UINTN,
- UINT8 *
+ IN UINTN Pos,
+ IN UINTN Count,
+ IN UINT8 *AddBuffer
);
+/**
+ Change the raw buffer to a list of lines for the UI.
+
+ @param[in] Buffer The pointer to the buffer to fill.
+ @param[in] Bytes The size of the buffer in bytes.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
+EFIAPI
HBufferImageBufferToList (
- IN VOID *,
- IN UINTN
+ IN VOID *Buffer,
+ IN UINTN Bytes
);
+/**
+ Change the list of lines from the UI to a raw buffer.
+
+ @param[in] Buffer The pointer to the buffer to fill.
+ @param[in] Bytes The size of the buffer in bytes.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
+EFIAPI
HBufferImageListToBuffer (
- IN VOID *,
- IN UINTN
+ IN VOID *Buffer,
+ IN UINTN Bytes
);
+/**
+ Move the mouse in the image buffer.
+
+ @param[in] TextX The x-coordinate.
+ @param[in] TextY The y-coordinate.
+**/
VOID
+EFIAPI
HBufferImageAdjustMousePosition (
- INT32,
- INT32
+ IN INT32 TextX,
+ IN INT32 TextY
);
+/**
+ Function to decide if a column number is stored in the high bits.
+
+ @param[in] Column The column to examine.
+ @param[out] FCol The actual column number.
+
+ @retval TRUE The actual column was in high bits and is now in FCol.
+ @retval FALSE There was not a column number in the high bits.
+**/
BOOLEAN
HBufferImageIsAtHighBits (
- UINTN,
- UINTN *
- ) ;
-
-EFI_STATUS
-HBufferImageCutLine (
- HEFI_EDITOR_LINE **
+ IN UINTN Column,
+ OUT UINTN *FCol
);
+/**
+ Get the size of the open buffer.
+
+ @retval The size in bytes.
+**/
UINTN
HBufferImageGetTotalSize (
VOID
);
-BOOLEAN
-HBufferImageIsInSelectedArea (
- UINTN,
- UINTN
- );
-
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
index 2408027abb..4d5bfb391f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.c
@@ -14,6 +14,11 @@
#include "HexEditor.h"
+typedef struct {
+ UINT8 *Buffer;
+ UINTN Size;
+} HEFI_EDITOR_CLIPBOARD;
+
HEFI_EDITOR_CLIPBOARD HClipBoard;
//
@@ -24,26 +29,16 @@ HEFI_EDITOR_CLIPBOARD HClipBoardConst = {
0
};
+/**
+ Initialization function for HDiskImage.
+
+ @param[in] EFI_SUCCESS The operation was successful.
+ @param[in] EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HClipBoardInit (
VOID
)
-/*++
-
-Routine Description:
-
- Initialization function for HDiskImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
//
// basiclly initialize the HDiskImage
@@ -53,26 +48,16 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Initialization function for HDiskImage.
+
+ @param[in] EFI_SUCCESS The operation was successful.
+ @param[in] EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HClipBoardCleanup (
VOID
)
-/*++
-
-Routine Description:
-
- Initialization function for HDiskImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
SHELL_FREE_NON_NULL (HClipBoard.Buffer);
@@ -80,6 +65,14 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Set a buffer into the clipboard.
+
+ @param[in] Buffer The buffer to add to the clipboard.
+ @param[in] Size The size of Buffer in bytes.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HClipBoardSet (
IN UINT8 *Buffer,
@@ -98,6 +91,13 @@ HClipBoardSet (
return EFI_SUCCESS;
}
+/**
+ Get a buffer from the clipboard.
+
+ @param[out] Buffer The pointer to the buffer to add to the clipboard.
+
+ @return the size of the buffer.
+**/
UINTN
HClipBoardGet (
OUT UINT8 **Buffer
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
index 9165d98f30..8066c29247 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Clipboard.h
@@ -18,23 +18,52 @@
#include "HexEditor.h"
+/**
+ Initialization function for HDiskImage
+
+ @param[in] EFI_SUCCESS The operation was successful.
+ @param[in] EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HClipBoardInit (
VOID
);
+
+/**
+ Initialization function for HDiskImage.
+
+ @param[in] EFI_SUCCESS The operation was successful.
+ @param[in] EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HClipBoardCleanup (
VOID
);
+/**
+ Set a buffer into the clipboard.
+
+ @param[in] Buffer The buffer to add to the clipboard.
+ @param[in] Size The size of Buffer in bytes.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HClipBoardSet (
- UINT8 *,
- UINTN
+ IN UINT8 *Buffer,
+ IN UINTN Size
);
+
+/**
+ Get a buffer from the clipboard.
+
+ @param[out] Buffer The pointer to the buffer to add to the clipboard.
+
+ @return the size of the buffer.
+**/
UINTN
HClipBoardGet (
- UINT8 **
+ OUT UINT8 **Buffer
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
index 86db6aadf2..c956f77b28 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.c
@@ -37,26 +37,16 @@ HEFI_EDITOR_DISK_IMAGE HDiskImageConst = {
0
};
+/**
+ Initialization function for HDiskImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HDiskImageInit (
VOID
)
-/*++
-
-Routine Description:
-
- Initialization function for HDiskImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
//
// basically initialize the HDiskImage
@@ -68,29 +58,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Backup function for HDiskImage. Only a few fields need to be backup.
+ This is for making the Disk buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES gST->ConOut of resources.
+**/
EFI_STATUS
HDiskImageBackup (
VOID
)
-/*++
-
-Routine Description:
-
- Backup function for HDiskImage
- Only a few fields need to be backup.
- This is for making the Disk buffer refresh
- as few as possible.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS - Success
- EFI_OUT_OF_RESOURCES - gST->ConOut of resources
-
---*/
{
//
// backup the disk name, offset and size
@@ -109,25 +87,15 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Cleanup function for HDiskImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HDiskImageCleanup (
VOID
)
-/*++
-
-Routine Description:
-
- Cleanup function for HDiskImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
{
SHELL_FREE_NON_NULL (HDiskImage.Name);
SHELL_FREE_NON_NULL (HDiskImageBackupVar.Name);
@@ -135,6 +103,16 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Set FileName field in HFileImage.
+
+ @param[in] Str File name to set.
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
EFIAPI
HDiskImageSetDiskNameOffsetSize (
@@ -142,24 +120,6 @@ HDiskImageSetDiskNameOffsetSize (
IN UINTN Offset,
IN UINTN Size
)
-/*++
-
-Routine Description:
-
- Set FileName field in HFileImage
-
-Arguments:
-
- Str - File name to set
- Offset - The offset
- Size - The size
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
-
---*/
{
UINTN Len;
UINTN Index;
@@ -188,6 +148,19 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Read a disk from disk into HBufferImage.
+
+ @param[in] DeviceName filename to read.
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+ @param[in] Recover if is for recover, no information print.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_INVALID_PARAMETER A parameter was invalid.
+**/
EFI_STATUS
HDiskImageRead (
IN CONST CHAR16 *DeviceName,
@@ -195,27 +168,6 @@ HDiskImageRead (
IN UINTN Size,
IN BOOLEAN Recover
)
-/*++
-
-Routine Description:
-
- Read a disk from disk into HBufferImage
-
-Arguments:
-
- DeviceName - filename to read
- Offset - The offset
- Size - The size
- Recover - if is for recover, no information print
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
- EFI_INVALID_PARAMETER
-
---*/
{
CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
EFI_DEVICE_PATH_PROTOCOL *DupDevicePath;
@@ -374,33 +326,25 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Save lines in HBufferImage to disk.
+ NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
+
+ @param[in] DeviceName The device name.
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_INVALID_PARAMETER A parameter was invalid.
+**/
EFI_STATUS
HDiskImageSave (
IN CHAR16 *DeviceName,
IN UINTN Offset,
IN UINTN Size
)
-/*++
-
-Routine Description:
-
- Save lines in HBufferImage to disk
- NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
-
-Arguments:
-
- DeviceName - The device name
- Offset - The offset
- Size - The size
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
- EFI_INVALID_PARAMETER
-
---*/
{
CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
index eaa8e2615d..06fb53020a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/DiskImage.h
@@ -18,31 +18,78 @@
#include "HexEditor.h"
+/**
+ Initialization function for HDiskImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HDiskImageInit (
VOID
);
+
+/**
+ Cleanup function for HDiskImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HDiskImageCleanup (
VOID
);
+
+/**
+ Backup function for HDiskImage. Only a few fields need to be backup.
+ This is for making the Disk buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES gST->ConOut of resources.
+**/
EFI_STATUS
HDiskImageBackup (
VOID
);
+/**
+ Read a disk from disk into HBufferImage.
+
+ @param[in] DeviceName filename to read.
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+ @param[in] Recover if is for recover, no information print.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_INVALID_PARAMETER A parameter was invalid.
+**/
EFI_STATUS
HDiskImageRead (
- IN CONST CHAR16 *,
- IN UINTN,
- IN UINTN,
- IN BOOLEAN
+ IN CONST CHAR16 *DeviceName,
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
);
+
+/**
+ Save lines in HBufferImage to disk.
+ NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
+
+ @param[in] DeviceName The device name.
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_INVALID_PARAMETER A parameter was invalid.
+**/
EFI_STATUS
HDiskImageSave (
- IN CHAR16 *,
- IN UINTN,
- IN UINTN
+ IN CHAR16 *DeviceName,
+ IN UINTN Offset,
+ IN UINTN Size
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
index 5397071b3b..8562662638 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.c
@@ -35,26 +35,15 @@ HEFI_EDITOR_BUFFER_IMAGE HFileImageConst = {
FALSE
};
+/**
+ Initialization function for HFileImage
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFileImageInit (
VOID
)
-/*++
-
-Routine Description:
-
- Initialization function for HFileImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
//
// basically initialize the HFileImage
@@ -70,29 +59,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Backup function for HFileImage. Only a few fields need to be backup.
+ This is for making the file buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HFileImageBackup (
VOID
)
-/*++
-
-Routine Description:
-
- Backup function for HFileImage
- Only a few fields need to be backup.
- This is for making the file buffer refresh
- as few as possible.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
-
---*/
{
SHELL_FREE_NON_NULL (HFileImageBackupVar.FileName);
HFileImageBackupVar.FileName = CatSPrint(NULL, L"%s", HFileImage.FileName);
@@ -103,25 +80,15 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Cleanup function for HFileImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFileImageCleanup (
VOID
)
-/*++
-
-Routine Description:
-
- Cleanup function for HFileImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
{
SHELL_FREE_NON_NULL (HFileImage.FileName);
@@ -130,26 +97,18 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Set FileName field in HFileImage
+
+ @param[in] Str File name to set.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HFileImageSetFileName (
IN CONST CHAR16 *Str
)
-/*++
-
-Routine Description:
-
- Set FileName field in HFileImage
-
-Arguments:
-
- Str -- File name to set
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
-
---*/
{
UINTN Size;
UINTN Index;
@@ -175,79 +134,21 @@ Returns:
return EFI_SUCCESS;
}
-EFI_STATUS
-HFileImageGetFileInfo (
- IN EFI_FILE_HANDLE Handle,
- IN CHAR16 *FileName,
- OUT EFI_FILE_INFO **InfoOut
- )
-/*++
-
-Routine Description:
-
- Get this file's information
-
-Arguments:
-
- Handle - in NT32 mode Directory handle, in other mode File Handle
- FileName - The file name
- InfoOut - parameter to pass file information out
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
- EFI_LOAD_ERROR
-
---*/
-{
-
- VOID *Info;
- UINTN Size;
- EFI_STATUS Status;
-
- Size = SIZE_OF_EFI_FILE_INFO + 1024;
- Info = AllocateZeroPool (Size);
- if (!Info) {
- return EFI_OUT_OF_RESOURCES;
- }
- //
- // get file information
- //
- Status = Handle->GetInfo (Handle, &gEfiFileInfoGuid, &Size, Info);
- if (EFI_ERROR (Status)) {
- return EFI_LOAD_ERROR;
- }
-
- *InfoOut = (EFI_FILE_INFO *) Info;
+/**
+ Read a file from disk into HBufferImage.
- return EFI_SUCCESS;
-
-}
+ @param[in] FileName filename to read.
+ @param[in] Recover if is for recover, no information print.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HFileImageRead (
IN CONST CHAR16 *FileName,
IN BOOLEAN Recover
)
-/*++
-
-Routine Description:
-
- Read a file from disk into HBufferImage
-
-Arguments:
-
- FileName -- filename to read
- Recover -- if is for recover, no information print
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
HEFI_EDITOR_LINE *Line;
UINT8 *Buffer;
@@ -343,27 +244,19 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Save lines in HBufferImage to disk.
+
+ @param[in] FileName The file name.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HFileImageSave (
IN CHAR16 *FileName
)
-/*++
-
-Routine Description:
-
- Save lines in HBufferImage to disk
-
-Arguments:
-
- FileName - The file name
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
LIST_ENTRY *Link;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
index ae386d2fc9..ed27ad03ae 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/FileImage.h
@@ -18,39 +18,66 @@
#include "HexEditor.h"
+/**
+ Initialization function for HFileImage
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFileImageInit (
VOID
);
+
+/**
+ Cleanup function for HFileImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFileImageCleanup (
VOID
);
+
+/**
+ Backup function for HFileImage. Only a few fields need to be backup.
+ This is for making the file buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HFileImageBackup (
VOID
);
-EFI_STATUS
-HFileImageSetFileName (
- IN CONST CHAR16 *
- );
+/**
+ Read a file from disk into HBufferImage.
-EFI_STATUS
-HFileImageGetFileInfo (
- EFI_FILE_HANDLE,
- CHAR16 *,
- EFI_FILE_INFO **
- );
+ @param[in] FileName filename to read.
+ @param[in] Recover if is for recover, no information print.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HFileImageRead (
- IN CONST CHAR16 *,
- IN BOOLEAN
+ IN CONST CHAR16 *FileName,
+ IN BOOLEAN Recover
);
+
+/**
+ Save lines in HBufferImage to disk.
+
+ @param[in] FileName The file name.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HFileImageSave (
- IN CHAR16 *
+ IN CHAR16 *FileName
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
index 51c9f44cd5..2849f2b413 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexEditorTypes.h
@@ -110,13 +110,7 @@ typedef struct {
} HEFI_EDITOR_BUFFER_IMAGE;
typedef struct {
- UINT8 *Buffer;
- UINTN Size;
-} HEFI_EDITOR_CLIPBOARD;
-
-typedef struct {
HEFI_EDITOR_BUFFER_IMAGE *BufferImage;
- HEFI_EDITOR_CLIPBOARD *Clipboard;
HEFI_EDITOR_COLOR_UNION ColorAttributes;
HEFI_EDITOR_POSITION ScreenSize; // row number and column number
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
index 58c25f81d4..73fa4c238d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.c
@@ -37,8 +37,6 @@ BOOLEAN HEditorMouseAction;
extern HEFI_EDITOR_BUFFER_IMAGE HBufferImage;
extern HEFI_EDITOR_BUFFER_IMAGE HBufferImageBackupVar;
-extern HEFI_EDITOR_CLIPBOARD HClipBoard;
-
extern BOOLEAN HBufferImageMouseNeedRefresh;
extern BOOLEAN HBufferImageNeedRefresh;
extern BOOLEAN HBufferImageOnlyLineNeedRefresh;
@@ -51,7 +49,6 @@ HEFI_EDITOR_GLOBAL_EDITOR HMainEditorBackupVar;
//
HEFI_EDITOR_GLOBAL_EDITOR HMainEditorConst = {
&HBufferImage,
- &HClipBoard,
{
0,
0
@@ -68,25 +65,15 @@ HEFI_EDITOR_GLOBAL_EDITOR HMainEditorConst = {
1
};
+/**
+ Move cursor to specified lines.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HMainCommandGoToOffset (
VOID
)
-/*++
-
-Routine Description:
-
- move cursor to specified lines
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
{
UINTN Size;
UINT64 Offset;
@@ -157,29 +144,19 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Save current opened buffer.
+ If is file buffer, you can save to current file name or
+ save to another file name.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandSaveBuffer (
VOID
)
-/*++
-
-Routine Description:
-
- save current opened buffer .
- if is file buffer, you can save to current file name or
- save to another file name
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
- EFI_LOAD_ERROR
-
---*/
{
EFI_STATUS Status;
BOOLEAN Done;
@@ -190,7 +167,7 @@ Returns:
SHELL_FILE_HANDLE ShellFileHandle;
if (HMainEditor.BufferImage->BufferType != FileTypeFileBuffer) {
- if (HMainEditor.BufferImage->Modified == FALSE) {
+ if (!HMainEditor.BufferImage->Modified) {
return EFI_SUCCESS;
}
@@ -381,7 +358,7 @@ Returns:
//
// if the file is read only, so can not write back to it.
//
- if (HMainEditor.BufferImage->FileImage->ReadOnly == TRUE) {
+ if (HMainEditor.BufferImage->FileImage->ReadOnly) {
StatusBarSetStatusString (L"Access Denied");
SHELL_FREE_NON_NULL (FileName);
return EFI_SUCCESS;
@@ -467,27 +444,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Load a disk buffer editor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandSelectStart (
VOID
)
-/*++
-
-Routine Description:
-
- Load a disk buffer editor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
UINTN Start;
@@ -515,27 +482,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Load a disk buffer editor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandSelectEnd (
VOID
)
-/*++
-
-Routine Description:
-
- Load a disk buffer editor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
UINTN End;
@@ -563,27 +520,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Cut current line to clipboard.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandCut (
VOID
)
-/*++
-
-Routine Description:
-
- cut current line to clipboard
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
- EFI_LOAD_ERROR
-
---*/
{
UINTN Index;
HEFI_EDITOR_LINE *Line;
@@ -648,28 +595,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Paste line to file buffer.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandPaste (
VOID
)
-/*++
-
-Routine Description:
-
- paste line to file buffer
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
- EFI_LOAD_ERROR
-
-
---*/
{
BOOLEAN OnlyLineRefresh;
@@ -719,27 +655,17 @@ Returns:
}
+/**
+ Exit editor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandExit (
VOID
)
-/*++
-
-Routine Description:
-
- exit editor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
- EFI_LOAD_ERROR
-
---*/
{
EFI_STATUS Status;
@@ -822,27 +748,17 @@ Returns:
}
+/**
+ Load a file from disk to editor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainCommandOpenFile (
VOID
)
-/*++
-
-Routine Description:
-
- Load a file from disk to editor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
BOOLEAN Done;
EFI_STATUS Status;
@@ -1065,28 +981,18 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Load a disk buffer editor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_NOT_FOUND The disk was not found.
+**/
EFI_STATUS
HMainCommandOpenDisk (
VOID
)
-/*++
-
-Routine Description:
-
- Load a disk buffer editor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
- EFI_NOT_FOUND
-
---*/
{
UINT64 Size;
UINT64 Offset;
@@ -1320,28 +1226,18 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Load memory content to editor
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_NOT_FOUND The disk was not found.
+**/
EFI_STATUS
HMainCommandOpenMemory (
VOID
)
-/*++
-
-Routine Description:
-
- Load memory content to editor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
- EFI_NOT_FOUND
-
---*/
{
UINT64 Size;
UINT64 Offset;
@@ -1604,27 +1500,16 @@ CONST EDITOR_MENU_ITEM HexEditorMenuItems[] = {
}
};
+/**
+ Init function for MainEditor
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainEditorInit (
VOID
)
-/*++
-
-Routine Description:
-
- Init function for MainEditor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
EFI_STATUS Status;
EFI_HANDLE *HandleBuffer;
@@ -1754,26 +1639,16 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Cleanup function for MainEditor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainEditorCleanup (
VOID
)
-/*++
-
-Routine Description:
-
- cleanup function for MainEditor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
EFI_STATUS Status;
@@ -1813,25 +1688,15 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Refresh function for MainEditor.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HMainEditorRefresh (
VOID
)
-/*++
-
-Routine Description:
-
- Refresh function for MainEditor
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
{
BOOLEAN NameChange;
BOOLEAN ReadChange;
@@ -1874,8 +1739,8 @@ Returns:
HMainEditor.BufferImage->Modified,
HMainEditor.ScreenSize.Column,
HMainEditor.ScreenSize.Row,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Offset:0,
- HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer?HMainEditor.BufferImage->MemImage->Size :0
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Offset:HMainEditor.BufferImage->BufferType == FileTypeMemBuffer&&HMainEditor.BufferImage->MemImage!=NULL?HMainEditor.BufferImage->MemImage->Offset:0,
+ HMainEditor.BufferImage->BufferType == FileTypeDiskBuffer&&HMainEditor.BufferImage->DiskImage!=NULL?HMainEditor.BufferImage->DiskImage->Size :HMainEditor.BufferImage->BufferType == FileTypeMemBuffer&&HMainEditor.BufferImage->MemImage!=NULL?HMainEditor.BufferImage->MemImage->Size :0
);
HBufferImageRefresh ();
}
@@ -1910,7 +1775,17 @@ Returns:
return EFI_SUCCESS;
}
-STATIC
+/**
+ Handle the mouse input.
+
+ @param[in] MouseState The current mouse state.
+ @param[out] BeforeLeftButtonDown helps with selections.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_NOT_FOUND The disk was not found.
+**/
EFI_STATUS
HMainEditorHandleMouseInput (
IN EFI_SIMPLE_POINTER_STATE MouseState,
@@ -2046,7 +1921,7 @@ HMainEditorHandleMouseInput (
//
// release LButton
//
- if (*BeforeLeftButtonDown == TRUE) {
+ if (*BeforeLeftButtonDown) {
Action = TRUE;
}
//
@@ -2062,27 +1937,17 @@ HMainEditorHandleMouseInput (
return EFI_NOT_FOUND;
}
+/**
+ Handle user key input. will route it to other components handle function.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainEditorKeyInput (
VOID
)
-/*++
-
-Routine Description:
-
- Handle user key input. will route it to other components handle function
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
EFI_INPUT_KEY Key;
EFI_STATUS Status;
@@ -2142,11 +2007,11 @@ Returns:
Status = HMainEditorHandleMouseInput (MouseState, &MouseIsDown);
if (!EFI_ERROR (Status)) {
- if (BeforeMouseIsDown == FALSE) {
+ if (!BeforeMouseIsDown) {
//
// mouse down
//
- if (MouseIsDown == TRUE) {
+ if (MouseIsDown) {
FRow = HBufferImage.BufferPosition.Row;
FCol = HBufferImage.BufferPosition.Column;
SelectStartBackup = HMainEditor.SelectStart;
@@ -2162,8 +2027,8 @@ Returns:
//
// begin to drag
//
- if (MouseIsDown == TRUE) {
- if (FirstDown == TRUE) {
+ if (MouseIsDown) {
+ if (FirstDown) {
if (MouseState.RelativeMovementX || MouseState.RelativeMovementY) {
HMainEditor.SelectStart = 0;
HMainEditor.SelectEnd = 0;
@@ -2301,7 +2166,7 @@ Returns:
break;
}
- if (LengthChange == FALSE) {
+ if (!LengthChange) {
if (OldSize != Size) {
StatusBarSetStatusString (L"Disk/Mem Buffer Length should not be changed");
}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h
index c4f2ea6382..ad9a7b4be8 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MainHexEditor.h
@@ -20,18 +20,45 @@
#include "HexEditor.h"
+/**
+ Init function for MainEditor
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainEditorInit (
VOID
);
+
+/**
+ Cleanup function for MainEditor.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainEditorCleanup (
VOID
);
+
+/**
+ Refresh function for MainEditor.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HMainEditorRefresh (
VOID
);
+
+/**
+ Handle user key input. will route it to other components handle function.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation occured.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMainEditorKeyInput (
VOID
@@ -45,4 +72,5 @@ EFIAPI
HMainEditorBackup (
VOID
);
+
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
index 73464906b4..a593d0afec 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.c
@@ -38,6 +38,17 @@ HEFI_EDITOR_MEM_IMAGE HMemImageConst = {
0
};
+/**
+ Empty function. always returns the same.
+
+ @param[in] This Ignored.
+ @param[in] Width Ignored.
+ @param[in] Address Ignored.
+ @param[in] Count Ignored.
+ @param[in,out] Buffer Ignored.
+
+ @retval EFI_UNSUPPORTED.
+**/
EFI_STATUS
DummyMemRead (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
@@ -45,8 +56,22 @@ DummyMemRead (
IN UINT64 Address,
IN UINTN Count,
IN OUT VOID *Buffer
- );
+ )
+{
+ return EFI_UNSUPPORTED;
+}
+
+/**
+ Empty function. always returns the same.
+
+ @param[in] This Ignored.
+ @param[in] Width Ignored.
+ @param[in] Address Ignored.
+ @param[in] Count Ignored.
+ @param[in,out] Buffer Ignored.
+ @retval EFI_UNSUPPORTED.
+**/
EFI_STATUS
DummyMemWrite (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
@@ -54,28 +79,21 @@ DummyMemWrite (
IN UINT64 Address,
IN UINTN Count,
IN OUT VOID *Buffer
- );
+ )
+{
+ return EFI_UNSUPPORTED;
+}
+
+/**
+ Initialization function for HDiskImage.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMemImageInit (
VOID
)
-/*++
-
-Routine Description:
-
- Initialization function for HDiskImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
-
---*/
{
EFI_STATUS Status;
@@ -107,28 +125,16 @@ Returns:
}
}
+/**
+ Backup function for HDiskImage. Only a few fields need to be backup.
+ This is for making the Disk buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HMemImageBackup (
VOID
)
-/*++
-
-Routine Description:
-
- Backup function for HDiskImage
- Only a few fields need to be backup.
- This is for making the Disk buffer refresh
- as few as possible.
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
{
HMemImageBackupVar.Offset = HMemImage.Offset;
HMemImageBackupVar.Size = HMemImage.Size;
@@ -136,51 +142,20 @@ Returns:
return EFI_SUCCESS;
}
-EFI_STATUS
-HMemImageCleanup (
- VOID
- )
-/*++
-
-Routine Description:
+/**
+ Set FileName field in HFileImage.
- Cleanup function for HDiskImage
-
-Arguments:
-
- None
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- return EFI_SUCCESS;
-}
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HMemImageSetMemOffsetSize (
IN UINTN Offset,
IN UINTN Size
)
-/*++
-
-Routine Description:
-
- Set FileName field in HFileImage
-
-Arguments:
-
- Offset - The offset
- Size - The size
-
-Returns:
-
- EFI_SUCCESS
- EFI_OUT_OF_RESOURCES
-
---*/
{
HMemImage.Offset = Offset;
@@ -189,31 +164,23 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Read a disk from disk into HBufferImage.
+
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+ @param[in] Recover if is for recover, no information print.
+
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HMemImageRead (
- IN UINTN Offset,
- IN UINTN Size,
- BOOLEAN Recover
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
)
-/*++
-
-Routine Description:
-
- Read a disk from disk into HBufferImage
-
-Arguments:
-
- Offset - The offset
- Size - The size
- Recover - if is for recover, no information print
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
EFI_STATUS Status;
@@ -312,29 +279,21 @@ Returns:
}
+/**
+ Save lines in HBufferImage to disk.
+
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HMemImageSave (
IN UINTN Offset,
IN UINTN Size
)
-/*++
-
-Routine Description:
-
- Save lines in HBufferImage to disk
-
-Arguments:
-
- Offset - The offset
- Size - The size
-
-Returns:
-
- EFI_SUCCESS
- EFI_LOAD_ERROR
- EFI_OUT_OF_RESOURCES
-
---*/
{
EFI_STATUS Status;
@@ -387,26 +346,4 @@ Returns:
return EFI_SUCCESS;
}
-EFI_STATUS
-DummyMemRead (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
-EFI_STATUS
-DummyMemWrite (
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL * This,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL_WIDTH Width,
- IN UINT64 Address,
- IN UINTN Count,
- IN OUT VOID *Buffer
- )
-{
- return EFI_UNSUPPORTED;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
index 8805c0d75d..54fe517858 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/MemImage.h
@@ -18,35 +18,75 @@
#include "HexEditor.h"
+/**
+ Initialization function for HDiskImage.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_LOAD_ERROR A load error occured.
+**/
EFI_STATUS
HMemImageInit (
VOID
);
-EFI_STATUS
-HMemImageCleanup (
- VOID
- );
+
+/**
+ Backup function for HDiskImage. Only a few fields need to be backup.
+ This is for making the Disk buffer refresh as few as possible.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HMemImageBackup (
VOID
);
+/**
+ Set FileName field in HFileImage.
+
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HMemImageSetMemOffsetSize (
- IN UINTN,
- IN UINTN
+ IN UINTN Offset,
+ IN UINTN Size
);
+/**
+ Read a disk from disk into HBufferImage.
+
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+ @param[in] Recover if is for recover, no information print.
+
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HMemImageRead (
- IN UINTN,
- IN UINTN,
- IN BOOLEAN
+ IN UINTN Offset,
+ IN UINTN Size,
+ IN BOOLEAN Recover
);
+
+/**
+ Save lines in HBufferImage to disk.
+
+ @param[in] Offset The offset.
+ @param[in] Size The size.
+
+ @retval EFI_LOAD_ERROR A load error occured.
+ @retval EFI_SUCCESS The operation was successful.
+ @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
+**/
EFI_STATUS
HMemImageSave (
- IN UINTN,
- IN UINTN
+ IN UINTN Offset,
+ IN UINTN Size
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
index da11789625..d6961c5bb7 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.c
@@ -1,7 +1,7 @@
/** @file
Implementation of various string and line routines
- Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
+ Copyright (TempVarC) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -16,119 +16,15 @@
extern BOOLEAN HEditorMouseAction;
-VOID
-HEditorClearLine (
- IN UINTN Row
- )
-/*++
-
-Routine Description:
-
- Clear line at Row
-
-Arguments:
-
- Row -- row number to be cleared ( start from 1 )
-
-Returns:
-
- EFI_SUCCESS
-
---*/
-{
- CHAR16 Line[200];
- UINTN Index;
- UINTN Limit;
- UINTN StartCol;
-
- if (HEditorMouseAction) {
- Limit = 3 * 0x10;
- StartCol = 10;
- } else {
- Limit = HMainEditor.ScreenSize.Column;
- StartCol = 1;
- }
- //
- // prepare a blank line
- //
- for (Index = 0; Index < Limit; Index++) {
- Line[Index] = ' ';
- }
-
- if (Row == HMainEditor.ScreenSize.Row && Limit == HMainEditor.ScreenSize.Column) {
- //
- // if '\0' is still at position 80, it will cause first line error
- //
- Line[Limit - 1] = '\0';
- } else {
- Line[Limit] = '\0';
- }
- //
- // print out the blank line
- //
- ShellPrintEx ((INT32)StartCol - 1, (INT32)Row - 1, Line);
-}
-
-HEFI_EDITOR_LINE *
-HLineDup (
- IN HEFI_EDITOR_LINE *Src
- )
-/*++
-
-Routine Description:
-
- Duplicate a line
-
-Arguments:
-
- Src -- line to be duplicated
-
-Returns:
-
- NULL -- wrong
- Not NULL -- line created
-
---*/
-{
- HEFI_EDITOR_LINE *Dest;
-
- //
- // allocate for the line structure
- //
- Dest = AllocateZeroPool (sizeof (HEFI_EDITOR_LINE));
- if (Dest == NULL) {
- return NULL;
- }
-
- Dest->Signature = EFI_EDITOR_LINE_LIST;
- Dest->Size = Src->Size;
-
- CopyMem (Dest->Buffer, Src->Buffer, 0x10);
-
- Dest->Link = Src->Link;
-
- return Dest;
-}
-
+/**
+ Free a line and it's internal buffer.
+
+ @param[in] Src The line to be freed.
+**/
VOID
HLineFree (
IN HEFI_EDITOR_LINE *Src
)
-/*++
-
-Routine Description:
-
- Free a line and it's internal buffer
-
-Arguments:
-
- Src -- line to be freed
-
-Returns:
-
- None
-
---*/
{
if (Src == NULL) {
return ;
@@ -138,26 +34,18 @@ Returns:
}
+/**
+ Advance to the next Count lines.
+
+ @param[in] Count The line number to advance.
+
+ @retval NULL An error occured.
+ @return A pointer to the line after advance.
+**/
HEFI_EDITOR_LINE *
-_HLineAdvance (
+HLineAdvance (
IN UINTN Count
)
-/*++
-
-Routine Description:
-
- Advance to the next Count lines
-
-Arguments:
-
- Count -- line number to advance
-
-Returns:
-
- NULL -- wrong
- Not NULL -- line after advance
-
---*/
{
UINTN Index;
HEFI_EDITOR_LINE *Line;
@@ -181,26 +69,18 @@ Returns:
return Line;
}
+/**
+ Retreat to the previous Count lines.
+
+ @param[in] Count The line number to retreat.
+
+ @retval NULL An error occured.
+ @return A pointer to the line after retreat.
+**/
HEFI_EDITOR_LINE *
-_HLineRetreat (
+HLineRetreat (
IN UINTN Count
)
-/*++
-
-Routine Description:
-
- Retreat to the previous Count lines
-
-Arguments:
-
- Count -- line number to retreat
-
-Returns:
-
- NULL -- wrong
- Not NULL -- line after retreat
-
---*/
{
UINTN Index;
HEFI_EDITOR_LINE *Line;
@@ -224,28 +104,20 @@ Returns:
return Line;
}
+/**
+ Advance/Retreat lines.
+
+ @param[in] Count The line number to advance/retreat.
+ >0 : advance
+ <0: retreat
+
+ @retval NULL An error occured.
+ @return A pointer to the line after move.
+**/
HEFI_EDITOR_LINE *
HMoveLine (
IN INTN Count
)
-/*++
-
-Routine Description:
-
- Advance/Retreat lines
-
-Arguments:
-
- Count -- line number to advance/retreat
- >0 : advance
- <0: retreat
-
-Returns:
-
- NULL -- wrong
- Not NULL -- line after advance
-
---*/
{
HEFI_EDITOR_LINE *Line;
UINTN AbsCount;
@@ -257,37 +129,28 @@ Returns:
//
if (Count <= 0) {
AbsCount = (UINTN)ABS(Count);
- Line = _HLineRetreat (AbsCount);
+ Line = HLineRetreat (AbsCount);
} else {
- Line = _HLineAdvance ((UINTN)Count);
+ Line = HLineAdvance ((UINTN)Count);
}
return Line;
}
+/**
+ Advance/Retreat lines and set CurrentLine in BufferImage to it.
+
+ @param[in] Count The line number to advance/retreat.
+ >0 : advance
+ <0: retreat
+
+ @retval NULL An error occured.
+ @return A pointer to the line after move.
+**/
HEFI_EDITOR_LINE *
HMoveCurrentLine (
IN INTN Count
)
-/*++
-
-Routine Description:
-
- Advance/Retreat lines and set CurrentLine in BufferImage to it
-
-Arguments:
-
- Count -- line number to advance/retreat
- >0 : advance
- <0: retreat
-
-Returns:
-
- NULL -- wrong
- Not NULL -- line after advance
-
-
---*/
{
HEFI_EDITOR_LINE *Line;
UINTN AbsCount;
@@ -298,9 +161,9 @@ Returns:
//
if (Count <= 0) {
AbsCount = (UINTN)ABS(Count);
- Line = _HLineRetreat (AbsCount);
+ Line = HLineRetreat (AbsCount);
} else {
- Line = _HLineAdvance ((UINTN)Count);
+ Line = HLineAdvance ((UINTN)Count);
}
if (Line == NULL) {
@@ -313,34 +176,26 @@ Returns:
}
-EFI_STATUS
-HFreeLines (
- IN LIST_ENTRY *ListHead,
- IN HEFI_EDITOR_LINE *Lines
- )
-/*++
-
-Routine Description:
-
- Free all the lines in HBufferImage
+/**
+ Free all the lines in HBufferImage.
Fields affected:
Lines
CurrentLine
NumLines
ListHead
-Arguments:
-
- ListHead - The list head
- Lines - The lines
-
-Returns:
+ @param[in] ListHead The list head.
+ @param[in] Lines The lines.
- EFI_SUCCESS
-
---*/
+ @retval EFI_SUCCESS The operation was successful.
+**/
+EFI_STATUS
+HFreeLines (
+ IN LIST_ENTRY *ListHead,
+ IN HEFI_EDITOR_LINE *Lines
+ )
{
- LIST_ENTRY *Link;
+ LIST_ENTRY *Link;
HEFI_EDITOR_LINE *Line;
//
@@ -363,83 +218,13 @@ Returns:
return EFI_SUCCESS;
}
-UINTN
-HStrStr (
- IN CHAR16 *Str,
- IN CHAR16 *Pat
- )
-/*++
-
-Routine Description:
-
- Search Pat in Str
-
-Arguments:
-
- Str -- mother string
- Pat -- search pattern
-
-
-Returns:
-
- 0 : not found
- >= 1 : found position + 1
-
---*/
-{
- INTN *Failure;
- INTN i;
- INTN j;
- INTN Lenp;
- INTN Lens;
-
- //
- // this function copies from some lib
- //
- Lenp = StrLen (Pat);
- Lens = StrLen (Str);
+/**
+ Get the X information for the mouse.
- Failure = AllocateZeroPool ((UINTN)(Lenp * sizeof (INTN)));
- if (Failure == NULL) {
- return 0;
- }
- Failure[0] = -1;
- for (j = 1; j < Lenp; j++) {
- i = Failure[j - 1];
- while ((Pat[j] != Pat[i + 1]) && (i >= 0)) {
- i = Failure[i];
- }
-
- if (Pat[j] == Pat[i + 1]) {
- Failure[j] = i + 1;
- } else {
- Failure[j] = -1;
- }
- }
-
- i = 0;
- j = 0;
- while (i < Lens && j < Lenp) {
- if (Str[i] == Pat[j]) {
- i++;
- j++;
- } else if (j == 0) {
- i++;
- } else {
- j = Failure[j - 1] + 1;
- }
- }
-
- FreePool (Failure);
-
- //
- // 0: not found
- // >=1 : found position + 1
- //
- return ((j == Lenp) ? (i - Lenp) : -1) + 1;
-
-}
+ @param[in] GuidX The change.
+ @return the new information.
+**/
INT32
HGetTextX (
IN INT32 GuidX
@@ -454,6 +239,13 @@ HGetTextX (
return Gap;
}
+/**
+ Get the Y information for the mouse.
+
+ @param[in] GuidY The change.
+
+ @return the new information.
+**/
INT32
HGetTextY (
IN INT32 GuidY
@@ -468,77 +260,3 @@ HGetTextY (
return Gap;
}
-
-EFI_STATUS
-HXtoi (
- IN CHAR16 *Str,
- OUT UINTN *Value
- )
-/*++
-Routine Description:
-
- convert hex string to uint
-
-Arguments:
-
- Str - The string
- Value - The value
-
-Returns:
-
-
---*/
-{
- UINT64 u;
- CHAR16 c;
- UINTN Size;
-
- Size = sizeof (UINTN);
-
- //
- // skip leading white space
- //
- while (*Str && *Str == ' ') {
- Str += 1;
- }
-
- if (StrLen (Str) > Size * 2) {
- return EFI_LOAD_ERROR;
- }
- //
- // convert hex digits
- //
- u = 0;
- c = *Str;
- while (c) {
- c = *Str;
- Str++;
-
- if (c == 0) {
- break;
- }
- //
- // not valid char
- //
- if (!((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || (c >= '0' && c <= '9') || (c == '\0'))) {
- return EFI_LOAD_ERROR;
- }
-
- if (c >= 'a' && c <= 'f') {
- c -= 'a' - 'A';
- }
-
- if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'F')) {
- u = LShiftU64 (u, 4) + (c - (c >= 'A' ? 'A' - 10 : '0'));
- } else {
- //
- // '\0'
- //
- break;
- }
- }
-
- *Value = (UINTN) u;
-
- return EFI_SUCCESS;
-}
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
index a9b59ff514..df947935b0 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/Misc.h
@@ -17,80 +17,77 @@
#include "HexEditor.h"
-VOID
-HEditorClearLine (
- UINTN
- );
-HEFI_EDITOR_LINE *
-HLineDup (
- HEFI_EDITOR_LINE *
- );
-VOID
-HLineFree (
- HEFI_EDITOR_LINE *
- );
+/**
+ Advance/Retreat lines.
-HEFI_EDITOR_LINE *
+ @param[in] Count The line number to advance/retreat.
+ >0 : advance
+ <0: retreat
+
+ @retval NULL An error occured.
+ @return A pointer to the line after move.
+**/
+HEFI_EDITOR_LINE *
HMoveLine (
- INTN
- );
-HEFI_EDITOR_LINE *
-HMoveCurrentLine (
- INTN
+ IN INTN Count
);
-UINTN
-HLineStrInsert (
- HEFI_EDITOR_LINE *,
- CHAR16,
- UINTN,
- UINTN
- );
+/**
+ Advance/Retreat lines and set CurrentLine in BufferImage to it.
-VOID
-HLineCat (
- HEFI_EDITOR_LINE *,
- HEFI_EDITOR_LINE *
- );
+ @param[in] Count The line number to advance/retreat.
+ >0 : advance
+ <0: retreat
-VOID
-HLineDeleteAt (
- HEFI_EDITOR_LINE *,
- UINTN
+ @retval NULL An error occured.
+ @return A pointer to the line after move.
+**/
+HEFI_EDITOR_LINE *
+HMoveCurrentLine (
+ IN INTN Count
);
-UINTN
-HUnicodeToAscii (
- CHAR16 *,
- UINTN,
- CHAR8 *
- );
+/**
+ Free all the lines in HBufferImage.
+ Fields affected:
+ Lines
+ CurrentLine
+ NumLines
+ ListHead
-UINTN
-HStrStr (
- CHAR16 *,
- CHAR16 *
- );
+ @param[in] ListHead The list head.
+ @param[in] Lines The lines.
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
HFreeLines (
- LIST_ENTRY *,
- HEFI_EDITOR_LINE *
+ IN LIST_ENTRY *ListHead,
+ IN HEFI_EDITOR_LINE *Lines
);
+/**
+ Get the X information for the mouse.
+
+ @param[in] GuidX The change.
+
+ @return the new information.
+**/
INT32
HGetTextX (
- INT32
- ) ;
+ IN INT32 GuidX
+ );
+
+/**
+ Get the Y information for the mouse.
+
+ @param[in] GuidY The change.
+
+ @return the new information.
+**/
INT32
HGetTextY (
- INT32
- ) ;
-
-EFI_STATUS
-HXtoi (
- CHAR16 *,
- UINTN *
+ IN INT32 GuidY
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
index d3a33e207c..c6e4a32f6f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c
@@ -1258,90 +1258,26 @@ PCI_CLASS_ENTRY PCIPIFClass_0e00[] = {
}
};
-#define EFI_HEX_DISP_SIZE 32
-BOOLEAN
-PrivateDumpHex (
- IN UINTN Indent,
- IN UINTN Offset,
- IN UINTN DataSize,
- IN VOID *UserData
- )
-/*++
-
-Routine Description:
-
- Add page break feature to the DumpHex
-
-Arguments:
- Indent - The indent space
-
- Offset - The offset
-
- DataSize - The data size
-
- UserData - The data
-
-Returns:
-
- TRUE - The dump is broke
- FALSE - The dump is completed
-
-**/
-{
- UINTN DispSize;
- UINT8 *DispData;
-
- DispSize = EFI_HEX_DISP_SIZE;
- DispData = (UINT8 *) UserData;
-
- while (DataSize!=0) {
- if (ShellGetExecutionBreakFlag ()) {
- return TRUE;
- }
-
- if (DataSize > EFI_HEX_DISP_SIZE) {
- DataSize -= EFI_HEX_DISP_SIZE;
- } else {
- DispSize = DataSize;
- DataSize = 0;
- }
-
- DumpHex (Indent, Offset + DispData - (UINT8 *) UserData, DispSize, DispData);
- DispData += DispSize;
- }
-
- return FALSE;
-}
-
-//
-// Implemetations
-//
-VOID
-PciGetClassStrings (
- IN UINT32 ClassCode,
- IN OUT PCI_CLASS_STRINGS *ClassStrings
- )
-/*++
-Routine Description:
+/**
Generates printable Unicode strings that represent PCI device class,
subclass and programmed I/F based on a value passed to the function.
-Arguments:
-
- ClassCode Value representing the PCI "Class Code" register read from a
+ @param[in] ClassCode Value representing the PCI "Class Code" register read from a
PCI device. The encodings are:
bits 23:16 - Base Class Code
bits 15:8 - Sub-Class Code
bits 7:0 - Programming Interface
- ClassStrings Pointer of PCI_CLASS_STRINGS structure, which contains
+ @param[in,out] ClassStrings Pointer of PCI_CLASS_STRINGS structure, which contains
printable class strings corresponding to ClassCode. The
caller must not modify the strings that are pointed by
the fields in ClassStrings.
-Returns:
-
- None
**/
+VOID
+PciGetClassStrings (
+ IN UINT32 ClassCode,
+ IN OUT PCI_CLASS_STRINGS *ClassStrings
+ )
{
INTN Index;
UINT8 Code;
@@ -1437,25 +1373,18 @@ Returns:
return ;
}
+/**
+ Print strings that represent PCI device class, subclass and programmed I/F.
+
+ @param[in] ClassCodePtr Points to the memory which stores register Class Code in PCI
+ configuation space.
+ @param[in] IncludePIF If the printed string should include the programming I/F part
+**/
VOID
PciPrintClassCode (
IN UINT8 *ClassCodePtr,
IN BOOLEAN IncludePIF
)
-/*++
-Routine Description:
-
- Print strings that represent PCI device class, subclass and programmed I/F
-
-Arguments:
-
- ClassCodePtr Points to the memory which stores register Class Code in PCI
- configuation space.
- IncludePIF If the printed string should include the programming I/F part
-Returns:
-
- None
-**/
{
UINT32 ClassCode;
PCI_CLASS_STRINGS ClassStrings;
@@ -1498,12 +1427,22 @@ Returns:
}
}
-EFI_STATUS
-PciDump (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- );
+/**
+ This function finds out the protocol which is in charge of the given
+ segment, and its bus range covers the current bus number. It lookes
+ each instances of RootBridgeIoProtocol handle, until the one meets the
+ criteria is found.
+
+ @param[in] HandleBuf Buffer which holds all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
+ @param[in] HandleCount Count of all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
+ @param[in] Segment Segment number of device we are dealing with.
+ @param[in] Bus Bus number of device we are dealing with.
+ @param[out] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
+**/
EFI_STATUS
PciFindProtocolInterface (
IN EFI_HANDLE *HandleBuf,
@@ -1513,6 +1452,16 @@ PciFindProtocolInterface (
OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
);
+/**
+ This function gets the protocol interface from the given handle, and
+ obtains its address space descriptors.
+
+ @param[in] Handle The PCI_ROOT_BRIDIGE_IO_PROTOCOL handle.
+ @param[out] IoDev Handle used to access configuration space of PCI device.
+ @param[out] Descriptors Points to the address space descriptors.
+
+ @retval EFI_SUCCESS The command completed successfully
+**/
EFI_STATUS
PciGetProtocolAndResource (
IN EFI_HANDLE Handle,
@@ -1520,6 +1469,19 @@ PciGetProtocolAndResource (
OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
);
+/**
+ This function get the next bus range of given address space descriptors.
+ It also moves the pointer backward a node, to get prepared to be called
+ again.
+
+ @param[in,out] Descriptors Points to current position of a serial of address space
+ descriptors.
+ @param[out] MinBus The lower range of bus number.
+ @param[out] ManBus The upper range of bus number.
+ @param[out] IsEnd Meet end of the serial of descriptors.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciGetNextBusRange (
IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors,
@@ -1528,6 +1490,17 @@ PciGetNextBusRange (
OUT BOOLEAN *IsEnd
);
+/**
+ Explain the data in PCI configuration space. The part which is common for
+ PCI device and bridge is interpreted in this function. It calls other
+ functions to interpret data unique for device or bridge.
+
+ @param[in] ConfigSpace Data in PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainData (
IN PCI_CONFIG_SPACE *ConfigSpace,
@@ -1535,6 +1508,15 @@ PciExplainData (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
+/**
+ Explain the device specific part of data in PCI configuration space.
+
+ @param[in] Device Data in PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainDeviceData (
IN PCI_DEVICE_HEADER *Device,
@@ -1542,13 +1524,33 @@ PciExplainDeviceData (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
+/**
+ Explain the bridge specific part of data in PCI configuration space.
+
+ @param[in] Bridge Bridge specific data region in PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainBridgeData (
- IN PCI_BRIDGE_HEADER *Bridge,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ IN PCI_BRIDGE_HEADER *Bridge,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
+/**
+ Explain the Base Address Register(Bar) in PCI configuration space.
+
+ @param[in] Bar Points to the Base Address Register intended to interpret.
+ @param[in] Command Points to the register Command.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+ @param[in,out] Index The Index.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainBar (
IN UINT32 *Bar,
@@ -1558,6 +1560,15 @@ PciExplainBar (
IN OUT UINTN *Index
);
+/**
+ Explain the cardbus specific part of data in PCI configuration space.
+
+ @param[in] CardBus CardBus specific region of PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainCardBusData (
IN PCI_CARDBUS_HEADER *CardBus,
@@ -1565,6 +1576,17 @@ PciExplainCardBusData (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
);
+/**
+ Explain each meaningful bit of register Status. The definition of Status is
+ slightly different depending on the PCI header type.
+
+ @param[in] Status Points to the content of register Status.
+ @param[in] MainStatus Indicates if this register is main status(not secondary
+ status).
+ @param[in] HeaderType Header type of this PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainStatus (
IN UINT16 *Status,
@@ -1572,17 +1594,41 @@ PciExplainStatus (
IN PCI_HEADER_TYPE HeaderType
);
+/**
+ Explain each meaningful bit of register Command.
+
+ @param[in] Command Points to the content of register Command.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainCommand (
IN UINT16 *Command
);
+/**
+ Explain each meaningful bit of register Bridge Control.
+
+ @param[in] BridgeControl Points to the content of register Bridge Control.
+ @param[in] HeaderType The headertype.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainBridgeControl (
IN UINT16 *BridgeControl,
IN PCI_HEADER_TYPE HeaderType
);
+/**
+ Print each capability structure.
+
+ @param[in] IoDev The pointer to the deivce.
+ @param[in] Address The address to start at.
+ @param[in] CapPtr The offset from the address.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
PciExplainCapabilityStruct (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
@@ -1590,6 +1636,13 @@ PciExplainCapabilityStruct (
IN UINT8 CapPtr
);
+/**
+ Display Pcie device structure.
+
+ @param[in] IoDev The pointer to the root pci protocol.
+ @param[in] Address The Address to start at.
+ @param[in] CapabilityPtr The offset from the address to start.
+**/
EFI_STATUS
PciExplainPciExpress (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
@@ -1597,70 +1650,161 @@ PciExplainPciExpress (
IN UINT8 CapabilityPtr
);
+/**
+ Print out information of the capability information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieCapReg (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device capability information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieDeviceCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device control information.
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieDeviceControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+/**
+ Print out information of the device status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieDeviceStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device link information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieLinkCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device link control information.
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieLinkControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+/**
+ Print out information of the device link status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieLinkStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device slot information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieSlotCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device slot control information.
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieSlotControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+/**
+ Print out information of the device slot status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieSlotStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device root information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieRootControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+
+/**
+ Print out information of the device root capability information.
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieRootCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
+/**
+ Print out information of the device root status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieRootStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-);
+ );
typedef EFI_STATUS (*PCIE_EXPLAIN_FUNCTION) (IN PCIE_CAP_STURCTURE *PciExpressCap);
@@ -1871,6 +2015,12 @@ CHAR16 *IndicatorTable[] = {
};
+/**
+ Function for 'pci' command.
+
+ @param[in] ImageHandle Handle to the Image (NULL if Internal).
+ @param[in] SystemTable Pointer to the System Table (NULL if Internal).
+**/
SHELL_STATUS
EFIAPI
ShellCommandRunPci (
@@ -2256,13 +2406,13 @@ ShellCommandRunPci (
//
SizeOfHeader = sizeof (ConfigSpace.Common) + sizeof (ConfigSpace.NonCommon);
- PrivateDumpHex (2, 0, SizeOfHeader, &ConfigSpace);
+ DumpHex (2, 0, SizeOfHeader, &ConfigSpace);
ShellPrintEx(-1,-1, L"\r\n");
//
// Dump device dependent Part of configuration space
//
- PrivateDumpHex (
+ DumpHex (
2,
SizeOfHeader,
sizeof (ConfigSpace) - SizeOfHeader,
@@ -2287,37 +2437,30 @@ Done:
return ShellStatus;
}
-EFI_STATUS
-PciFindProtocolInterface (
- IN EFI_HANDLE *HandleBuf,
- IN UINTN HandleCount,
- IN UINT16 Segment,
- IN UINT16 Bus,
- OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
- )
-/*++
-
-Routine Description:
-
+/**
This function finds out the protocol which is in charge of the given
segment, and its bus range covers the current bus number. It lookes
each instances of RootBridgeIoProtocol handle, until the one meets the
criteria is found.
-Arguments:
-
- HandleBuf Buffer which holds all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles
- HandleCount Count of all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles
- Segment Segment number of device we are dealing with
- Bus Bus number of device we are dealing with
- IoDev Handle used to access configuration space of PCI device
-
-Returns:
+ @param[in] HandleBuf Buffer which holds all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
+ @param[in] HandleCount Count of all PCI_ROOT_BRIDIGE_IO_PROTOCOL handles.
+ @param[in] Segment Segment number of device we are dealing with.
+ @param[in] Bus Bus number of device we are dealing with.
+ @param[out] IoDev Handle used to access configuration space of PCI device.
- EFI_SUCCESS - The command completed successfully
- EFI_INVALID_PARAMETER - Invalid parameter
+ @retval EFI_SUCCESS The command completed successfully.
+ @retval EFI_INVALID_PARAMETER Invalid parameter.
**/
+EFI_STATUS
+PciFindProtocolInterface (
+ IN EFI_HANDLE *HandleBuf,
+ IN UINTN HandleCount,
+ IN UINT16 Segment,
+ IN UINT16 Bus,
+ OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev
+ )
{
UINTN Index;
EFI_STATUS Status;
@@ -2372,30 +2515,22 @@ Returns:
}
}
+/**
+ This function gets the protocol interface from the given handle, and
+ obtains its address space descriptors.
+
+ @param[in] Handle The PCI_ROOT_BRIDIGE_IO_PROTOCOL handle.
+ @param[out] IoDev Handle used to access configuration space of PCI device.
+ @param[out] Descriptors Points to the address space descriptors.
+
+ @retval EFI_SUCCESS The command completed successfully
+**/
EFI_STATUS
PciGetProtocolAndResource (
IN EFI_HANDLE Handle,
OUT EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL **IoDev,
OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors
)
-/*++
-
-Routine Description:
-
- This function gets the protocol interface from the given handle, and
- obtains its address space descriptors.
-
-Arguments:
-
- Handle The PCI_ROOT_BRIDIGE_IO_PROTOCOL handle
- IoDev Handle used to access configuration space of PCI device
- Descriptors Points to the address space descriptors
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
EFI_STATUS Status;
@@ -2424,6 +2559,19 @@ Returns:
}
}
+/**
+ This function get the next bus range of given address space descriptors.
+ It also moves the pointer backward a node, to get prepared to be called
+ again.
+
+ @param[in,out] Descriptors Points to current position of a serial of address space
+ descriptors.
+ @param[out] MinBus The lower range of bus number.
+ @param[out] ManBus The upper range of bus number.
+ @param[out] IsEnd Meet end of the serial of descriptors.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciGetNextBusRange (
IN OUT EFI_ACPI_ADDRESS_SPACE_DESCRIPTOR **Descriptors,
@@ -2431,27 +2579,6 @@ PciGetNextBusRange (
OUT UINT16 *MaxBus,
OUT BOOLEAN *IsEnd
)
-/*++
-
-Routine Description:
-
- This function get the next bus range of given address space descriptors.
- It also moves the pointer backward a node, to get prepared to be called
- again.
-
-Arguments:
-
- Descriptors points to current position of a serial of address space
- descriptors
- MinBus The lower range of bus number
- ManBus The upper range of bus number
- IsEnd Meet end of the serial of descriptors
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
*IsEnd = FALSE;
@@ -2489,31 +2616,23 @@ Returns:
return EFI_SUCCESS;
}
-EFI_STATUS
-PciExplainData (
- IN PCI_CONFIG_SPACE *ConfigSpace,
- IN UINT64 Address,
- IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
- )
-/*++
-
-Routine Description:
-
+/**
Explain the data in PCI configuration space. The part which is common for
PCI device and bridge is interpreted in this function. It calls other
functions to interpret data unique for device or bridge.
-Arguments:
-
- ConfigSpace Data in PCI configuration space
- Address Address used to access configuration space of this PCI device
- IoDev Handle used to access configuration space of PCI device
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
+ @param[in] ConfigSpace Data in PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+ @retval EFI_SUCCESS The command completed successfully.
**/
+EFI_STATUS
+PciExplainData (
+ IN PCI_CONFIG_SPACE *ConfigSpace,
+ IN UINT64 Address,
+ IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
+ )
{
PCI_COMMON_HEADER *Common;
PCI_HEADER_TYPE HeaderType;
@@ -2556,9 +2675,9 @@ Returns:
//
// Print register BIST
//
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_BIST), gShellDebug1HiiHandle, INDEX_OF (&(Common->BIST)));
- if ((Common->BIST & PCI_BIT_7) != 0) {
- ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP), gShellDebug1HiiHandle, 0x0f & Common->BIST);
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_BIST), gShellDebug1HiiHandle, INDEX_OF (&(Common->Bist)));
+ if ((Common->Bist & PCI_BIT_7) != 0) {
+ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP), gShellDebug1HiiHandle, 0x0f & Common->Bist);
} else {
ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_PCI_LINE_CAP_NO), gShellDebug1HiiHandle);
}
@@ -2673,29 +2792,21 @@ Returns:
return Status;
}
+/**
+ Explain the device specific part of data in PCI configuration space.
+
+ @param[in] Device Data in PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainDeviceData (
IN PCI_DEVICE_HEADER *Device,
IN UINT64 Address,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
-/*++
-
-Routine Description:
-
- Explain the device specific part of data in PCI configuration space.
-
-Arguments:
-
- Device Data in PCI configuration space
- Address Address used to access configuration space of this PCI device
- IoDev Handle used to access configuration space of PCI device
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
UINTN Index;
BOOLEAN BarExist;
@@ -2830,29 +2941,21 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Explain the bridge specific part of data in PCI configuration space.
+
+ @param[in] Bridge Bridge specific data region in PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainBridgeData (
IN PCI_BRIDGE_HEADER *Bridge,
IN UINT64 Address,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
-/*++
-
-Routine Description:
-
- Explain the bridge specific part of data in PCI configuration space.
-
-Arguments:
-
- Bridge Bridge specific data region in PCI configuration space
- Address Address used to access configuration space of this PCI device
- IoDev Handle used to access configuration space of PCI device
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
UINTN Index;
BOOLEAN BarExist;
@@ -3039,6 +3142,17 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Explain the Base Address Register(Bar) in PCI configuration space.
+
+ @param[in] Bar Points to the Base Address Register intended to interpret.
+ @param[in] Command Points to the register Command.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+ @param[in,out] Index The Index.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainBar (
IN UINT32 *Bar,
@@ -3047,25 +3161,6 @@ PciExplainBar (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
IN OUT UINTN *Index
)
-/*++
-
-Routine Description:
-
- Explain the Base Address Register(Bar) in PCI configuration space.
-
-Arguments:
-
- Bar Points to the Base Address Register intended to interpret
- Command Points to the register Command
- Address Address used to access configuration space of this PCI device
- IoDev Handle used to access configuration space of PCI device
- Index The Index
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
UINT16 OldCommand;
UINT16 NewCommand;
@@ -3220,29 +3315,21 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Explain the cardbus specific part of data in PCI configuration space.
+
+ @param[in] CardBus CardBus specific region of PCI configuration space.
+ @param[in] Address Address used to access configuration space of this PCI device.
+ @param[in] IoDev Handle used to access configuration space of PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainCardBusData (
IN PCI_CARDBUS_HEADER *CardBus,
IN UINT64 Address,
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev
)
-/*++
-
-Routine Description:
-
- Explain the cardbus specific part of data in PCI configuration space.
-
-Arguments:
-
- CardBus CardBus specific region of PCI configuration space
- Address Address used to access configuration space of this PCI device
- IoDev Handle used to access configuration space of PCI device
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
BOOLEAN Io32Bit;
PCI_CARDBUS_DATA *CardBusData;
@@ -3374,31 +3461,23 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Explain each meaningful bit of register Status. The definition of Status is
+ slightly different depending on the PCI header type.
+
+ @param[in] Status Points to the content of register Status.
+ @param[in] MainStatus Indicates if this register is main status(not secondary
+ status).
+ @param[in] HeaderType Header type of this PCI device.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainStatus (
IN UINT16 *Status,
IN BOOLEAN MainStatus,
IN PCI_HEADER_TYPE HeaderType
)
-/*++
-
-Routine Description:
-
- Explain each meaningful bit of register Status. The definition of Status is
- slightly different depending on the PCI header type.
-
-Arguments:
-
- Status Points to the content of register Status
- MainStatus Indicates if this register is main status(not secondary
- status)
- HeaderType Header type of this PCI device
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
if (MainStatus) {
ShellPrintHiiEx(-1, -1, NULL,STRING_TOKEN (STR_PCI2_STATUS), gShellDebug1HiiHandle, INDEX_OF (Status), *Status);
@@ -3481,25 +3560,17 @@ Returns:
return EFI_SUCCESS;
}
-EFI_STATUS
-PciExplainCommand (
- IN UINT16 *Command
- )
-/*++
-
-Routine Description:
-
+/**
Explain each meaningful bit of register Command.
-Arguments:
-
- Command Points to the content of register Command
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
+ @param[in] Command Points to the content of register Command.
+ @retval EFI_SUCCESS The command completed successfully.
**/
+EFI_STATUS
+PciExplainCommand (
+ IN UINT16 *Command
+ )
{
//
// Print the binary value of register Command
@@ -3572,27 +3643,19 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Explain each meaningful bit of register Bridge Control.
+
+ @param[in] BridgeControl Points to the content of register Bridge Control.
+ @param[in] HeaderType The headertype.
+
+ @retval EFI_SUCCESS The command completed successfully.
+**/
EFI_STATUS
PciExplainBridgeControl (
IN UINT16 *BridgeControl,
IN PCI_HEADER_TYPE HeaderType
)
-/*++
-
-Routine Description:
-
- Explain each meaningful bit of register Bridge Control.
-
-Arguments:
-
- BridgeControl Points to the content of register Bridge Control
- HeaderType The headertype
-
-Returns:
-
- EFI_SUCCESS The command completed successfully
-
-**/
{
ShellPrintHiiEx(-1, -1, NULL,
STRING_TOKEN (STR_PCI2_BRIDGE_CONTROL),
@@ -3684,6 +3747,15 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Print each capability structure.
+
+ @param[in] IoDev The pointer to the deivce.
+ @param[in] Address The address to start at.
+ @param[in] CapPtr The offset from the address.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
PciExplainCapabilityStruct (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
@@ -3723,10 +3795,17 @@ PciExplainCapabilityStruct (
return EFI_SUCCESS;
}
+/**
+ Print out information of the capability information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieCapReg (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieCapReg;
CHAR16 *DevicePortType;
@@ -3764,10 +3843,17 @@ ExplainPcieCapReg (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device capability information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieDeviceCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieCapReg;
UINT32 PcieDeviceCap;
@@ -3796,8 +3882,8 @@ ExplainPcieDeviceCap (
// Endpoint L0s and L1 Acceptable Latency is only valid for Endpoint
//
if (IS_PCIE_ENDPOINT (DevicePortType)) {
- L0sLatency = (UINT8) PCIE_CAP_L0sLatency (PcieDeviceCap);
- L1Latency = (UINT8) PCIE_CAP_L1Latency (PcieDeviceCap);
+ L0sLatency = (UINT8) PCIE_CAP_L0SLATENCY (PcieDeviceCap);
+ L1Latency = (UINT8) PCIE_CAP_L1LATENCY (PcieDeviceCap);
Print (L" Endpoint L0s Acceptable Latency(8:6): ");
if (L0sLatency < 4) {
Print (L"%EMaximum of %d ns%N\n", 1 << (L0sLatency + 6));
@@ -3846,10 +3932,17 @@ ExplainPcieDeviceCap (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device control information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieDeviceControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieCapReg;
UINT16 PcieDeviceControl;
@@ -3916,10 +4009,17 @@ ExplainPcieDeviceControl (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieDeviceStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieDeviceStatus;
@@ -3951,14 +4051,21 @@ ExplainPcieDeviceStatus (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device link information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieLinkCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT32 PcieLinkCap;
CHAR16 *SupLinkSpeeds;
- CHAR16 *ASPM;
+ CHAR16 *AspmValue;
PcieLinkCap = PciExpressCap->LinkCap;
switch (PCIE_CAP_SUP_LINK_SPEEDS (PcieLinkCap)) {
@@ -3982,26 +4089,26 @@ ExplainPcieLinkCap (
);
switch (PCIE_CAP_ASPM_SUPPORT (PcieLinkCap)) {
case 1:
- ASPM = L"L0s Entry";
+ AspmValue = L"L0s Entry";
break;
case 3:
- ASPM = L"L0s and L1";
+ AspmValue = L"L0s and L1";
break;
default:
- ASPM = L"Reserved";
+ AspmValue = L"Reserved";
break;
}
Print (
L" Active State Power Management Support(11:10): %E%s Supported%N\n",
- ASPM
+ AspmValue
);
Print (
L" L0s Exit Latency(14:12): %E%s%N\n",
- L0sLatencyStrTable[PCIE_CAP_L0s_LATENCY (PcieLinkCap)]
+ L0sLatencyStrTable[PCIE_CAP_L0S_LATENCY (PcieLinkCap)]
);
Print (
L" L1 Exit Latency(17:15): %E%s%N\n",
- L1LatencyStrTable[PCIE_CAP_L0s_LATENCY (PcieLinkCap)]
+ L1LatencyStrTable[PCIE_CAP_L0S_LATENCY (PcieLinkCap)]
);
Print (
L" Clock Power Management(18): %E%d%N\n",
@@ -4026,10 +4133,17 @@ ExplainPcieLinkCap (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device link control information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieLinkControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieLinkControl;
UINT8 DevicePortType;
@@ -4090,10 +4204,17 @@ ExplainPcieLinkControl (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device link status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieLinkStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieLinkStatus;
CHAR16 *SupLinkSpeeds;
@@ -4141,10 +4262,17 @@ ExplainPcieLinkStatus (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device slot information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieSlotCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT32 PcieSlotCap;
@@ -4202,10 +4330,17 @@ ExplainPcieSlotCap (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device slot control information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieSlotControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieSlotControl;
@@ -4259,10 +4394,17 @@ ExplainPcieSlotControl (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device slot status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieSlotStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieSlotStatus;
@@ -4313,10 +4455,17 @@ ExplainPcieSlotStatus (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device root information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieRootControl (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieRootControl;
@@ -4346,10 +4495,17 @@ ExplainPcieRootControl (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device root capability information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieRootCap (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT16 PcieRootCap;
@@ -4363,10 +4519,17 @@ ExplainPcieRootCap (
return EFI_SUCCESS;
}
+/**
+ Print out information of the device root status information.
+
+ @param[in] PciExpressCap The pointer to the structure about the device.
+
+ @retval EFI_SUCCESS The operation was successful.
+**/
EFI_STATUS
ExplainPcieRootStatus (
IN PCIE_CAP_STURCTURE *PciExpressCap
-)
+ )
{
UINT32 PcieRootStatus;
@@ -4387,6 +4550,13 @@ ExplainPcieRootStatus (
return EFI_SUCCESS;
}
+/**
+ Display Pcie device structure.
+
+ @param[in] IoDev The pointer to the root pci protocol.
+ @param[in] Address The Address to start at.
+ @param[in] CapabilityPtr The offset from the address to start.
+**/
EFI_STATUS
PciExplainPciExpress (
IN EFI_PCI_ROOT_BRIDGE_IO_PROTOCOL *IoDev,
@@ -4520,7 +4690,7 @@ PciExplainPciExpress (
//
Print (L"\n%HStart dumping PCIex extended configuration space (0x100 - 0xFFF).%N\n\n");
- PrivateDumpHex (
+ DumpHex (
2,
0x100,
ExtendRegSize,
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
index cbc1b0235a..04a22da52c 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.h
@@ -100,9 +100,9 @@ typedef enum {
(((PcieDeviceCap) >> 3) & 0x3)
#define PCIE_CAP_EXTENDED_TAG(PcieDeviceCap) \
(((PcieDeviceCap) >> 5) & 0x1)
-#define PCIE_CAP_L0sLatency(PcieDeviceCap) \
+#define PCIE_CAP_L0SLATENCY(PcieDeviceCap) \
(((PcieDeviceCap) >> 6) & 0x7)
-#define PCIE_CAP_L1Latency(PcieDeviceCap) \
+#define PCIE_CAP_L1LATENCY(PcieDeviceCap) \
(((PcieDeviceCap) >> 9) & 0x7)
#define PCIE_CAP_ERR_REPORTING(PcieDeviceCap) \
(((PcieDeviceCap) >> 15) & 0x1)
@@ -163,7 +163,7 @@ typedef enum {
(((PcieLinkCap) >> 4) & 0x3f)
#define PCIE_CAP_ASPM_SUPPORT(PcieLinkCap) \
(((PcieLinkCap) >> 10) & 0x3)
-#define PCIE_CAP_L0s_LATENCY(PcieLinkCap) \
+#define PCIE_CAP_L0S_LATENCY(PcieLinkCap) \
(((PcieLinkCap) >> 12) & 0x7)
#define PCIE_CAP_L1_LATENCY(PcieLinkCap) \
(((PcieLinkCap) >> 15) & 0x7)
@@ -334,7 +334,7 @@ typedef struct {
UINT8 CacheLineSize;
UINT8 PrimaryLatencyTimer;
UINT8 HeaderType;
- UINT8 BIST;
+ UINT8 Bist;
} PCI_COMMON_HEADER;
@@ -427,13 +427,15 @@ typedef struct {
UINT32 Data[46];
} PCI_CARDBUS_DATA;
+typedef union {
+ PCI_DEVICE_HEADER Device;
+ PCI_BRIDGE_HEADER Bridge;
+ PCI_CARDBUS_HEADER CardBus;
+} NON_COMMON_UNION;
+
typedef struct {
PCI_COMMON_HEADER Common;
- union {
- PCI_DEVICE_HEADER Device;
- PCI_BRIDGE_HEADER Bridge;
- PCI_CARDBUS_HEADER CardBus;
- } NonCommon;
+ NON_COMMON_UNION NonCommon;
UINT32 Data[48];
} PCI_CONFIG_SPACE;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
index a1e14678f3..f07a4c4921 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.c
@@ -1,7 +1,7 @@
-/**
+/** @file
Module for clarifying the content of the smbios structure element info.
- Copyright (c) 2005-2010, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -141,6 +141,12 @@ DisplaySysEventLogHeaderFormat (
}
}
+/**
+ Display the header information for SEL log items.
+
+ @param[in] Key The information key.
+ @param[in] Option The option index.
+**/
VOID
DisplaySELLogHeaderLen (
UINT8 Key,
@@ -163,9 +169,14 @@ DisplaySELLogHeaderLen (
}
}
+/**
+ Display the header information for type 1 items.
+
+ @param[in] LogHeader The buffer with the information.
+**/
VOID
DisplaySysEventLogHeaderType1 (
- UINT8 *LogHeader
+ IN UINT8 *LogHeader
)
{
LOG_HEADER_TYPE1_FORMAT *Header;
@@ -186,8 +197,8 @@ DisplaySysEventLogHeaderType1 (
Header->OEMReserved[3],
Header->OEMReserved[4]
);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->METW);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->MECI);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_TIME), gShellDebug1HiiHandle, Header->Metw);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_MULTIPLE_EVENT_COUNT), gShellDebug1HiiHandle, Header->Meci);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_ADDRESS), gShellDebug1HiiHandle, Header->CMOSAddress);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_PREBOOT_INDEX), gShellDebug1HiiHandle, Header->CMOSBitIndex);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_EVENTLOGINFO_CHECKSUM_STARTING_OFF), gShellDebug1HiiHandle, Header->StartingOffset);
@@ -235,6 +246,12 @@ DisplaySysEventLogHeader (
}
}
+/**
+ Display the El Vdf information.
+
+ @param[in] ElVdfType The information type.
+ @param[in] VarData The information buffer.
+**/
VOID
DisplayElVdfInfo (
UINT8 ElVdfType,
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
index 62d7d77fdf..b32cfea812 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/EventLogInfo.h
@@ -1,7 +1,7 @@
-/**
+/** @file
Module to clarify system event log of smbios structure.
- Copyright (c) 2005-2010, Intel Corporation. All rights reserved. <BR>
+ Copyright (c) 2005-2011, Intel Corporation. All rights reserved. <BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -12,8 +12,8 @@
**/
-#ifndef _SMBIOS_EVENT_LOG_INFO_H
-#define _SMBIOS_EVENT_LOG_INFO_H
+#ifndef _SMBIOS_EVENT_LOG_INFO_H_
+#define _SMBIOS_EVENT_LOG_INFO_H_
#define END_OF_LOG 0xFF
@@ -33,8 +33,8 @@ typedef struct {
typedef struct {
UINT8 OEMReserved[5];
- UINT8 METW; // Multiple Event Time Window
- UINT8 MECI; // Multiple Event Count Increment
+ UINT8 Metw; // Multiple Event Time Window
+ UINT8 Meci; // Multiple Event Count Increment
UINT8 CMOSAddress; // Pre-boot Event Log Reset - CMOS Address
UINT8 CMOSBitIndex; // Pre-boot Event Log Reset - CMOS Bit Index
UINT8 StartingOffset; // CMOS Checksum - Starting Offset
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h
index d1ecc858ac..5e146cde52 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbios.h
@@ -1,7 +1,7 @@
/** @file
Lib include for SMBIOS services. Used to get system serial number and GUID
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -12,8 +12,8 @@
**/
-#ifndef _LIB_SMBIOS_H
-#define _LIB_SMBIOS_H
+#ifndef _LIB_SMBIOS_H_
+#define _LIB_SMBIOS_H_
//
// Define SMBIOS tables.
@@ -215,14 +215,14 @@ typedef struct {
UINT8 DevFuncNum;
} SMBIOS_TYPE9;
-typedef struct DeviceStruct {
+typedef struct _DEVICE_STRUCTURE {
UINT8 DeviceType;
SMBIOS_STRING DescriptionString;
-} DeviceStruct;
+} DEVICE_STRUCTURE;
typedef struct {
SMBIOS_HEADER Hdr;
- DeviceStruct Device[1];
+ DEVICE_STRUCTURE Device[1];
} SMBIOS_TYPE10;
typedef struct {
@@ -239,7 +239,7 @@ typedef struct {
SMBIOS_HEADER Hdr;
UINT8 InstallableLanguages;
UINT8 Flags;
- UINT8 reserved[15];
+ UINT8 Reserved[15];
SMBIOS_STRING CurrentLanguages;
} SMBIOS_TYPE13;
@@ -622,17 +622,19 @@ typedef union {
#pragma pack()
-CHAR8 *
-LibGetSmbiosString (
- IN SMBIOS_STRUCTURE_POINTER *Smbios,
- IN UINT16 StringNumber
- );
+/**
+ Return SMBIOS string given the string number.
-EFI_STATUS
-LibGetSmbiosSystemGuidAndSerialNumber (
- IN EFI_GUID *SystemGuid,
- OUT CHAR8 **SystemSerialNumber
- );
+ @param[in] Smbios Pointer to SMBIOS structure.
+ @param[in] StringNumber String number to return. -1 is used to skip all strings and
+ point to the next SMBIOS structure.
+ @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
+**/
+CHAR8*
+LibGetSmbiosString (
+ IN SMBIOS_STRUCTURE_POINTER *Smbios,
+ IN UINT16 StringNumber
+ );
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
index 22a8065a01..409f6840ef 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.c
@@ -1,7 +1,7 @@
/** @file
API for SMBIOS table.
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -17,30 +17,22 @@
#include <Guid/Smbios.h>
#include "LIbSmbios.h"
#include "LibSmbiosView.h"
-#include "smbiosview.h"
+#include "SmbiosView.h"
STATIC UINT8 mInit = 0;
STATIC SMBIOS_STRUCTURE_TABLE *mSmbiosTable = NULL;
STATIC SMBIOS_STRUCTURE_POINTER m_SmbiosStruct;
STATIC SMBIOS_STRUCTURE_POINTER *mSmbiosStruct = &m_SmbiosStruct;
+/**
+ Init the SMBIOS VIEW API's environment.
+
+ @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
+**/
EFI_STATUS
LibSmbiosInit (
VOID
)
-/*++
-
-Routine Description:
- Init the SMBIOS VIEW API's environment.
-
- Arguments:
- None
-
-Returns:
- EFI_SUCCESS - Successful to init the SMBIOS VIEW Lib
- Others - Cannot get SMBIOS Table
-
-**/
{
EFI_STATUS Status;
@@ -73,6 +65,9 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Cleanup the Smbios information.
+**/
VOID
LibSmbiosCleanup (
VOID
@@ -88,98 +83,46 @@ LibSmbiosCleanup (
mInit = 0;
}
+/**
+ Get the entry point structure for the table.
+
+ @param[out] EntryPointStructure The pointer to populate.
+**/
VOID
LibSmbiosGetEPS (
- SMBIOS_STRUCTURE_TABLE **pEntryPointStructure
+ OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure
)
{
//
// return SMBIOS Table address
//
- *pEntryPointStructure = mSmbiosTable;
+ *EntryPointStructure = mSmbiosTable;
}
-VOID
-LibSmbiosGetStructHead (
- SMBIOS_STRUCTURE_POINTER *pHead
- )
-{
- //
- // return SMBIOS structure table address
- //
- pHead = mSmbiosStruct;
-}
-
-EFI_STATUS
-LibGetSmbiosInfo (
- OUT CHAR8 *dmiBIOSRevision,
- OUT UINT16 *NumStructures,
- OUT UINT16 *StructureSize,
- OUT UINT32 *dmiStorageBase,
- OUT UINT16 *dmiStorageSize
- )
-/*++
-
-Routine Description:
- Get SMBIOS Information.
+/**
+ Get SMBIOS structure given the Handle,copy data to the Buffer,
+ Handle is changed to the next handle or 0xFFFF when the end is
+ reached or the handle is not found.
- Arguments:
- dmiBIOSRevision - Revision of the SMBIOS Extensions.
- NumStructures - Max. Number of Structures the BIOS will return.
- StructureSize - Size of largest SMBIOS Structure.
- dmiStorageBase - 32-bit physical base address for memory mapped SMBIOS data.
- dmiStorageSize - Size of the memory-mapped SMBIOS data.
+ @param[in,out] Handle 0xFFFF: get the first structure
+ Others: get a structure according to this value.
+ @param[in,out] Buffer The pointer to the caller's memory buffer.
+ @param[out] Length Length of return buffer in bytes.
- Returns:
- DMI_SUCCESS - successful.
- DMI_FUNCTION_NOT_SUPPORTED - Does not support SMBIOS calling interface capability.
+ @retval DMI_SUCCESS Buffer contains the required structure data
+ Handle is updated with next structure handle or
+ 0xFFFF(end-of-list).
+ @retval DMI_INVALID_HANDLE Buffer not contain the requiring structure data.
+ Handle is updated with next structure handle or
+ 0xFFFF(end-of-list).
**/
-{
- //
- // If no SMIBOS table, unsupported.
- //
- if (mSmbiosTable == NULL) {
- return DMI_FUNCTION_NOT_SUPPORTED;
- }
-
- *dmiBIOSRevision = mSmbiosTable->SmbiosBcdRevision;
- *NumStructures = mSmbiosTable->NumberOfSmbiosStructures;
- *StructureSize = mSmbiosTable->MaxStructureSize;
- *dmiStorageBase = mSmbiosTable->TableAddress;
- *dmiStorageSize = mSmbiosTable->TableLength;
-
- return DMI_SUCCESS;
-}
-
EFI_STATUS
LibGetSmbiosStructure (
IN OUT UINT16 *Handle,
IN OUT UINT8 *Buffer,
OUT UINT16 *Length
)
-/*++
-
- Routine Description:
- Get SMBIOS structure given the Handle,copy data to the Buffer,
- Handle is changed to the next handle or 0xFFFF when the end is
- reached or the handle is not found.
-
- Arguments:
- Handle: - 0xFFFF: get the first structure
- - Others: get a structure according to this value.
- Buffter: - The pointer to the caller's memory buffer.
- Length: - Length of return buffer in bytes.
-
- Returns:
- DMI_SUCCESS - Buffer contains the required structure data
- - Handle is updated with next structure handle or
- 0xFFFF(end-of-list).
-
- DMI_INVALID_HANDLE - Buffer not contain the requiring structure data
- - Handle is updated with next structure handle or
- 0xFFFF(end-of-list).
-**/
{
SMBIOS_STRUCTURE_POINTER Smbios;
SMBIOS_STRUCTURE_POINTER SmbiosEnd;
@@ -230,23 +173,18 @@ LibGetSmbiosStructure (
return DMI_INVALID_HANDLE;
}
+/**
+ Check the structure to see if it is legal.
+
+ @param[in] Smbios - Pointer to the structure that will be checked.
+
+ @retval DMI_SUCCESS Structure data is legal.
+ @retval DMI_BAD_PARAMETER Structure data contains bad parameter.
+**/
EFI_STATUS
SmbiosCheckStructure (
IN SMBIOS_STRUCTURE_POINTER *Smbios
)
-/*++
-
- Routine Description:
- Check the structure to see if it is legal.
-
- Arguments:
- Smbios - Pointer to the structure that will be checked.
-
- Returns:
- DMI_SUCCESS - Structure data is legal.
- DMI_BAD_PARAMETER - Structure data contains bad parameter
-
-**/
{
//
// If key != value, then error.
@@ -324,6 +262,13 @@ SmbiosCheckStructure (
return Status;
}
+/**
+ Get a string from the smbios information.
+
+ @param[in] Smbios The pointer to the smbios information.
+ @param[in] StringNumber The index to the string to get.
+ @param[out] Buffer The buffer to fill with the string when retrieved.
+**/
VOID
SmbiosGetPendingString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
index 7ef341b0d6..76442cdf1a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/LibSmbiosView.h
@@ -1,7 +1,7 @@
/** @file
API for SMBIOS Plug and Play functions, access to SMBIOS table and structures.
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -12,8 +12,8 @@
**/
-#ifndef _LIB_SMBIOS_VIEW_H
-#define _LIB_SMBIOS_VIEW_H
+#ifndef _LIB_SMBIOS_VIEW_H_
+#define _LIB_SMBIOS_VIEW_H_
#include "LibSmbios.h"
@@ -39,49 +39,51 @@
#define EFI_SMBIOSERR_TYPE_UNKNOWN EFI_SMBIOSERR (3)
#define EFI_SMBIOSERR_UNSUPPORTED EFI_SMBIOSERR (4)
+/**
+ Init the SMBIOS VIEW API's environment.
+
+ @retval EFI_SUCCESS Successful to init the SMBIOS VIEW Lib.
+**/
EFI_STATUS
LibSmbiosInit (
VOID
);
+/**
+ Cleanup the Smbios information.
+**/
VOID
LibSmbiosCleanup (
VOID
);
-VOID
-LibSmbiosGetEPS (
- SMBIOS_STRUCTURE_TABLE **pEntryPointStructure
- );
+/**
+ Get the entry point structure for the table.
+ @param[out] EntryPointStructure The pointer to populate.
+**/
VOID
-LibSmbiosGetStructHead (
- SMBIOS_STRUCTURE_POINTER *pHead
+LibSmbiosGetEPS (
+ OUT SMBIOS_STRUCTURE_TABLE **EntryPointStructure
);
-EFI_STATUS
-LibGetSmbiosInfo (
- OUT CHAR8 *dmiBIOSRevision,
- OUT UINT16 *NumStructures,
- OUT UINT16 *StructureSize,
- OUT UINT32 *dmiStorageBase,
- OUT UINT16 *dmiStorageSize
- );
+/**
+ Get SMBIOS structure given the Handle,copy data to the Buffer,
+ Handle is changed to the next handle or 0xFFFF when the end is
+ reached or the handle is not found.
-/*++
- Description:
- Get SMBIOS Information.
+ @param[in,out] Handle 0xFFFF: get the first structure
+ Others: get a structure according to this value.
+ @param[in,out] Buffer The pointer to the caller's memory buffer.
+ @param[out] Length Length of return buffer in bytes.
- Arguments:
- dmiBIOSRevision - Revision of the SMBIOS Extensions.
- NumStructures - Max. Number of Structures the BIOS will return.
- StructureSize - Size of largest SMBIOS Structure.
- dmiStorageBase - 32-bit physical base address for memory mapped SMBIOS data.
- dmiStorageSize - Size of the memory-mapped SMBIOS data.
+ @retval DMI_SUCCESS Buffer contains the required structure data
+ Handle is updated with next structure handle or
+ 0xFFFF(end-of-list).
- Returns:
- DMI_SUCCESS - successful.
- DMI_FUNCTION_NOT_SUPPORTED - Does not support SMBIOS calling interface capability.
+ @retval DMI_INVALID_HANDLE Buffer not contain the requiring structure data.
+ Handle is updated with next structure handle or
+ 0xFFFF(end-of-list).
**/
EFI_STATUS
LibGetSmbiosStructure (
@@ -90,20 +92,12 @@ LibGetSmbiosStructure (
OUT UINT16 *Length
);
-/*++
- Description:
- Get SMBIOS structure given the Handle,copy data to the Buffer,Handle is then the next.
-
- Arguments:
- Handle: - 0x0: get the first structure
- - Others: get a certain structure according to this value.
- Buffter: - contains the pointer to the caller's memory buffer.
+/**
+ Get a string from the smbios information.
- Returns:
- DMI_SUCCESS - Buffer contains the required structure data
- - Handle is updated with next structure handle or 0xFFFF(end-of-list).
- DMI_INVALID_HANDLE - Buffer not contain the requiring structure data
- - Handle is updated with next structure handle or 0xFFFF(end-of-list).
+ @param[in] Smbios The pointer to the smbios information.
+ @param[in] StringNumber The index to the string to get.
+ @param[out] Buffer The buffer to fill with the string when retrieved.
**/
VOID
SmbiosGetPendingString (
@@ -112,9 +106,17 @@ SmbiosGetPendingString (
OUT CHAR8 *Buffer
);
+/**
+ Check the structure to see if it is legal.
+
+ @param[in] Smbios - Pointer to the structure that will be checked.
+
+ @retval DMI_SUCCESS Structure data is legal.
+ @retval DMI_BAD_PARAMETER Structure data contains bad parameter.
+**/
EFI_STATUS
SmbiosCheckStructure (
- IN SMBIOS_STRUCTURE_POINTER *Smbios
+ IN SMBIOS_STRUCTURE_POINTER *Smbios
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
index 91835106d5..3ae1eeaf7c 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
@@ -1,7 +1,7 @@
/** @file
Module for clarifying the content of the smbios structure element information.
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -28,7 +28,7 @@
//////////////////////////////////////////////////////////
// Macros of print structure element, simplify coding.
//
-#define PrintPendingString(pStruct, type, element) \
+#define PRINT_PENDING_STRING(pStruct, type, element) \
do { \
CHAR8 StringBuf[64]; \
SetMem (StringBuf, sizeof (StringBuf), 0x00); \
@@ -37,7 +37,7 @@
ShellPrintEx(-1,-1,L": %a\n", StringBuf); \
} while (0);
-#define PrintSmbiosString(pStruct, stringnumber, element) \
+#define PRINT_SMBIOS_STRING(pStruct, stringnumber, element) \
do { \
CHAR8 StringBuf[64]; \
SetMem (StringBuf, sizeof (StringBuf), 0x00); \
@@ -46,19 +46,19 @@
ShellPrintEx(-1,-1,L": %a\n", StringBuf); \
} while (0);
-#define PrintStructValue(pStruct, type, element) \
+#define PRINT_STRUCT_VALUE(pStruct, type, element) \
do { \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": %d\n", (pStruct->type->element)); \
} while (0);
-#define PrintStructValueH(pStruct, type, element) \
+#define PRINT_STRUCT_VALUE_H(pStruct, type, element) \
do { \
ShellPrintEx(-1,-1,L"%a",#element); \
ShellPrintEx(-1,-1,L": 0x%x\n", (pStruct->type->element)); \
} while (0);
-#define PrintBitField(pStruct, type, element, size) \
+#define PRINT_BIT_FIELD(pStruct, type, element, size) \
do { \
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \
ShellPrintEx(-1,-1,L"%a",#element); \
@@ -66,7 +66,7 @@
DumpHex (0, 0, size, &(pStruct->type->element)); \
} while (0);
-#define PrintSmbiosBitField(pStruct, startaddress, element, size) \
+#define PRINT_SMBIOS_BIT_FIELD(pStruct, startaddress, element, size) \
do { \
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DUMP), gShellDebug1HiiHandle); \
ShellPrintEx(-1,-1,L"%a",#element); \
@@ -77,27 +77,21 @@
//
/////////////////////////////////////////
//
+
+/**
+ Copy Length of Src buffer to Dest buffer,
+ add a NULL termination to Dest buffer.
+
+ @param[in,out] Dest Destination buffer head.
+ @param[in] Src Source buffer head.
+ @param[in] Length Length of buffer to be copied.
+**/
VOID
MemToString (
IN OUT VOID *Dest,
IN VOID *Src,
IN UINTN Length
)
-/*++
-
-Routine Description:
- Copy Length of Src buffer to Dest buffer,
- add a NULL termination to Dest buffer.
-
-Arguments:
- Dest - Destination buffer head
- Src - Source buffer head
- Length - Length of buffer to be copied
-
-Returns:
- None.
-
-**/
{
UINT8 *SrcBuffer;
UINT8 *DestBuffer;
@@ -120,23 +114,18 @@ Returns:
//
// Functions below is to show the information
//
+
+/**
+ Print the info of EPS(Entry Point Structure).
+
+ @param[in] SmbiosTable Pointer to the SMBIOS table entry point.
+ @param[in] Option Display option.
+**/
VOID
SmbiosPrintEPSInfo (
IN SMBIOS_STRUCTURE_TABLE *SmbiosTable,
IN UINT8 Option
)
-/*++
-
-Routine Description:
- Print the info of EPS(Entry Point Structure)
-
-Arguments:
- SmbiosTable - Pointer to the SMBIOS table entry point
- Option - Display option
-
-Returns: None
-
-**/
{
UINT8 Anchor[5];
UINT8 InAnchor[6];
@@ -199,33 +188,28 @@ Returns: None
Print (L"\n");
}
+/**
+ This function print the content of the structure pointed by Struct.
+
+ @param[in] Struct Point to the structure to be printed.
+ @param[in] Option Print option of information detail.
+
+ @retval EFI_SUCCESS Successfully Printing this function.
+ @retval EFI_INVALID_PARAMETER Invalid Structure.
+ @retval EFI_UNSUPPORTED Unsupported.
+**/
EFI_STATUS
SmbiosPrintStructure (
- IN SMBIOS_STRUCTURE_POINTER *pStruct,
+ IN SMBIOS_STRUCTURE_POINTER *Struct,
IN UINT8 Option
)
-/*++
-
-Routine Description:
- This function print the content of the structure pointed by pStruct
-
-Arguments:
- pStruct - point to the structure to be printed
- Option - print option of information detail
-
-Returns:
- EFI_SUCCESS - Successfully Printing this function
- EFI_INVALID_PARAMETER - Invalid Structure
- EFI_UNSUPPORTED - Unsupported
-
-**/
{
UINT8 Index;
UINT8 *Buffer;
- Buffer = (UINT8 *) (UINTN) (pStruct->Raw);
+ Buffer = (UINT8 *) (UINTN) (Struct->Raw);
- if (pStruct == NULL) {
+ if (Struct == NULL) {
return EFI_INVALID_PARAMETER;
}
@@ -235,35 +219,35 @@ Returns:
//
// Display structure header
//
- DisplayStructureTypeInfo (pStruct->Hdr->Type, SHOW_DETAIL);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMAT_PART_LEN), gShellDebug1HiiHandle, pStruct->Hdr->Length);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, pStruct->Hdr->Handle);
+ DisplayStructureTypeInfo (Struct->Hdr->Type, SHOW_DETAIL);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FORMAT_PART_LEN), gShellDebug1HiiHandle, Struct->Hdr->Length);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_STRUCT_HANDLE), gShellDebug1HiiHandle, Struct->Hdr->Handle);
if (Option == SHOW_OUTLINE) {
return EFI_SUCCESS;
}
- switch (pStruct->Hdr->Type) {
+ switch (Struct->Hdr->Type) {
//
//
//
case 0:
- PrintPendingString (pStruct, Type0, Vendor);
- PrintPendingString (pStruct, Type0, BiosVersion);
- PrintStructValue (pStruct, Type0, BiosSegment);
- PrintPendingString (pStruct, Type0, BiosReleaseDate);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (pStruct->Type0->BiosSize + 1));
+ PRINT_PENDING_STRING (Struct, Type0, Vendor);
+ PRINT_PENDING_STRING (Struct, Type0, BiosVersion);
+ PRINT_STRUCT_VALUE (Struct, Type0, BiosSegment);
+ PRINT_PENDING_STRING (Struct, Type0, BiosReleaseDate);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SIZE), gShellDebug1HiiHandle, 64 * (Struct->Type0->BiosSize + 1));
if (Option < SHOW_DETAIL) {
- PrintStructValueH (pStruct, Type0, BiosCharacteristics);
+ PRINT_STRUCT_VALUE_H (Struct, Type0, BiosCharacteristics);
} else {
- DisplayBiosCharacteristics (pStruct->Type0->BiosCharacteristics, Option);
+ DisplayBiosCharacteristics (Struct->Type0->BiosCharacteristics, Option);
//
// The length of above format part is 0x12 bytes,
// Ext bytes are following, size = 'len-0x12'.
// If len-0x12 > 0, then
- // there are extension bytes (byte1, byte2, byte3...)
+ // there are extension bytes (Byte1, byte2, byte3...)
// And byte3 not stated in spec, so dump all extension bytes(1, 2, 3..)
//
if ((Buffer[1] - (CHAR8) 0x12) > 0) {
@@ -275,8 +259,8 @@ Returns:
}
if ((Buffer[1] - (CHAR8) 0x12) > 2) {
- PrintBitField (
- pStruct,
+ PRINT_BIT_FIELD (
+ Struct,
Type0,
BiosCharacteristics,
Buffer[1] - (CHAR8) 0x12
@@ -289,77 +273,77 @@ Returns:
// System Information (Type 1)
//
case 1:
- PrintPendingString (pStruct, Type1, Manufacturer);
- PrintPendingString (pStruct, Type1, ProductName);
- PrintPendingString (pStruct, Type1, Version);
- PrintPendingString (pStruct, Type1, SerialNumber);
- PrintBitField (pStruct, Type1, Uuid, 16);
- DisplaySystemWakeupType (pStruct->Type1->WakeUpType, Option);
+ PRINT_PENDING_STRING (Struct, Type1, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type1, ProductName);
+ PRINT_PENDING_STRING (Struct, Type1, Version);
+ PRINT_PENDING_STRING (Struct, Type1, SerialNumber);
+ PRINT_BIT_FIELD (Struct, Type1, Uuid, 16);
+ DisplaySystemWakeupType (Struct->Type1->WakeUpType, Option);
break;
case 2:
- PrintPendingString (pStruct, Type2, Manufacturer);
- PrintPendingString (pStruct, Type2, ProductName);
- PrintPendingString (pStruct, Type2, Version);
- PrintPendingString (pStruct, Type2, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type2, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type2, ProductName);
+ PRINT_PENDING_STRING (Struct, Type2, Version);
+ PRINT_PENDING_STRING (Struct, Type2, SerialNumber);
break;
//
// System Enclosure (Type 3)
//
case 3:
- PrintPendingString (pStruct, Type3, Manufacturer);
- PrintStructValue (pStruct, Type3, Type);
- DisplaySystemEnclosureType (pStruct->Type3->Type, Option);
- PrintPendingString (pStruct, Type3, Version);
- PrintPendingString (pStruct, Type3, SerialNumber);
- PrintPendingString (pStruct, Type3, AssetTag);
+ PRINT_PENDING_STRING (Struct, Type3, Manufacturer);
+ PRINT_STRUCT_VALUE (Struct, Type3, Type);
+ DisplaySystemEnclosureType (Struct->Type3->Type, Option);
+ PRINT_PENDING_STRING (Struct, Type3, Version);
+ PRINT_PENDING_STRING (Struct, Type3, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type3, AssetTag);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOTUP_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (pStruct->Type3->BootupState, Option);
+ DisplaySystemEnclosureStatus (Struct->Type3->BootupState, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_POWER_SUPPLY_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (pStruct->Type3->PowerSupplyState, Option);
+ DisplaySystemEnclosureStatus (Struct->Type3->PowerSupplyState, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_THERMAL_STATE), gShellDebug1HiiHandle);
- DisplaySystemEnclosureStatus (pStruct->Type3->ThermalState, Option);
+ DisplaySystemEnclosureStatus (Struct->Type3->ThermalState, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SECURITY_STATUS), gShellDebug1HiiHandle);
- DisplaySESecurityStatus (pStruct->Type3->SecurityStatus, Option);
- PrintBitField (pStruct, Type3, OemDefined, 4);
+ DisplaySESecurityStatus (Struct->Type3->SecurityStatus, Option);
+ PRINT_BIT_FIELD (Struct, Type3, OemDefined, 4);
break;
//
// Processor Information (Type 4)
//
case 4:
- PrintStructValue (pStruct, Type4, Socket);
- DisplayProcessorType (pStruct->Type4->ProcessorType, Option);
+ PRINT_STRUCT_VALUE (Struct, Type4, Socket);
+ DisplayProcessorType (Struct->Type4->ProcessorType, Option);
if ((SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x6)) &&
- (pStruct->Type4->ProcessorFamily == 0xFE)) {
+ (Struct->Type4->ProcessorFamily == 0xFE)) {
//
// Get family from ProcessorFamily2 field
//
- DisplayProcessorFamily2 (pStruct->Type4->ProcessorFamily2, Option);
+ DisplayProcessorFamily2 (Struct->Type4->ProcessorFamily2, Option);
} else {
- DisplayProcessorFamily (pStruct->Type4->ProcessorFamily, Option);
+ DisplayProcessorFamily (Struct->Type4->ProcessorFamily, Option);
}
- PrintPendingString (pStruct, Type4, ProcessorManufacture);
- PrintBitField (pStruct, Type4, ProcessorId, 8);
- PrintPendingString (pStruct, Type4, ProcessorVersion);
- DisplayProcessorVoltage (pStruct->Type4->Voltage, Option);
- PrintStructValue (pStruct, Type4, ExternalClock);
- PrintStructValue (pStruct, Type4, MaxSpeed);
- PrintStructValue (pStruct, Type4, CurrentSpeed);
- DisplayProcessorStatus (pStruct->Type4->Status, Option);
- DisplayProcessorUpgrade (pStruct->Type4->ProcessorUpgrade, Option);
- PrintStructValueH (pStruct, Type4, L1CacheHandle);
- PrintStructValueH (pStruct, Type4, L2CacheHandle);
- PrintStructValueH (pStruct, Type4, L3CacheHandle);
- PrintPendingString (pStruct, Type4, SerialNumber);
- PrintPendingString (pStruct, Type4, AssetTag);
- PrintPendingString (pStruct, Type4, PartNumber);
+ PRINT_PENDING_STRING (Struct, Type4, ProcessorManufacture);
+ PRINT_BIT_FIELD (Struct, Type4, ProcessorId, 8);
+ PRINT_PENDING_STRING (Struct, Type4, ProcessorVersion);
+ DisplayProcessorVoltage (Struct->Type4->Voltage, Option);
+ PRINT_STRUCT_VALUE (Struct, Type4, ExternalClock);
+ PRINT_STRUCT_VALUE (Struct, Type4, MaxSpeed);
+ PRINT_STRUCT_VALUE (Struct, Type4, CurrentSpeed);
+ DisplayProcessorStatus (Struct->Type4->Status, Option);
+ DisplayProcessorUpgrade (Struct->Type4->ProcessorUpgrade, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, L1CacheHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, L2CacheHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, L3CacheHandle);
+ PRINT_PENDING_STRING (Struct, Type4, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type4, AssetTag);
+ PRINT_PENDING_STRING (Struct, Type4, PartNumber);
if (SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x5)) {
- PrintStructValue (pStruct, Type4, CoreCount);
- PrintStructValue (pStruct, Type4, EnabledCoreCount);
- PrintStructValue (pStruct, Type4, ThreadCount);
- PrintStructValueH (pStruct, Type4, ProcessorCharacteristics);
+ PRINT_STRUCT_VALUE (Struct, Type4, CoreCount);
+ PRINT_STRUCT_VALUE (Struct, Type4, EnabledCoreCount);
+ PRINT_STRUCT_VALUE (Struct, Type4, ThreadCount);
+ PRINT_STRUCT_VALUE_H (Struct, Type4, ProcessorCharacteristics);
}
break;
@@ -369,19 +353,19 @@ Returns:
case 5:
{
UINT8 SlotNum;
- SlotNum = pStruct->Type5->AssociatedMemorySlotNum;
+ SlotNum = Struct->Type5->AssociatedMemorySlotNum;
- DisplayMcErrorDetectMethod (pStruct->Type5->ErrDetectMethod, Option);
- DisplayMcErrorCorrectCapability (pStruct->Type5->ErrCorrectCapability, Option);
+ DisplayMcErrorDetectMethod (Struct->Type5->ErrDetectMethod, Option);
+ DisplayMcErrorCorrectCapability (Struct->Type5->ErrCorrectCapability, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SUPOPRT), gShellDebug1HiiHandle);
- DisplayMcInterleaveSupport (pStruct->Type5->SupportInterleave, Option);
+ DisplayMcInterleaveSupport (Struct->Type5->SupportInterleave, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CURRENT), gShellDebug1HiiHandle);
- DisplayMcInterleaveSupport (pStruct->Type5->CurrentInterleave, Option);
- DisplayMaxMemoryModuleSize (pStruct->Type5->MaxMemoryModuleSize, SlotNum, Option);
- DisplayMcMemorySpeeds (pStruct->Type5->SupportSpeed, Option);
- DisplayMmMemoryType (pStruct->Type5->SupportMemoryType, Option);
- DisplayMemoryModuleVoltage (pStruct->Type5->MemoryModuleVoltage, Option);
- PrintStructValue (pStruct, Type5, AssociatedMemorySlotNum);
+ DisplayMcInterleaveSupport (Struct->Type5->CurrentInterleave, Option);
+ DisplayMaxMemoryModuleSize (Struct->Type5->MaxMemoryModuleSize, SlotNum, Option);
+ DisplayMcMemorySpeeds (Struct->Type5->SupportSpeed, Option);
+ DisplayMmMemoryType (Struct->Type5->SupportMemoryType, Option);
+ DisplayMemoryModuleVoltage (Struct->Type5->MemoryModuleVoltage, Option);
+ PRINT_STRUCT_VALUE (Struct, Type5, AssociatedMemorySlotNum);
//
// According to SMBIOS Specification, offset 0x0F
//
@@ -394,67 +378,67 @@ Returns:
// Memory Module Information (Type 6)
//
case 6:
- PrintPendingString (pStruct, Type6, SocketDesignation);
- DisplayMmBankConnections (pStruct->Type6->BankConnections, Option);
- PrintStructValue (pStruct, Type6, CurrentSpeed);
- DisplayMmMemoryType (pStruct->Type6->CurrentMemoryType, Option);
+ PRINT_PENDING_STRING (Struct, Type6, SocketDesignation);
+ DisplayMmBankConnections (Struct->Type6->BankConnections, Option);
+ PRINT_STRUCT_VALUE (Struct, Type6, CurrentSpeed);
+ DisplayMmMemoryType (Struct->Type6->CurrentMemoryType, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INSTALLED), gShellDebug1HiiHandle);
- DisplayMmMemorySize (pStruct->Type6->InstalledSize, Option);
+ DisplayMmMemorySize (Struct->Type6->InstalledSize, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ENABLED), gShellDebug1HiiHandle);
- DisplayMmMemorySize (pStruct->Type6->EnabledSize, Option);
- DisplayMmErrorStatus (pStruct->Type6->ErrorStatus, Option);
+ DisplayMmMemorySize (Struct->Type6->EnabledSize, Option);
+ DisplayMmErrorStatus (Struct->Type6->ErrorStatus, Option);
break;
//
// Cache Information (Type 7)
//
case 7:
- PrintPendingString (pStruct, Type7, SocketDesignation);
- PrintStructValueH (pStruct, Type7, CacheConfiguration);
- PrintStructValueH (pStruct, Type7, MaximumCacheSize);
- PrintStructValueH (pStruct, Type7, InstalledSize);
- PrintStructValueH (pStruct, Type7, SupportedSRAMType);
- PrintStructValueH (pStruct, Type7, CurrentSRAMType);
- DisplayCacheSRAMType (pStruct->Type7->CurrentSRAMType, Option);
- PrintStructValueH (pStruct, Type7, CacheSpeed);
- DisplayCacheErrCorrectingType (pStruct->Type7->ErrorCorrectionType, Option);
- DisplayCacheSystemCacheType (pStruct->Type7->SystemCacheType, Option);
- DisplayCacheAssociativity (pStruct->Type7->Associativity, Option);
+ PRINT_PENDING_STRING (Struct, Type7, SocketDesignation);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, CacheConfiguration);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, MaximumCacheSize);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, InstalledSize);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, SupportedSRAMType);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, CurrentSRAMType);
+ DisplayCacheSRAMType (Struct->Type7->CurrentSRAMType, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type7, CacheSpeed);
+ DisplayCacheErrCorrectingType (Struct->Type7->ErrorCorrectionType, Option);
+ DisplayCacheSystemCacheType (Struct->Type7->SystemCacheType, Option);
+ DisplayCacheAssociativity (Struct->Type7->Associativity, Option);
break;
//
// Port Connector Information (Type 8)
//
case 8:
- PrintPendingString (pStruct, Type8, InternalReferenceDesignator);
+ PRINT_PENDING_STRING (Struct, Type8, InternalReferenceDesignator);
Print (L"Internal ");
- DisplayPortConnectorType (pStruct->Type8->InternalConnectorType, Option);
- PrintPendingString (pStruct, Type8, ExternalReferenceDesignator);
+ DisplayPortConnectorType (Struct->Type8->InternalConnectorType, Option);
+ PRINT_PENDING_STRING (Struct, Type8, ExternalReferenceDesignator);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EXTERNAL), gShellDebug1HiiHandle);
- DisplayPortConnectorType (pStruct->Type8->ExternalConnectorType, Option);
- DisplayPortType (pStruct->Type8->PortType, Option);
+ DisplayPortConnectorType (Struct->Type8->ExternalConnectorType, Option);
+ DisplayPortType (Struct->Type8->PortType, Option);
break;
//
// System Slots (Type 9)
//
case 9:
- PrintPendingString (pStruct, Type9, SlotDesignation);
- DisplaySystemSlotType (pStruct->Type9->SlotType, Option);
- DisplaySystemSlotDataBusWidth (pStruct->Type9->SlotDataBusWidth, Option);
- DisplaySystemSlotCurrentUsage (pStruct->Type9->CurrentUsage, Option);
- DisplaySystemSlotLength (pStruct->Type9->SlotLength, Option);
+ PRINT_PENDING_STRING (Struct, Type9, SlotDesignation);
+ DisplaySystemSlotType (Struct->Type9->SlotType, Option);
+ DisplaySystemSlotDataBusWidth (Struct->Type9->SlotDataBusWidth, Option);
+ DisplaySystemSlotCurrentUsage (Struct->Type9->CurrentUsage, Option);
+ DisplaySystemSlotLength (Struct->Type9->SlotLength, Option);
DisplaySystemSlotId (
- pStruct->Type9->SlotID,
- pStruct->Type9->SlotType,
+ Struct->Type9->SlotID,
+ Struct->Type9->SlotType,
Option
);
- DisplaySlotCharacteristics1 (pStruct->Type9->SlotCharacteristics1, Option);
- DisplaySlotCharacteristics2 (pStruct->Type9->SlotCharacteristics2, Option);
+ DisplaySlotCharacteristics1 (Struct->Type9->SlotCharacteristics1, Option);
+ DisplaySlotCharacteristics2 (Struct->Type9->SlotCharacteristics2, Option);
if (SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x6)) {
- PrintStructValueH (pStruct, Type9, SegmentGroupNum);
- PrintStructValueH (pStruct, Type9, BusNum);
- PrintStructValueH (pStruct, Type9, DevFuncNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type9, SegmentGroupNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type9, BusNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type9, DevFuncNum);
}
break;
@@ -464,40 +448,40 @@ Returns:
case 10:
{
UINTN NumOfDevice;
- NumOfDevice = (pStruct->Type10->Hdr.Length - sizeof (SMBIOS_HEADER)) / (2 * sizeof (UINT8));
+ NumOfDevice = (Struct->Type10->Hdr.Length - sizeof (SMBIOS_HEADER)) / (2 * sizeof (UINT8));
for (Index = 0; Index < NumOfDevice; Index++) {
- DisplayOnboardDeviceTypes (pStruct->Type10->Device[Index].DeviceType, Option);
+ DisplayOnboardDeviceTypes (Struct->Type10->Device[Index].DeviceType, Option);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DESC_STRING), gShellDebug1HiiHandle);
- ShellPrintEx(-1,-1,L"%a",LibGetSmbiosString (pStruct, pStruct->Type10->Device[Index].DescriptionString));
+ ShellPrintEx(-1,-1,L"%a",LibGetSmbiosString (Struct, Struct->Type10->Device[Index].DescriptionString));
}
}
break;
case 11:
- PrintStructValue (pStruct, Type11, StringCount);
- for (Index = 1; Index <= pStruct->Type11->StringCount; Index++) {
- ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (pStruct, Index));
+ PRINT_STRUCT_VALUE (Struct, Type11, StringCount);
+ for (Index = 1; Index <= Struct->Type11->StringCount; Index++) {
+ ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (Struct, Index));
}
break;
case 12:
- PrintStructValue (pStruct, Type12, StringCount);
- for (Index = 1; Index <= pStruct->Type12->StringCount; Index++) {
- ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (pStruct, Index));
+ PRINT_STRUCT_VALUE (Struct, Type12, StringCount);
+ for (Index = 1; Index <= Struct->Type12->StringCount; Index++) {
+ ShellPrintEx(-1,-1,L"%a\n", LibGetSmbiosString (Struct, Index));
}
break;
case 13:
- PrintStructValue (pStruct, Type13, InstallableLanguages);
- PrintStructValue (pStruct, Type13, Flags);
- PrintBitField (pStruct, Type13, reserved, 15);
- PrintPendingString (pStruct, Type13, CurrentLanguages);
+ PRINT_STRUCT_VALUE (Struct, Type13, InstallableLanguages);
+ PRINT_STRUCT_VALUE (Struct, Type13, Flags);
+ PRINT_BIT_FIELD (Struct, Type13, Reserved, 15);
+ PRINT_PENDING_STRING (Struct, Type13, CurrentLanguages);
break;
case 14:
- PrintPendingString (pStruct, Type14, GroupName);
- PrintStructValue (pStruct, Type14, ItemType);
- PrintStructValue (pStruct, Type14, ItemHandle);
+ PRINT_PENDING_STRING (Struct, Type14, GroupName);
+ PRINT_STRUCT_VALUE (Struct, Type14, ItemType);
+ PRINT_STRUCT_VALUE (Struct, Type14, ItemHandle);
break;
//
@@ -509,20 +493,20 @@ Returns:
UINT8 Count;
UINT8 *AccessMethodAddress;
- PrintStructValueH (pStruct, Type15, LogAreaLength);
- PrintStructValueH (pStruct, Type15, LogHeaderStartOffset);
- PrintStructValueH (pStruct, Type15, LogDataStartOffset);
- DisplaySELAccessMethod (pStruct->Type15->AccessMethod, Option);
- PrintStructValueH (pStruct, Type15, AccessMethodAddress);
- DisplaySELLogStatus (pStruct->Type15->LogStatus, Option);
- PrintStructValueH (pStruct, Type15, LogChangeToken);
- DisplaySysEventLogHeaderFormat (pStruct->Type15->LogHeaderFormat, Option);
- PrintStructValueH (pStruct, Type15, NumberOfSupportedLogTypeDescriptors);
- PrintStructValueH (pStruct, Type15, LengthOfLogTypeDescriptor);
-
- Count = pStruct->Type15->NumberOfSupportedLogTypeDescriptors;
+ PRINT_STRUCT_VALUE_H (Struct, Type15, LogAreaLength);
+ PRINT_STRUCT_VALUE_H (Struct, Type15, LogHeaderStartOffset);
+ PRINT_STRUCT_VALUE_H (Struct, Type15, LogDataStartOffset);
+ DisplaySELAccessMethod (Struct->Type15->AccessMethod, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type15, AccessMethodAddress);
+ DisplaySELLogStatus (Struct->Type15->LogStatus, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type15, LogChangeToken);
+ DisplaySysEventLogHeaderFormat (Struct->Type15->LogHeaderFormat, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type15, NumberOfSupportedLogTypeDescriptors);
+ PRINT_STRUCT_VALUE_H (Struct, Type15, LengthOfLogTypeDescriptor);
+
+ Count = Struct->Type15->NumberOfSupportedLogTypeDescriptors;
if (Count > 0) {
- Ptr = pStruct->Type15->EventLogTypeDescriptors;
+ Ptr = Struct->Type15->EventLogTypeDescriptors;
//
// Display all Event Log type descriptors supported by system
@@ -534,9 +518,9 @@ Returns:
}
if (Option >= SHOW_DETAIL) {
- switch (pStruct->Type15->AccessMethod) {
+ switch (Struct->Type15->AccessMethod) {
case 03:
- AccessMethodAddress = (UINT8 *) (UINTN) (pStruct->Type15->AccessMethodAddress);
+ AccessMethodAddress = (UINT8 *) (UINTN) (Struct->Type15->AccessMethodAddress);
break;
case 00:
@@ -547,7 +531,7 @@ Returns:
ShellPrintHiiEx(-1,-1,NULL,
STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACCESS_METHOD_NOT_SUPOPRTED),
gShellDebug1HiiHandle,
- pStruct->Type15->AccessMethod
+ Struct->Type15->AccessMethod
);
return EFI_UNSUPPORTED;
}
@@ -558,8 +542,8 @@ Returns:
// of the event-log's header, from the Access Method Address
//
DisplaySysEventLogHeader (
- pStruct->Type15->LogHeaderFormat,
- AccessMethodAddress + pStruct->Type15->LogHeaderStartOffset
+ Struct->Type15->LogHeaderFormat,
+ AccessMethodAddress + Struct->Type15->LogHeaderStartOffset
);
//
@@ -569,11 +553,11 @@ Returns:
// of the event-log's first data byte, from the Access Method Address(0x14)
//
DisplaySysEventLogData (
- AccessMethodAddress + pStruct->Type15->LogDataStartOffset,
+ AccessMethodAddress + Struct->Type15->LogDataStartOffset,
(UINT16)
(
- pStruct->Type15->LogAreaLength -
- (pStruct->Type15->LogDataStartOffset - pStruct->Type15->LogDataStartOffset)
+ Struct->Type15->LogAreaLength -
+ (Struct->Type15->LogDataStartOffset - Struct->Type15->LogDataStartOffset)
)
);
}
@@ -586,39 +570,39 @@ Returns:
// Physical Memory Array (Type 16)
//
case 16:
- DisplayPMALocation (pStruct->Type16->Location, Option);
- DisplayPMAUse (pStruct->Type16->Use, Option);
+ DisplayPMALocation (Struct->Type16->Location, Option);
+ DisplayPMAUse (Struct->Type16->Use, Option);
DisplayPMAErrorCorrectionTypes (
- pStruct->Type16->MemoryErrorCorrection,
+ Struct->Type16->MemoryErrorCorrection,
Option
);
- PrintStructValueH (pStruct, Type16, MaximumCapacity);
- PrintStructValueH (pStruct, Type16, MemoryErrorInformationHandle);
- PrintStructValueH (pStruct, Type16, NumberOfMemoryDevices);
+ PRINT_STRUCT_VALUE_H (Struct, Type16, MaximumCapacity);
+ PRINT_STRUCT_VALUE_H (Struct, Type16, MemoryErrorInformationHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type16, NumberOfMemoryDevices);
break;
//
// Memory Device (Type 17)
//
case 17:
- PrintStructValueH (pStruct, Type17, MemoryArrayHandle);
- PrintStructValueH (pStruct, Type17, MemoryErrorInformationHandle);
- PrintStructValue (pStruct, Type17, TotalWidth);
- PrintStructValue (pStruct, Type17, DataWidth);
- PrintStructValue (pStruct, Type17, Size);
- DisplayMemoryDeviceFormFactor (pStruct->Type17->FormFactor, Option);
- PrintStructValueH (pStruct, Type17, DeviceSet);
- PrintPendingString (pStruct, Type17, DeviceLocator);
- PrintPendingString (pStruct, Type17, BankLocator);
- DisplayMemoryDeviceType (pStruct->Type17->MemoryType, Option);
- DisplayMemoryDeviceTypeDetail (pStruct->Type17->TypeDetail, Option);
- PrintStructValueH (pStruct, Type17, Speed);
- PrintPendingString (pStruct, Type17, Manufacturer);
- PrintPendingString (pStruct, Type17, SerialNumber);
- PrintPendingString (pStruct, Type17, AssetTag);
- PrintPendingString (pStruct, Type17, PartNumber);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryArrayHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, MemoryErrorInformationHandle);
+ PRINT_STRUCT_VALUE (Struct, Type17, TotalWidth);
+ PRINT_STRUCT_VALUE (Struct, Type17, DataWidth);
+ PRINT_STRUCT_VALUE (Struct, Type17, Size);
+ DisplayMemoryDeviceFormFactor (Struct->Type17->FormFactor, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, DeviceSet);
+ PRINT_PENDING_STRING (Struct, Type17, DeviceLocator);
+ PRINT_PENDING_STRING (Struct, Type17, BankLocator);
+ DisplayMemoryDeviceType (Struct->Type17->MemoryType, Option);
+ DisplayMemoryDeviceTypeDetail (Struct->Type17->TypeDetail, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, Speed);
+ PRINT_PENDING_STRING (Struct, Type17, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type17, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type17, AssetTag);
+ PRINT_PENDING_STRING (Struct, Type17, PartNumber);
if (SmbiosMajorVersion > 0x2 || (SmbiosMajorVersion == 0x2 && SmbiosMinorVersion >= 0x6)) {
- PrintStructValueH (pStruct, Type17, Attributes);
+ PRINT_STRUCT_VALUE_H (Struct, Type17, Attributes);
}
break;
@@ -626,154 +610,154 @@ Returns:
// 32-bit Memory Error Information (Type 18)
//
case 18:
- DisplayMemoryErrorType (pStruct->Type18->ErrorType, Option);
+ DisplayMemoryErrorType (Struct->Type18->ErrorType, Option);
DisplayMemoryErrorGranularity (
- pStruct->Type18->ErrorGranularity,
+ Struct->Type18->ErrorGranularity,
Option
);
- DisplayMemoryErrorOperation (pStruct->Type18->ErrorOperation, Option);
- PrintStructValueH (pStruct, Type18, VendorSyndrome);
- PrintStructValueH (pStruct, Type18, MemoryArrayErrorAddress);
- PrintStructValueH (pStruct, Type18, DeviceErrorAddress);
- PrintStructValueH (pStruct, Type18, ErrorResolution);
+ DisplayMemoryErrorOperation (Struct->Type18->ErrorOperation, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, VendorSyndrome);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, MemoryArrayErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, DeviceErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type18, ErrorResolution);
break;
//
// Memory Array Mapped Address (Type 19)
//
case 19:
- PrintStructValueH (pStruct, Type19, StartingAddress);
- PrintStructValueH (pStruct, Type19, EndingAddress);
- PrintStructValueH (pStruct, Type19, MemoryArrayHandle);
- PrintStructValueH (pStruct, Type19, PartitionWidth);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, StartingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, EndingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, MemoryArrayHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type19, PartitionWidth);
break;
//
// Memory Device Mapped Address (Type 20)
//
case 20:
- PrintStructValueH (pStruct, Type20, StartingAddress);
- PrintStructValueH (pStruct, Type20, EndingAddress);
- PrintStructValueH (pStruct, Type20, MemoryDeviceHandle);
- PrintStructValueH (pStruct, Type20, MemoryArrayMappedAddressHandle);
- PrintStructValueH (pStruct, Type20, PartitionRowPosition);
- PrintStructValueH (pStruct, Type20, InterleavePosition);
- PrintStructValueH (pStruct, Type20, InterleavedDataDepth);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, StartingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, EndingAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryDeviceHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, MemoryArrayMappedAddressHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, PartitionRowPosition);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavePosition);
+ PRINT_STRUCT_VALUE_H (Struct, Type20, InterleavedDataDepth);
break;
//
// Built-in Pointing Device (Type 21)
//
case 21:
- DisplayPointingDeviceType (pStruct->Type21->Type, Option);
- DisplayPointingDeviceInterface (pStruct->Type21->Interface, Option);
- PrintStructValue (pStruct, Type21, NumberOfButtons);
+ DisplayPointingDeviceType (Struct->Type21->Type, Option);
+ DisplayPointingDeviceInterface (Struct->Type21->Interface, Option);
+ PRINT_STRUCT_VALUE (Struct, Type21, NumberOfButtons);
break;
//
// Portable Battery (Type 22)
//
case 22:
- PrintPendingString (pStruct, Type22, Location);
- PrintPendingString (pStruct, Type22, Manufacturer);
- PrintPendingString (pStruct, Type22, ManufactureDate);
- PrintPendingString (pStruct, Type22, SerialNumber);
- PrintPendingString (pStruct, Type22, DeviceName);
+ PRINT_PENDING_STRING (Struct, Type22, Location);
+ PRINT_PENDING_STRING (Struct, Type22, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type22, ManufactureDate);
+ PRINT_PENDING_STRING (Struct, Type22, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type22, DeviceName);
DisplayPBDeviceChemistry (
- pStruct->Type22->DeviceChemistry,
+ Struct->Type22->DeviceChemistry,
Option
);
- PrintStructValueH (pStruct, Type22, DeviceCapacity);
- PrintStructValueH (pStruct, Type22, DesignVoltage);
- PrintPendingString (pStruct, Type22, SBDSVersionNumber);
- PrintStructValueH (pStruct, Type22, MaximumErrorInBatteryData);
- PrintStructValueH (pStruct, Type22, SBDSSerialNumber);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, DeviceCapacity);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, DesignVoltage);
+ PRINT_PENDING_STRING (Struct, Type22, SBDSVersionNumber);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, MaximumErrorInBatteryData);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, SBDSSerialNumber);
DisplaySBDSManufactureDate (
- pStruct->Type22->SBDSManufactureDate,
+ Struct->Type22->SBDSManufactureDate,
Option
);
- PrintPendingString (pStruct, Type22, SBDSDeviceChemistry);
- PrintStructValueH (pStruct, Type22, DesignCapacityMultiplier);
- PrintStructValueH (pStruct, Type22, OEMSpecific);
+ PRINT_PENDING_STRING (Struct, Type22, SBDSDeviceChemistry);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, DesignCapacityMultiplier);
+ PRINT_STRUCT_VALUE_H (Struct, Type22, OEMSpecific);
break;
case 23:
DisplaySystemResetCapabilities (
- pStruct->Type23->Capabilities,
+ Struct->Type23->Capabilities,
Option
);
- PrintStructValueH (pStruct, Type23, ResetCount);
- PrintStructValueH (pStruct, Type23, ResetLimit);
- PrintStructValueH (pStruct, Type23, TimerInterval);
- PrintStructValueH (pStruct, Type23, Timeout);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, ResetCount);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, ResetLimit);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, TimerInterval);
+ PRINT_STRUCT_VALUE_H (Struct, Type23, Timeout);
break;
case 24:
DisplayHardwareSecuritySettings (
- pStruct->Type24->HardwareSecuritySettings,
+ Struct->Type24->HardwareSecuritySettings,
Option
);
break;
case 25:
- PrintStructValueH (pStruct, Type25, NextScheduledPowerOnMonth);
- PrintStructValueH (pStruct, Type25, NextScheduledPowerOnDayOfMonth);
- PrintStructValueH (pStruct, Type25, NextScheduledPowerOnHour);
- PrintStructValueH (pStruct, Type25, NextScheduledPowerOnMinute);
- PrintStructValueH (pStruct, Type25, NextScheduledPowerOnSecond);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMonth);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnDayOfMonth);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnHour);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnMinute);
+ PRINT_STRUCT_VALUE_H (Struct, Type25, NextScheduledPowerOnSecond);
break;
case 26:
- PrintPendingString (pStruct, Type26, Description);
- DisplayVPLocation (pStruct->Type26->LocationAndStatus, Option);
- DisplayVPStatus (pStruct->Type26->LocationAndStatus, Option);
- PrintStructValueH (pStruct, Type26, MaximumValue);
- PrintStructValueH (pStruct, Type26, MinimumValue);
- PrintStructValueH (pStruct, Type26, Resolution);
- PrintStructValueH (pStruct, Type26, Tolerance);
- PrintStructValueH (pStruct, Type26, Accuracy);
- PrintStructValueH (pStruct, Type26, OEMDefined);
- PrintStructValueH (pStruct, Type26, NominalValue);
+ PRINT_PENDING_STRING (Struct, Type26, Description);
+ DisplayVPLocation (Struct->Type26->LocationAndStatus, Option);
+ DisplayVPStatus (Struct->Type26->LocationAndStatus, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, MaximumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, MinimumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, Resolution);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, Tolerance);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, Accuracy);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type26, NominalValue);
break;
case 27:
- PrintStructValueH (pStruct, Type27, TemperatureProbeHandle);
- DisplayCoolingDeviceStatus (pStruct->Type27->DeviceTypeAndStatus, Option);
- DisplayCoolingDeviceType (pStruct->Type27->DeviceTypeAndStatus, Option);
- PrintStructValueH (pStruct, Type27, CoolingUnitGroup);
- PrintStructValueH (pStruct, Type27, OEMDefined);
- PrintStructValueH (pStruct, Type27, NominalSpeed);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, TemperatureProbeHandle);
+ DisplayCoolingDeviceStatus (Struct->Type27->DeviceTypeAndStatus, Option);
+ DisplayCoolingDeviceType (Struct->Type27->DeviceTypeAndStatus, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, CoolingUnitGroup);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type27, NominalSpeed);
break;
case 28:
- PrintPendingString (pStruct, Type28, Description);
- DisplayTemperatureProbeStatus (pStruct->Type28->LocationAndStatus, Option);
- DisplayTemperatureProbeLoc (pStruct->Type28->LocationAndStatus, Option);
- PrintStructValueH (pStruct, Type28, MaximumValue);
- PrintStructValueH (pStruct, Type28, MinimumValue);
- PrintStructValueH (pStruct, Type28, Resolution);
- PrintStructValueH (pStruct, Type28, Tolerance);
- PrintStructValueH (pStruct, Type28, Accuracy);
- PrintStructValueH (pStruct, Type28, OEMDefined);
- PrintStructValueH (pStruct, Type28, NominalValue);
+ PRINT_PENDING_STRING (Struct, Type28, Description);
+ DisplayTemperatureProbeStatus (Struct->Type28->LocationAndStatus, Option);
+ DisplayTemperatureProbeLoc (Struct->Type28->LocationAndStatus, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, MaximumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, MinimumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, Resolution);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, Tolerance);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, Accuracy);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type28, NominalValue);
break;
case 29:
- PrintPendingString (pStruct, Type29, Description);
- DisplayECPStatus (pStruct->Type29->LocationAndStatus, Option);
- DisplayECPLoc (pStruct->Type29->LocationAndStatus, Option);
- PrintStructValueH (pStruct, Type29, MaximumValue);
- PrintStructValueH (pStruct, Type29, MinimumValue);
- PrintStructValueH (pStruct, Type29, Resolution);
- PrintStructValueH (pStruct, Type29, Tolerance);
- PrintStructValueH (pStruct, Type29, Accuracy);
- PrintStructValueH (pStruct, Type29, OEMDefined);
- PrintStructValueH (pStruct, Type29, NominalValue);
+ PRINT_PENDING_STRING (Struct, Type29, Description);
+ DisplayECPStatus (Struct->Type29->LocationAndStatus, Option);
+ DisplayECPLoc (Struct->Type29->LocationAndStatus, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, MaximumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, MinimumValue);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, Resolution);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, Tolerance);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, Accuracy);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, OEMDefined);
+ PRINT_STRUCT_VALUE_H (Struct, Type29, NominalValue);
break;
case 30:
- PrintPendingString (pStruct, Type30, ManufacturerName);
- DisplayOBRAConnections (pStruct->Type30->Connections, Option);
+ PRINT_PENDING_STRING (Struct, Type30, ManufacturerName);
+ DisplayOBRAConnections (Struct->Type30->Connections, Option);
break;
case 31:
@@ -781,47 +765,47 @@ Returns:
break;
case 32:
- PrintBitField (pStruct, Type32, Reserved, 6);
- DisplaySystemBootStatus (pStruct->Type32->BootStatus[0], Option);
+ PRINT_BIT_FIELD (Struct, Type32, Reserved, 6);
+ DisplaySystemBootStatus (Struct->Type32->BootStatus[0], Option);
break;
case 33:
- DisplayMemoryErrorType (pStruct->Type33->ErrorType, Option);
+ DisplayMemoryErrorType (Struct->Type33->ErrorType, Option);
DisplayMemoryErrorGranularity (
- pStruct->Type33->ErrorGranularity,
+ Struct->Type33->ErrorGranularity,
Option
);
- DisplayMemoryErrorOperation (pStruct->Type33->ErrorOperation, Option);
- PrintStructValueH (pStruct, Type33, VendorSyndrome);
- PrintStructValueH (pStruct, Type33, MemoryArrayErrorAddress);
- PrintStructValueH (pStruct, Type33, DeviceErrorAddress);
- PrintStructValueH (pStruct, Type33, ErrorResolution);
+ DisplayMemoryErrorOperation (Struct->Type33->ErrorOperation, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type33, VendorSyndrome);
+ PRINT_STRUCT_VALUE_H (Struct, Type33, MemoryArrayErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type33, DeviceErrorAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type33, ErrorResolution);
break;
//
// Management Device (Type 34)
//
case 34:
- PrintPendingString (pStruct, Type34, Description);
- DisplayMDType (pStruct->Type34->Type, Option);
- PrintStructValueH (pStruct, Type34, Address);
- PrintStructValueH (pStruct, Type34, AddressType);
+ PRINT_PENDING_STRING (Struct, Type34, Description);
+ DisplayMDType (Struct->Type34->Type, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type34, Address);
+ PRINT_STRUCT_VALUE_H (Struct, Type34, AddressType);
break;
case 35:
- PrintPendingString (pStruct, Type35, Description);
- PrintStructValueH (pStruct, Type35, ManagementDeviceHandle);
- PrintStructValueH (pStruct, Type35, ComponentHandle);
- PrintStructValueH (pStruct, Type35, ThresholdHandle);
+ PRINT_PENDING_STRING (Struct, Type35, Description);
+ PRINT_STRUCT_VALUE_H (Struct, Type35, ManagementDeviceHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type35, ComponentHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type35, ThresholdHandle);
break;
case 36:
- PrintStructValueH (pStruct, Type36, LowerThresholdNonCritical);
- PrintStructValueH (pStruct, Type36, UpperThresholdNonCritical);
- PrintStructValueH (pStruct, Type36, LowerThresholdCritical);
- PrintStructValueH (pStruct, Type36, UpperThresholdCritical);
- PrintStructValueH (pStruct, Type36, LowerThresholdNonRecoverable);
- PrintStructValueH (pStruct, Type36, UpperThresholdNonRecoverable);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdCritical);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, LowerThresholdNonRecoverable);
+ PRINT_STRUCT_VALUE_H (Struct, Type36, UpperThresholdNonRecoverable);
break;
//
@@ -831,12 +815,12 @@ Returns:
{
UINT8 Count;
MEMORYDEVICE *Ptr;
- DisplayMemoryChannelType (pStruct->Type37->ChannelType, Option);
- PrintStructValueH (pStruct, Type37, MaximumChannelLoad);
- PrintStructValueH (pStruct, Type37, MemoryDeviceCount);
+ DisplayMemoryChannelType (Struct->Type37->ChannelType, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type37, MaximumChannelLoad);
+ PRINT_STRUCT_VALUE_H (Struct, Type37, MemoryDeviceCount);
- Count = pStruct->Type37->MemoryDeviceCount;
- Ptr = pStruct->Type37->MemoryDevice;
+ Count = Struct->Type37->MemoryDeviceCount;
+ Ptr = Struct->Type37->MemoryDevice;
for (Index = 0; Index < Count; Index++) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEM_DEVICE), gShellDebug1HiiHandle, Index + 1);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_DEV_LOAD), gShellDebug1HiiHandle, Ptr->DeviceLoad);
@@ -849,33 +833,33 @@ Returns:
// IPMI Device Information (Type 38)
//
case 38:
- DisplayIPMIDIBMCInterfaceType (pStruct->Type38->InterfaceType, Option);
- PrintStructValueH (pStruct, Type38, IPMISpecificationRevision);
- PrintStructValueH (pStruct, Type38, I2CSlaveAddress);
- PrintStructValueH (pStruct, Type38, NVStorageDeviceAddress);
- PrintStructValueH (pStruct, Type38, BaseAddress);
+ DisplayIPMIDIBMCInterfaceType (Struct->Type38->InterfaceType, Option);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, IPMISpecificationRevision);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, I2CSlaveAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, NVStorageDeviceAddress);
+ PRINT_STRUCT_VALUE_H (Struct, Type38, BaseAddress);
break;
//
// System Power Supply (Type 39)
//
case 39:
- PrintStructValueH (pStruct, Type39, PowerUnitGroup);
- PrintPendingString (pStruct, Type39, Location);
- PrintPendingString (pStruct, Type39, DeviceName);
- PrintPendingString (pStruct, Type39, Manufacturer);
- PrintPendingString (pStruct, Type39, SerialNumber);
- PrintPendingString (pStruct, Type39, AssetTagNumber);
- PrintPendingString (pStruct, Type39, ModelPartNumber);
- PrintPendingString (pStruct, Type39, RevisionLevel);
- PrintStructValueH (pStruct, Type39, MaxPowerCapacity);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, PowerUnitGroup);
+ PRINT_PENDING_STRING (Struct, Type39, Location);
+ PRINT_PENDING_STRING (Struct, Type39, DeviceName);
+ PRINT_PENDING_STRING (Struct, Type39, Manufacturer);
+ PRINT_PENDING_STRING (Struct, Type39, SerialNumber);
+ PRINT_PENDING_STRING (Struct, Type39, AssetTagNumber);
+ PRINT_PENDING_STRING (Struct, Type39, ModelPartNumber);
+ PRINT_PENDING_STRING (Struct, Type39, RevisionLevel);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, MaxPowerCapacity);
DisplaySPSCharacteristics (
- pStruct->Type39->PowerSupplyCharacteristics,
+ Struct->Type39->PowerSupplyCharacteristics,
Option
);
- PrintStructValueH (pStruct, Type39, InputVoltageProbeHandle);
- PrintStructValueH (pStruct, Type39, CoolingDeviceHandle);
- PrintStructValueH (pStruct, Type39, InputCurrentProbeHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, InputVoltageProbeHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, CoolingDeviceHandle);
+ PRINT_STRUCT_VALUE_H (Struct, Type39, InputCurrentProbeHandle);
break;
//
@@ -888,18 +872,18 @@ Returns:
ADDITIONAL_INFORMATION_ENTRY *Entries;
EntryLength = 0;
- Entries = pStruct->Type40->AdditionalInfoEntries;
- NumberOfEntries = pStruct->Type40->NumberOfAdditionalInformationEntries;
+ Entries = Struct->Type40->AdditionalInfoEntries;
+ NumberOfEntries = Struct->Type40->NumberOfAdditionalInformationEntries;
- PrintStructValueH (pStruct, Type40, NumberOfAdditionalInformationEntries);
+ PRINT_STRUCT_VALUE_H (Struct, Type40, NumberOfAdditionalInformationEntries);
for (Index = 0; Index < NumberOfEntries; Index++) {
EntryLength = Entries->EntryLength;
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_ENTRYLEN), gShellDebug1HiiHandle, EntryLength);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDHANDLE), gShellDebug1HiiHandle, Entries->ReferencedHandle);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDOFFSET), gShellDebug1HiiHandle, Entries->ReferencedOffset);
- PrintSmbiosString (pStruct, Entries->EntryString, String);
- PrintSmbiosBitField (pStruct, Entries->Value, Value, EntryLength - 5);
+ PRINT_SMBIOS_STRING (Struct, Entries->EntryString, String);
+ PRINT_SMBIOS_BIT_FIELD (Struct, Entries->Value, Value, EntryLength - 5);
Entries = (ADDITIONAL_INFORMATION_ENTRY *) ((UINT8 *)Entries + EntryLength);
}
}
@@ -909,12 +893,12 @@ Returns:
// Onboard Devices Extended Information (Type 41)
//
case 41:
- PrintPendingString (pStruct, Type41, ReferenceDesignation);
- PrintStructValueH (pStruct, Type41, DeviceType);
- PrintStructValueH (pStruct, Type41, DeviceTypeInstance);
- PrintStructValueH (pStruct, Type41, SegmentGroupNum);
- PrintStructValueH (pStruct, Type41, BusNum);
- PrintStructValueH (pStruct, Type41, DevFuncNum);
+ PRINT_PENDING_STRING (Struct, Type41, ReferenceDesignation);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceType);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, DeviceTypeInstance);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, SegmentGroupNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, BusNum);
+ PRINT_STRUCT_VALUE_H (Struct, Type41, DevFuncNum);
break;
case 126:
@@ -933,10 +917,16 @@ Returns:
return EFI_SUCCESS;
}
+/**
+ Display BIOS Information (Type 0) information.
+
+ @param[in] Chara The information bits.
+ @param[in] Option The optional information.
+**/
VOID
DisplayBiosCharacteristics (
- UINT64 chara,
- UINT8 Option
+ IN UINT64 Chara,
+ IN UINT8 Option
)
{
//
@@ -946,199 +936,211 @@ DisplayBiosCharacteristics (
//
// print option
//
- PRINT_INFO_OPTION (chara, Option);
+ PRINT_INFO_OPTION (Chara, Option);
//
// Check all the bits and print information
// This function does not use Table because table of bits
// are designed not to deal with UINT64
//
- if (BIT (chara, 0) != 0) {
+ if (BIT (Chara, 0) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 1) != 0) {
+ if (BIT (Chara, 1) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_RESERVED_BIT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 2) != 0) {
+ if (BIT (Chara, 2) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_UNKNOWN_BIT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 3) != 0) {
+ if (BIT (Chara, 3) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_NOT_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 4) != 0) {
+ if (BIT (Chara, 4) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ISA_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 5) != 0) {
+ if (BIT (Chara, 5) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MSA_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 6) != 0) {
+ if (BIT (Chara, 6) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EISA_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 7) != 0) {
+ if (BIT (Chara, 7) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PCI_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 8) != 0) {
+ if (BIT (Chara, 8) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PC_CARD_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 9) != 0) {
+ if (BIT (Chara, 9) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PLUG_PLAY_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 10) != 0) {
+ if (BIT (Chara, 10) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_APM_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 11) != 0) {
+ if (BIT (Chara, 11) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_UPGRADEABLE), gShellDebug1HiiHandle);
}
- if (BIT (chara, 12) != 0) {
+ if (BIT (Chara, 12) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_SHADOWING), gShellDebug1HiiHandle);
}
- if (BIT (chara, 13) != 0) {
+ if (BIT (Chara, 13) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_VESA_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 14) != 0) {
+ if (BIT (Chara, 14) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ECSD_SUPPORT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 15) != 0) {
+ if (BIT (Chara, 15) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FORM_CD_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 16) != 0) {
+ if (BIT (Chara, 16) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SELECTED_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 17) != 0) {
+ if (BIT (Chara, 17) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_ROM_SOCKETED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 18) != 0) {
+ if (BIT (Chara, 18) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BOOT_FROM_PC_CARD), gShellDebug1HiiHandle);
}
- if (BIT (chara, 19) != 0) {
+ if (BIT (Chara, 19) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_EDD_ENHANCED_DRIVER), gShellDebug1HiiHandle);
}
- if (BIT (chara, 20) != 0) {
+ if (BIT (Chara, 20) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_NEC), gShellDebug1HiiHandle);
}
- if (BIT (chara, 21) != 0) {
+ if (BIT (Chara, 21) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_JAPANESE_FLOPPY_TOSHIBA), gShellDebug1HiiHandle);
}
- if (BIT (chara, 22) != 0) {
+ if (BIT (Chara, 22) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_FLOPPY_SERVICES_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (chara, 23) != 0) {
+ if (BIT (Chara, 23) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ONE_POINT_TWO_MB), gShellDebug1HiiHandle);
}
- if (BIT (chara, 24) != 0) {
+ if (BIT (Chara, 24) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_720_KB), gShellDebug1HiiHandle);
}
- if (BIT (chara, 25) != 0) {
+ if (BIT (Chara, 25) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_TWO_POINT_EIGHT_EIGHT_MB), gShellDebug1HiiHandle);
}
- if (BIT (chara, 26) != 0) {
+ if (BIT (Chara, 26) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINT_SCREEN_SUPPORT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 27) != 0) {
+ if (BIT (Chara, 27) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_KEYBOARD_SERV_SUPPORT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 28) != 0) {
+ if (BIT (Chara, 28) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SERIAL_SERVICES_SUPPORT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 29) != 0) {
+ if (BIT (Chara, 29) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PRINTER_SERVICES_SUPPORT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 30) != 0) {
+ if (BIT (Chara, 30) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONO_VIDEO_SUPPORT), gShellDebug1HiiHandle);
}
- if (BIT (chara, 31) != 0) {
+ if (BIT (Chara, 31) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_NEC_PC_98), gShellDebug1HiiHandle);
}
//
- // Just print the reserved
+ // Just print the Reserved
//
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_32_47), gShellDebug1HiiHandle);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_48_64), gShellDebug1HiiHandle);
}
+/**
+ Display Bios Characteristice extensions1 information.
+
+ @param[in] Byte1 The information.
+ @param[in] Option The optional information.
+**/
VOID
DisplayBiosCharacteristicsExt1 (
- UINT8 byte1,
- UINT8 Option
+ IN UINT8 Byte1,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION), gShellDebug1HiiHandle);
//
// Print option
//
- PRINT_INFO_OPTION (byte1, Option);
+ PRINT_INFO_OPTION (Byte1, Option);
//
// check bit and print
//
- if (BIT (byte1, 0) != 0) {
+ if (BIT (Byte1, 0) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ACPI_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 1) != 0) {
+ if (BIT (Byte1, 1) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_USB_LEGACY_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 2) != 0) {
+ if (BIT (Byte1, 2) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_AGP_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 3) != 0) {
+ if (BIT (Byte1, 3) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_I2O_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 4) != 0) {
+ if (BIT (Byte1, 4) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_LS_120_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 5) != 0) {
+ if (BIT (Byte1, 5) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ATAPI_ZIP_DRIVE), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 6) != 0) {
+ if (BIT (Byte1, 6) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_1394_BOOT_SUPPORTED), gShellDebug1HiiHandle);
}
- if (BIT (byte1, 7) != 0) {
+ if (BIT (Byte1, 7) != 0) {
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SMART_BATTERY_SUPPORTED), gShellDebug1HiiHandle);
}
}
+/**
+ Display Bios Characteristice extensions2 information.
+
+ @param[in] byte2 The information.
+ @param[in] Option The optional information.
+**/
VOID
DisplayBiosCharacteristicsExt2 (
- UINT8 byte2,
- UINT8 Option
+ IN UINT8 byte2,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BIOS_CHAR_EXTENSION_2), gShellDebug1HiiHandle);
@@ -1158,6 +1160,12 @@ DisplayBiosCharacteristicsExt2 (
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_BITS_RSVD_FOR_FUTURE), gShellDebug1HiiHandle);
}
+/**
+ Display Processor Information (Type 4) information.
+
+ @param[in] Family The family value.
+ @param[in] Option The option value.
+**/
VOID
DisplayProcessorFamily (
UINT8 Family,
@@ -1723,10 +1731,16 @@ DisplayProcessorFamily (
//
}
+/**
+ Display processor family information.
+
+ @param[in] Family2 The family value.
+ @param[in] Option The option value.
+**/
VOID
DisplayProcessorFamily2 (
- UINT16 Family2,
- UINT8 Option
+ IN UINT16 Family2,
+ IN UINT8 Option
)
{
//
@@ -1789,36 +1803,33 @@ DisplayProcessorFamily2 (
}
+/**
+ Display processor voltage information.
+
+ @param[in] Voltage The Voltage.
+ Bit 7 Set to 0, indicating 'legacy' mode for processor voltage
+ Bits 6:4 Reserved, must be zero
+ Bits 3:0 Voltage Capability.
+ A Set bit indicates that the voltage is supported.
+ Bit 0 - 5V
+ Bit 1 - 3.3V
+ Bit 2 - 2.9V
+ Bit 3 - Reserved, must be zero.
+
+ Note:
+ Setting of multiple bits indicates the socket is configurable
+ If bit 7 is set to 1, the remaining seven bits of the field are set to
+ contain the processor's current voltage times 10.
+ For example, the field value for a processor voltage of 1.8 volts would be
+ 92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.
+
+ @param[in] Option The option.
+**/
VOID
DisplayProcessorVoltage (
- UINT8 Voltage,
- UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
)
-/*++
-Routine Description:
- Bit 7 Set to 0, indicating 'legacy' mode for processor voltage
- Bits 6:4 Reserved, must be zero
- Bits 3:0 Voltage Capability.
- A Set bit indicates that the voltage is supported.
- Bit 0 - 5V
- Bit 1 - 3.3V
- Bit 2 - 2.9V
- Bit 3 - Reserved, must be zero.
-
- Note:
- Setting of multiple bits indicates the socket is configurable
- If bit 7 is set to 1, the remaining seven bits of the field are set to
- contain the processor's current voltage times 10.
- For example, the field value for a processor voltage of 1.8 volts would be
- 92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.
-
-Arguments:
- Voltage - The Voltage
- Option - The option
-
-Returns:
-
-**/
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_INFO), gShellDebug1HiiHandle);
//
@@ -1861,35 +1872,31 @@ Returns:
}
}
+/**
+ Display processor information.
+
+ @param[in] Status The status.
+ Bit 7 Reserved, must be 0
+ Bit 6 CPU Socket Populated
+ 1 - CPU Socket Populated
+ 0 - CPU Socket UnpopulatedBits
+ 5:3 Reserved, must be zero
+ Bits 2:0 CPU Status
+ 0h - Unknown
+ 1h - CPU Enabled
+ 2h - CPU Disabled by User via BIOS Setup
+ 3h - CPU Disabled By BIOS (POST Error)
+ 4h - CPU is Idle, waiting to be enabled.
+ 5-6h - Reserved
+ 7h - Other
+
+ @param[in] Option The option
+**/
VOID
DisplayProcessorStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
-/*++
-Routine Description:
-
-Bit 7 Reserved, must be 0
-Bit 6 CPU Socket Populated
- 1 - CPU Socket Populated
- 0 - CPU Socket UnpopulatedBits
- 5:3 Reserved, must be zero
- Bits 2:0 CPU Status
- 0h - Unknown
- 1h - CPU Enabled
- 2h - CPU Disabled by User via BIOS Setup
- 3h - CPU Disabled By BIOS (POST Error)
- 4h - CPU is Idle, waiting to be enabled.
- 5-6h - Reserved
- 7h - Other
-
-Arguments:
- Status - The status
- Option - The option
-
-Returns:
-
-**/
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_PROC_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
@@ -1944,11 +1951,18 @@ Returns:
}
}
+/**
+ Display information about Memory Controller Information (Type 5).
+
+ @param[in] Size Memory size.
+ @param[in] SlotNum Which slot is this about.
+ @param[in] Option Option for the level of detail output required.
+**/
VOID
DisplayMaxMemoryModuleSize (
- UINT8 Size,
- UINT8 SlotNum,
- UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
)
{
UINTN MaxSize;
@@ -1965,11 +1979,18 @@ DisplayMaxMemoryModuleSize (
}
}
+/**
+ Display information about memory configuration handles.
+
+ @param[in] Handles The buffer of handles to output info on.
+ @param[in] SlotNum The number of handles in the above buffer.
+ @param[in] Option Option for the level of detail output required.
+**/
VOID
DisplayMemoryModuleConfigHandles (
- UINT16 *Handles,
- UINT8 SlotNum,
- UINT8 Option
+ IN UINT16 *Handles,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
)
{
UINT8 Index;
@@ -1989,13 +2010,17 @@ DisplayMemoryModuleConfigHandles (
}
}
}
-//
-// Memory Module Information (Type 6)
-//
+
+/**
+ Display Memory Module Information (Type 6).
+
+ @param[in] BankConnections
+ @param[in] Option
+**/
VOID
DisplayMmBankConnections (
- UINT8 BankConnections,
- UINT8 Option
+ IN UINT8 BankConnections,
+ IN UINT8 Option
)
{
UINT8 High;
@@ -2027,13 +2052,9 @@ DisplayMmBankConnections (
}
}
-VOID
-DisplayMmMemorySize (
- UINT8 Size,
- UINT8 Option
- )
-/*++
-Routine Description:
+/**
+ Display memory informcation.
+
Bits 0:6 Size (n),
where 2**n is the size in MB with three special-case values:
7Dh Not determinable (Installed Size only)
@@ -2042,13 +2063,14 @@ Routine Description:
Bit 7 Defines whether the memory module has a single- (0)
or double-bank (1) connection.
-Arguments:
- Size - The size
- Option - The option
-
-Returns:
-
+ @param[in] Size - The size
+ @param[in] Option - The option
**/
+VOID
+DisplayMmMemorySize (
+ IN UINT8 Size,
+ IN UINT8 Option
+ )
{
UINT8 Value;
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MEMORY_SIZE), gShellDebug1HiiHandle);
@@ -2078,28 +2100,21 @@ Returns:
}
}
-VOID
-DisplaySystemSlotId (
- UINT16 SlotId,
- UINT8 SlotType,
- UINT8 Option
- )
-/*++
-Routine Description:
-
+/**
The Slot ID field of the System Slot structure provides a mechanism to
correlate the physical attributes of the slot to its logical access method
(which varies based on the Slot Type field).
-Arguments:
-
- SlotId - The slot ID
- SlotType - The slot type
- Option - The Option
-
-Returns:
-
+ @param[in] SlotId - The slot ID
+ @param[in] SlotType - The slot type
+ @param[in] Option - The Option
**/
+VOID
+DisplaySystemSlotId (
+ IN UINT16 SlotId,
+ IN UINT8 SlotType,
+ IN UINT8 Option
+ )
{
//
// Display slot type first
@@ -2167,10 +2182,16 @@ Returns:
}
}
+/**
+ Display System Boot Information (Type 32) information.
+
+ @param[in] Parameter The parameter.
+ @param[in] Option The options.
+**/
VOID
DisplaySystemBootStatus (
- UINT8 Parameter,
- UINT8 Option
+ IN UINT8 Parameter,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_SYSTEM_BOOT_STATUS), gShellDebug1HiiHandle);
@@ -2210,16 +2231,10 @@ DisplaySystemBootStatus (
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_ERROR_VALUE), gShellDebug1HiiHandle);
}
}
-//
-// Portable Battery (Type 22)
-//
-VOID
-DisplaySBDSManufactureDate (
- UINT16 Date,
- UINT8 Option
- )
-/*++
-Routine Description:
+
+/**
+ Display Portable Battery (Type 22) information.
+
The date the cell pack was manufactured, in packed format:
Bits 15:9 Year, biased by 1980, in the range 0 to 127.
Bits 8:5 Month, in the range 1 to 12.
@@ -2227,13 +2242,14 @@ Routine Description:
For example, 01 February 2000 would be identified as
0010 1000 0100 0001b (0x2841).
-Arguments:
- Date - The date
- Option - The option
-
-Returns:
-
+ @param[in] Date The date
+ @param[in] Option The option
**/
+VOID
+DisplaySBDSManufactureDate (
+ IN UINT16 Date,
+ IN UINT8 Option
+ )
{
UINTN Day;
UINTN Month;
@@ -2250,41 +2266,37 @@ Returns:
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_MONTH_DAY_YEAR), gShellDebug1HiiHandle, Day, Month, Year);
}
-//
-// System Reset (Type 23)
-//
+
+/**
+ Display System Reset (Type 23) information.
+
+
+ Identifies the system-reset capabilities for the system.
+ Bits 7:6 Reserved for future assignment via this specification, set to 00b.
+ Bit 5 System contains a watchdog timer, either True (1) or False (0).
+ Bits 4:3 Boot Option on Limit.
+ Identifies the system action to be taken when the Reset Limit is reached, one of:
+ 00b Reserved, do not use.
+ 01b Operating system
+ 10b System utilities
+ 11b Do not rebootBits
+ 2:1 Boot Option. Indicates the action to be taken following a watchdog reset, one of:
+ 00b Reserved, do not use.
+ 01b Operating system
+ 10b System utilities
+ 11b Do not reboot
+ Bit 0 Status.
+ 1b The system reset is enabled by the user
+ 0b The system reset is not enabled by the user
+
+ @param[in] Reset Reset
+ @param[in] Option The option
+**/
VOID
DisplaySystemResetCapabilities (
- UINT8 Reset,
- UINT8 Option
+ IN UINT8 Reset,
+ IN UINT8 Option
)
-/*++
-Routine Description:
-Identifies the system-reset capabilities for the system.
- Bits 7:6 Reserved for future assignment via this specification, set to 00b.
- Bit 5 System contains a watchdog timer, either True (1) or False (0).
- Bits 4:3 Boot Option on Limit.
- Identifies the system action to be taken when the Reset Limit is reached, one of:
- 00b Reserved, do not use.
- 01b Operating system
- 10b System utilities
- 11b Do not rebootBits
- 2:1 Boot Option. Indicates the action to be taken following a watchdog reset, one of:
- 00b Reserved, do not use.
- 01b Operating system
- 10b System utilities
- 11b Do not reboot
- Bit 0 Status.
- 1b The system reset is enabled by the user
- 0b The system reset is not enabled by the user
-
-Arguments:
- Reset - Reset
- Option - The option
-
-Returns:
-
-**/
{
UINTN Temp;
@@ -2358,46 +2370,42 @@ Returns:
Print (L"The system reset is disabled by the user\n");
}
}
-//
-// Hardware Security (Type 24)
-//
+
+/**
+ Display Hardware Security (Type 24) information.
+
+
+ Identifies the password and reset status for the system:
+
+ Bits 7:6 Power-on Password Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+ Bits 5:4 Keyboard Password Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+ Bits 3:2 Administrator Password Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+ Bits 1:0 Front Panel Reset Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+
+ @param[in] Settings The device settings.
+ @param[in] Option The device options.
+**/
VOID
DisplayHardwareSecuritySettings (
- UINT8 Settings,
- UINT8 Option
+ IN UINT8 Settings,
+ IN UINT8 Option
)
-/*++
-Routine Description:
-Identifies the password and reset status for the system:
-
-Bits 7:6 Power-on Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-Bits 5:4 Keyboard Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-Bits 3:2 Administrator Password Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-Bits 1:0 Front Panel Reset Status, one of:
- 00b Disabled
- 01b Enabled
- 10b Not Implemented
- 11b Unknown
-
-Arguments:
- Settings - The settings
- Option - the option
-
-Returns:
-
-**/
{
UINTN Temp;
@@ -2493,13 +2501,17 @@ Returns:
break;
}
}
-//
-// Out-of-Band Remote Access (Type 30)
-//
+
+/**
+ Display Out-of-Band Remote Access (Type 30) information.
+
+ @param[in] Connections The device characteristics.
+ @param[in] Option The device options.
+**/
VOID
DisplayOBRAConnections (
- UINT8 Connections,
- UINT8 Option
+ IN UINT8 Connections,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_CONNECTIONS), gShellDebug1HiiHandle);
@@ -2528,13 +2540,17 @@ DisplayOBRAConnections (
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_PRINTINFO_INBOUND_CONN_DISABLED), gShellDebug1HiiHandle);
}
}
-//
-// System Power Supply (Type 39)
-//
+
+/**
+ Display System Power Supply (Type 39) information.
+
+ @param[in] Characteristics The device characteristics.
+ @param[in] Option The device options.
+**/
VOID
DisplaySPSCharacteristics (
- UINT16 Characteristics,
- UINT8 Option
+ IN UINT16 Characteristics,
+ IN UINT8 Option
)
{
UINTN Temp;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
index a6c8ef6ba8..d9bf3b687d 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.h
@@ -1,7 +1,7 @@
/** @file
Module to clarify the element info of the smbios structure.
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -12,8 +12,8 @@
**/
-#ifndef _SMBIOS_PRINT_INFO_H
-#define _SMBIOS_PRINT_INFO_H
+#ifndef _SMBIOS_PRINT_INFO_H_
+#define _SMBIOS_PRINT_INFO_H_
#include "LibSmbios.h"
@@ -34,159 +34,344 @@ extern UINT8 SmbiosMinorVersion;
#define AS_UINT32(pData) (*((UINT32 *) pData))
#define AS_UINT64(pData) (*((UINT64 *) pData))
+/**
+ Print the info of EPS(Entry Point Structure).
+
+ @param[in] SmbiosTable Pointer to the SMBIOS table entry point.
+ @param[in] Option Display option.
+**/
VOID
SmbiosPrintEPSInfo (
- IN SMBIOS_STRUCTURE_TABLE *pSmbiosTable,
+ IN SMBIOS_STRUCTURE_TABLE *SmbiosTable,
IN UINT8 Option
);
+/**
+ This function print the content of the structure pointed by Struct.
+
+ @param[in] Struct Point to the structure to be printed.
+ @param[in] Option Print option of information detail.
+
+ @retval EFI_SUCCESS Successfully Printing this function.
+ @retval EFI_INVALID_PARAMETER Invalid Structure.
+ @retval EFI_UNSUPPORTED Unsupported.
+**/
EFI_STATUS
SmbiosPrintStructure (
- IN SMBIOS_STRUCTURE_POINTER *pStruct,
+ IN SMBIOS_STRUCTURE_POINTER *Struct,
IN UINT8 Option
);
-//
-// BIOS Information (Type 0)
-//
+/**
+ Display BIOS Information (Type 0) information.
+
+ @param[in] Chara The information bits.
+ @param[in] Option The optional information.
+**/
VOID
DisplayBiosCharacteristics (
- UINT64 chara,
- UINT8 Option
+ IN UINT64 Chara,
+ IN UINT8 Option
);
+
+/**
+ Display Bios Characteristice extensions1 information.
+
+ @param[in] Byte1 The information.
+ @param[in] Option The optional information.
+**/
VOID
DisplayBiosCharacteristicsExt1 (
- UINT8 byte1,
- UINT8 Option
+ IN UINT8 Byte1,
+ IN UINT8 Option
);
+
+/**
+ Display Bios Characteristice extensions2 information.
+
+ @param[in] Byte2 The information.
+ @param[in] Option The optional information.
+**/
VOID
DisplayBiosCharacteristicsExt2 (
- UINT8 byte2,
- UINT8 Option
+ IN UINT8 Byte2,
+ IN UINT8 Option
);
-//
-// Processor Information (Type 4)
-//
+/**
+ Display Processor Information (Type 4) information.
+
+ @param[in] Family The family value.
+ @param[in] Option The option value.
+**/
VOID
DisplayProcessorFamily (
UINT8 Family,
UINT8 Option
);
+/**
+ Display processor family information.
+
+ @param[in] Family2 The family value.
+ @param[in] Option The option value.
+**/
VOID
DisplayProcessorFamily2 (
- UINT16 Family2,
- UINT8 Option
+ IN UINT16 Family2,
+ IN UINT8 Option
);
+/**
+ Display processor voltage information.
+
+ @param[in] Voltage The Voltage.
+ Bit 7 Set to 0, indicating 'legacy' mode for processor voltage
+ Bits 6:4 Reserved, must be zero
+ Bits 3:0 Voltage Capability.
+ A Set bit indicates that the voltage is supported.
+ Bit 0 - 5V
+ Bit 1 - 3.3V
+ Bit 2 - 2.9V
+ Bit 3 - Reserved, must be zero.
+
+ Note:
+ Setting of multiple bits indicates the socket is configurable
+ If bit 7 is set to 1, the remaining seven bits of the field are set to
+ contain the processor's current voltage times 10.
+ For example, the field value for a processor voltage of 1.8 volts would be
+ 92h = 80h + (1.8 * 10) = 80h + 18 = 80h +12h.
+
+ @param[in] Option The option.
+**/
VOID
DisplayProcessorVoltage (
- UINT8 Voltage,
- UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
);
+
+/**
+ Display processor information.
+
+ @param[in] Status The status.
+ Bit 7 Reserved, must be 0
+ Bit 6 CPU Socket Populated
+ 1 - CPU Socket Populated
+ 0 - CPU Socket UnpopulatedBits
+ 5:3 Reserved, must be zero
+ Bits 2:0 CPU Status
+ 0h - Unknown
+ 1h - CPU Enabled
+ 2h - CPU Disabled by User via BIOS Setup
+ 3h - CPU Disabled By BIOS (POST Error)
+ 4h - CPU is Idle, waiting to be enabled.
+ 5-6h - Reserved
+ 7h - Other
+
+ @param[in] Option The option
+**/
VOID
DisplayProcessorStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
);
-//
-// Memory Controller Information (Type 5)
-//
+/**
+ Display information about Memory Controller Information (Type 5).
+
+ @param[in] Size Memory size.
+ @param[in] SlotNum Which slot is this about.
+ @param[in] Option Option for the level of detail output required.
+**/
VOID
DisplayMaxMemoryModuleSize (
- UINT8 Size,
- UINT8 SlotNum,
- UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
);
+
+/**
+ Display information about memory configuration handles.
+
+ @param[in] Handles The buffer of handles to output info on.
+ @param[in] SlotNum The number of handles in the above buffer.
+ @param[in] Option Option for the level of detail output required.
+**/
VOID
DisplayMemoryModuleConfigHandles (
- UINT16 *pHandles,
- UINT8 SlotNum,
- UINT8 Option
+ IN UINT16 *Handles,
+ IN UINT8 SlotNum,
+ IN UINT8 Option
);
-//
-// Memory Module Information (Type 6)
-//
+/**
+ Display Memory Module Information (Type 6).
+
+ @param[in] BankConnections
+ @param[in] Option
+**/
VOID
DisplayMmBankConnections (
- UINT8 BankConnections,
- UINT8 Option
+ IN UINT8 BankConnections,
+ IN UINT8 Option
);
+
+/**
+ Display memory informcation.
+
+ Bits 0:6 Size (n),
+ where 2**n is the size in MB with three special-case values:
+ 7Dh Not determinable (Installed Size only)
+ 7Eh Module is installed, but no memory has been enabled
+ 7Fh Not installed
+ Bit 7 Defines whether the memory module has a single- (0)
+ or double-bank (1) connection.
+
+ @param[in] Size - The size
+ @param[in] Option - The option
+**/
VOID
DisplayMmMemorySize (
- UINT8 Size,
- UINT8 Option
+ IN UINT8 Size,
+ IN UINT8 Option
);
-//
-// System Slots (Type 9)
-//
+/**
+ The Slot ID field of the System Slot structure provides a mechanism to
+ correlate the physical attributes of the slot to its logical access method
+ (which varies based on the Slot Type field).
+
+ @param[in] SlotId - The slot ID
+ @param[in] SlotType - The slot type
+ @param[in] Option - The Option
+**/
VOID
DisplaySystemSlotId (
- UINT16 SlotId,
- UINT8 SlotType,
- UINT8 Option
+ IN UINT16 SlotId,
+ IN UINT8 SlotType,
+ IN UINT8 Option
);
-//
-// Physical Memory Array (Type 16)
-// Memory Device (Type 17)
-// Memory Array Mapped Address (Type 19)
-// Memory Device Mapped Address (Type 20)
-// Portable Battery (Type 22)
-//
+/**
+ Display Portable Battery (Type 22) information.
+
+ The date the cell pack was manufactured, in packed format:
+ Bits 15:9 Year, biased by 1980, in the range 0 to 127.
+ Bits 8:5 Month, in the range 1 to 12.
+ Bits 4:0 Date, in the range 1 to 31.
+ For example, 01 February 2000 would be identified as
+ 0010 1000 0100 0001b (0x2841).
+
+ @param[in] Date The date
+ @param[in] Option The option
+**/
VOID
DisplaySBDSManufactureDate (
- UINT16 Date,
- UINT8 Option
+ IN UINT16 Date,
+ IN UINT8 Option
);
-//
-// System Reset (Type 23)
-//
+/**
+ Display System Reset (Type 23) information.
+
+ Routine Description:
+ Identifies the system-reset capabilities for the system.
+ Bits 7:6 Reserved for future assignment via this specification, set to 00b.
+ Bit 5 System contains a watchdog timer, either True (1) or False (0).
+ Bits 4:3 Boot Option on Limit.
+ Identifies the system action to be taken when the Reset Limit is reached, one of:
+ 00b Reserved, do not use.
+ 01b Operating system
+ 10b System utilities
+ 11b Do not rebootBits
+ 2:1 Boot Option. Indicates the action to be taken following a watchdog reset, one of:
+ 00b Reserved, do not use.
+ 01b Operating system
+ 10b System utilities
+ 11b Do not reboot
+ Bit 0 Status.
+ 1b The system reset is enabled by the user
+ 0b The system reset is not enabled by the user
+
+ @param[in] Reset Reset
+ @param[in] Option The option
+**/
VOID
DisplaySystemResetCapabilities (
- UINT8 Reset,
- UINT8 Option
+ IN UINT8 Reset,
+ IN UINT8 Option
);
-//
-// Hardware Security (Type 24)
-//
+/**
+ Display Hardware Security (Type 24) information.
+
+ Routine Description:
+ Identifies the password and reset status for the system:
+
+ Bits 7:6 Power-on Password Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+ Bits 5:4 Keyboard Password Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+ Bits 3:2 Administrator Password Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+ Bits 1:0 Front Panel Reset Status, one of:
+ 00b Disabled
+ 01b Enabled
+ 10b Not Implemented
+ 11b Unknown
+
+ @param[in] Settings The device settings.
+ @param[in] Option The device options.
+**/
VOID
DisplayHardwareSecuritySettings (
- UINT8 Settings,
- UINT8 Option
+ IN UINT8 Settings,
+ IN UINT8 Option
);
-//
-// Out-of-Band Remote Access (Type 30)
-//
+/**
+ Display Out-of-Band Remote Access (Type 30) information.
+
+ @param[in] Connections The device characteristics.
+ @param[in] Option The device options.
+**/
VOID
DisplayOBRAConnections (
- UINT8 Connections,
- UINT8 Option
+ IN UINT8 Connections,
+ IN UINT8 Option
);
-//
-// System Boot Information (Type 32)
-//
+/**
+ Display System Boot Information (Type 32) information.
+
+ @param[in] Parameter The parameter.
+ @param[in] Option The options.
+**/
VOID
DisplaySystemBootStatus (
- UINT8 Parameter,
- UINT8 Option
+ IN UINT8 Parameter,
+ IN UINT8 Option
);
-//
-// System Power Supply (Type 39)
-//
+/**
+ Display System Power Supply (Type 39) information.
+
+ @param[in] Characteristics The device characteristics.
+ @param[in] Option The device options.
+**/
VOID
DisplaySPSCharacteristics (
- UINT16 Characteristics,
- UINT8 Option
+ IN UINT16 Characteristics,
+ IN UINT8 Option
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
index f3e3f5f37b..d84ab10c29 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.c
@@ -2986,27 +2986,19 @@ QueryTable (
return QUERY_TABLE_UNFOUND;
}
+/**
+ Given a table of bit info and a Key, return the responding info to the Key.
+
+ @param[in] Table Point to a table which maintains a map of 'bit' to 'message'.
+ @param[in] Number Number of table items.
+ @param[in] Bits The Key of query the bit map information.
+**/
VOID
PrintBitsInfo (
IN TABLE_ITEM *Table,
IN UINTN Number,
IN UINT32 Bits
)
-/*++
-
- Routine Description:
- Given a table of bit info and a Key,
- return the responding info to the Key.
-
- Arguments:
- Table - Point to a table which maintains a map of 'bit' to 'message'
- Number - Number of table items.
- Bits - The Key of query the bit map information.
-
- Returns:
- None
-
-**/
{
//
// Get certain bit of 'Value':
@@ -3077,28 +3069,33 @@ PrintBitsInfo (
PrintBitsInfo (Table, Num, (UINT32) bits); \
} while (0);
-//
-////////////////////////////////////////////////////////////////////
-//
-// System Information (Type 1)
-//
+/**
+ Display System Information (Type 1) Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemWakeupType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_WAKEUP_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (SystemWakeupTypeTable, Type);
}
-//
-// System Enclosure (Type 3)
-//
+
+/**
+ Display System Enclosure (Type 3) Enclosure Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemEnclosureType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_TYPE), gShellDebug1HiiHandle);
@@ -3113,10 +3110,16 @@ DisplaySystemEnclosureType (
}
}
+/**
+ Display System Enclosure (Type 3) Enclosure Status.
+
+ @param[in] Status The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemEnclosureStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_STATUS), gShellDebug1HiiHandle);
@@ -3124,23 +3127,33 @@ DisplaySystemEnclosureStatus (
PRINT_TABLE_ITEM (SystemEnclosureStatusTable, Status);
}
+/**
+ Display System Enclosure (Type 3) Security Status.
+
+ @param[in] Status The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySESecurityStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_CHASSIS_SECURITY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (SESecurityStatusTable, Status);
}
-//
-// Processor Information (Type 4)
-//
+
+/**
+ Display Processor Information (Type 4) Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayProcessorType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_TYPE), gShellDebug1HiiHandle);
@@ -3148,23 +3161,33 @@ DisplayProcessorType (
PRINT_TABLE_ITEM (ProcessorTypeTable, Type);
}
+/**
+ Display Processor Information (Type 4) Upgrade.
+
+ @param[in] Upgrade The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayProcessorUpgrade (
- UINT8 Upgrade,
- UINT8 Option
+ IN UINT8 Upgrade,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PROC_UPDATE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Upgrade, Option);
PRINT_TABLE_ITEM (ProcessorUpgradeTable, Upgrade);
}
-//
-// Memory Controller Information (Type 5)
-//
+
+/**
+ Display Memory Controller Information (Type 5) method.
+
+ @param[in] Method The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcErrorDetectMethod (
- UINT8 Method,
- UINT8 Option
+ IN UINT8 Method,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DETECTMETHOD), gShellDebug1HiiHandle);
@@ -3172,10 +3195,16 @@ DisplayMcErrorDetectMethod (
PRINT_TABLE_ITEM (McErrorDetectMethodTable, Method);
}
+/**
+ Display Memory Controller Information (Type 5) Capability.
+
+ @param[in] Capability The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcErrorCorrectCapability (
- UINT8 Capability,
- UINT8 Option
+ IN UINT8 Capability,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CORRECT_CAPABILITY), gShellDebug1HiiHandle);
@@ -3183,10 +3212,16 @@ DisplayMcErrorCorrectCapability (
PRINT_BITS_INFO (McErrorCorrectCapabilityTable, Capability);
}
+/**
+ Display Memory Controller Information (Type 5) Support.
+
+ @param[in] Support The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcInterleaveSupport (
- UINT8 Support,
- UINT8 Option
+ IN UINT8 Support,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_INTERLEAVE_SUPPORT), gShellDebug1HiiHandle);
@@ -3194,10 +3229,16 @@ DisplayMcInterleaveSupport (
PRINT_TABLE_ITEM (McInterleaveSupportTable, Support);
}
+/**
+ Display Memory Controller Information (Type 5) speeds.
+
+ @param[in] Speed The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcMemorySpeeds (
- UINT16 Speed,
- UINT8 Option
+ IN UINT16 Speed,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MEMORY_SPEED), gShellDebug1HiiHandle);
@@ -3205,23 +3246,33 @@ DisplayMcMemorySpeeds (
PRINT_BITS_INFO (McMemorySpeedsTable, Speed);
}
+/**
+ Display Memory Controller Information (Type 5) voltage.
+
+ @param[in] Voltage The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryModuleVoltage (
- UINT8 Voltage,
- UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_REQUIRED_VOLTAGES), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Voltage, Option);
PRINT_BITS_INFO (MemoryModuleVoltageTable, Voltage);
}
-//
-// Memory Module Information (Type 6)
-//
+
+/**
+ Display Memory Module Information (Type 6) type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMmMemoryType (
- UINT16 Type,
- UINT8 Option
+ IN UINT16 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_TYPE), gShellDebug1HiiHandle);
@@ -3229,23 +3280,33 @@ DisplayMmMemoryType (
PRINT_BITS_INFO (MmMemoryTypeTable, Type);
}
+/**
+ Display Memory Module Information (Type 6) status.
+
+ @param[in] Status The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMmErrorStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_MODULE_ERROR_STATUS), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Status, Option);
PRINT_BITS_INFO (MmErrorStatusTable, Status);
}
-//
-// Cache Information (Type 7)
-//
+
+/**
+ Display Cache Information (Type 7) SRAM Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheSRAMType (
- UINT16 Type,
- UINT8 Option
+ IN UINT16 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SRAM_TYPE), gShellDebug1HiiHandle);
@@ -3253,10 +3314,16 @@ DisplayCacheSRAMType (
PRINT_BITS_INFO (CacheSRAMTypeTable, (UINT8) Type);
}
+/**
+ Display Cache Information (Type 7) correcting Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheErrCorrectingType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ERROR_CORRECTING), gShellDebug1HiiHandle);
@@ -3264,10 +3331,16 @@ DisplayCacheErrCorrectingType (
PRINT_TABLE_ITEM (CacheErrCorrectingTypeTable, Type);
}
+/**
+ Display Cache Information (Type 7) Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheSystemCacheType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_SYSTEM_TYPE), gShellDebug1HiiHandle);
@@ -3275,23 +3348,33 @@ DisplayCacheSystemCacheType (
PRINT_TABLE_ITEM (CacheSystemCacheTypeTable, Type);
}
+/**
+ Display Cache Information (Type 7) Associativity.
+
+ @param[in] Associativity The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheAssociativity (
- UINT8 Associativity,
- UINT8 Option
+ IN UINT8 Associativity,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_CACHE_ASSOCIATIVITY), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Associativity, Option);
PRINT_TABLE_ITEM (CacheAssociativityTable, Associativity);
}
-//
-// Port Connector Information (Type 8)
-//
+
+/**
+ Display Port Connector Information (Type 8) type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPortConnectorType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_CONNECTOR_TYPE), gShellDebug1HiiHandle);
@@ -3299,23 +3382,33 @@ DisplayPortConnectorType (
PRINT_TABLE_ITEM (PortConnectorTypeTable, Type);
}
+/**
+ Display Port Connector Information (Type 8) port type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPortType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORT_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (PortTypeTable, Type);
}
-//
-// System Slots (Type 9)
-//
+
+/**
+ Display System Slots (Type 9) slot type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_TYPE), gShellDebug1HiiHandle);
@@ -3323,10 +3416,16 @@ DisplaySystemSlotType (
PRINT_TABLE_ITEM (SystemSlotTypeTable, Type);
}
+/**
+ Display System Slots (Type 9) data bus width.
+
+ @param[in] Width The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotDataBusWidth (
- UINT8 Width,
- UINT8 Option
+ IN UINT8 Width,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_DATA), gShellDebug1HiiHandle);
@@ -3334,10 +3433,16 @@ DisplaySystemSlotDataBusWidth (
PRINT_TABLE_ITEM (SystemSlotDataBusWidthTable, Width);
}
+/**
+ Display System Slots (Type 9) usage information.
+
+ @param[in] Usage The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotCurrentUsage (
- UINT8 Usage,
- UINT8 Option
+ IN UINT8 Usage,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_CURRENT_USAGE), gShellDebug1HiiHandle);
@@ -3345,10 +3450,16 @@ DisplaySystemSlotCurrentUsage (
PRINT_TABLE_ITEM (SystemSlotCurrentUsageTable, Usage);
}
+/**
+ Display System Slots (Type 9) slot length.
+
+ @param[in] Length The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotLength (
- UINT8 Length,
- UINT8 Option
+ IN UINT8 Length,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_SLOT_LENGTH), gShellDebug1HiiHandle);
@@ -3356,10 +3467,16 @@ DisplaySystemSlotLength (
PRINT_TABLE_ITEM (SystemSlotLengthTable, Length);
}
+/**
+ Display System Slots (Type 9) characteristics.
+
+ @param[in] Chara1 The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySlotCharacteristics1 (
- UINT8 Chara1,
- UINT8 Option
+ IN UINT8 Chara1,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS), gShellDebug1HiiHandle);
@@ -3367,36 +3484,50 @@ DisplaySlotCharacteristics1 (
PRINT_BITS_INFO (SlotCharacteristics1Table, Chara1);
}
+/**
+ Display System Slots (Type 9) characteristics.
+
+ @param[in] Chara2 The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySlotCharacteristics2 (
- UINT8 Chara2,
- UINT8 Option
+ IN UINT8 Chara2,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SLOT_CHARACTERISTICS_2), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Chara2, Option);
PRINT_BITS_INFO (SlotCharacteristics2Table, Chara2);
}
-//
-// On Board Devices Information (Type 10)
-//
+
+/**
+ Display On Board Devices Information (Type 10) types.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayOnboardDeviceTypes (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_ONBOARD_DEVICE_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (OnboardDeviceTypesTable, Type);
}
-//
-// System Event Log (Type 15)
-//
+
+/**
+ Display System Event Log (Type 15) types.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySELTypes (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_SYSTEM_EVENT_LOG_TYPE), gShellDebug1HiiHandle);
@@ -3404,10 +3535,16 @@ DisplaySELTypes (
PRINT_TABLE_ITEM (SELTypesTable, Type);
}
+/**
+ Display System Event Log (Type 15) format type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySELVarDataFormatType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_EVENT_LOG_VAR_DATA_FORMAT), gShellDebug1HiiHandle);
@@ -3415,10 +3552,16 @@ DisplaySELVarDataFormatType (
PRINT_TABLE_ITEM (SELVarDataFormatTypeTable, Type);
}
+/**
+ Display System Event Log (Type 15) dw1.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPostResultsBitmapDw1 (
- UINT32 Key,
- UINT8 Option
+ IN UINT32 Key,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_BITMAP), gShellDebug1HiiHandle);
@@ -3426,10 +3569,16 @@ DisplayPostResultsBitmapDw1 (
PRINT_BITS_INFO (PostResultsBitmapDw1Table, Key);
}
+/**
+ Display System Event Log (Type 15) dw2.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPostResultsBitmapDw2 (
- UINT32 Key,
- UINT8 Option
+ IN UINT32 Key,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POST_RESULTS_SECOND_DWORD), gShellDebug1HiiHandle);
@@ -3437,10 +3586,16 @@ DisplayPostResultsBitmapDw2 (
PRINT_BITS_INFO (PostResultsBitmapDw2Table, Key);
}
+/**
+ Display System Event Log (Type 15) type.
+
+ @param[in] SMType The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySELSysManagementTypes (
- UINT32 SMType,
- UINT8 Option
+ IN UINT32 SMType,
+ IN UINT8 Option
)
{
UINT8 Temp;
@@ -3467,13 +3622,17 @@ DisplaySELSysManagementTypes (
PRINT_TABLE_ITEM (SELSysManagementTypesTable, Temp);
}
}
-//
-// Physical Memory Array (Type 16)
-//
+
+/**
+ Display Physical Memory Array (Type 16) Location.
+
+ @param[in] Location The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPMALocation (
- UINT8 Location,
- UINT8 Option
+ IN UINT8 Location,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_LOCATION), gShellDebug1HiiHandle);
@@ -3481,10 +3640,16 @@ DisplayPMALocation (
PRINT_TABLE_ITEM (PMALocationTable, Location);
}
+/**
+ Display Physical Memory Array (Type 16) Use.
+
+ @param[in] Use The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPMAUse (
- UINT8 Use,
- UINT8 Option
+ IN UINT8 Use,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_LOCATION), gShellDebug1HiiHandle);
@@ -3492,23 +3657,33 @@ DisplayPMAUse (
PRINT_TABLE_ITEM (PMAUseTable, Use);
}
+/**
+ Display Physical Memory Array (Type 16) Types.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPMAErrorCorrectionTypes (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PHYS_MEM_ARRAY_ERROR), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (PMAErrorCorrectionTypesTable, Type);
}
-//
-// Memory Device (Type 17)
-//
+
+/**
+ Display Memory Device (Type 17) form factor.
+
+ @param[in] FormFactor The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryDeviceFormFactor (
- UINT8 FormFactor,
- UINT8 Option
+ IN UINT8 FormFactor,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_FORM_FACTOR), gShellDebug1HiiHandle);
@@ -3516,10 +3691,16 @@ DisplayMemoryDeviceFormFactor (
PRINT_TABLE_ITEM (MemoryDeviceFormFactorTable, FormFactor);
}
+/**
+ Display Memory Device (Type 17) type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryDeviceType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE), gShellDebug1HiiHandle);
@@ -3527,23 +3708,33 @@ DisplayMemoryDeviceType (
PRINT_TABLE_ITEM (MemoryDeviceTypeTable, Type);
}
+/**
+ Display Memory Device (Type 17) details.
+
+ @param[in] Para The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryDeviceTypeDetail (
- UINT16 para,
- UINT8 Option
+ IN UINT16 Para,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_DEVICE_TYPE_DETAIL), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (para, Option);
- PRINT_BITS_INFO (MemoryDeviceTypeDetailTable, para);
+ PRINT_INFO_OPTION (Para, Option);
+ PRINT_BITS_INFO (MemoryDeviceTypeDetailTable, Para);
}
-//
-// 32-bit Memory Error Information (Type 18)
-//
+
+/**
+ Display 32-bit Memory Error Information (Type 18) type.
+
+ @param[in] ErrorType The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryErrorType (
- UINT8 ErrorType,
- UINT8 Option
+ IN UINT8 ErrorType,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_INFO), gShellDebug1HiiHandle);
@@ -3551,10 +3742,16 @@ DisplayMemoryErrorType (
PRINT_TABLE_ITEM (MemoryErrorTypeTable, ErrorType);
}
+/**
+ Display 32-bit Memory Error Information (Type 18) error granularity.
+
+ @param[in] Granularity The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryErrorGranularity (
- UINT8 Granularity,
- UINT8 Option
+ IN UINT8 Granularity,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_GRANULARITY), gShellDebug1HiiHandle);
@@ -3562,23 +3759,33 @@ DisplayMemoryErrorGranularity (
PRINT_TABLE_ITEM (MemoryErrorGranularityTable, Granularity);
}
+/**
+ Display 32-bit Memory Error Information (Type 18) error information.
+
+ @param[in] Operation The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryErrorOperation (
- UINT8 Operation,
- UINT8 Option
+ IN UINT8 Operation,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_ERROR_OP), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Operation, Option);
PRINT_TABLE_ITEM (MemoryErrorOperationTable, Operation);
}
-//
-// Built-in Pointing Device (Type 21)
-//
+
+/**
+ Display Built-in Pointing Device (Type 21) type information.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPointingDeviceType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_TYPE), gShellDebug1HiiHandle);
@@ -3586,36 +3793,50 @@ DisplayPointingDeviceType (
PRINT_TABLE_ITEM (PointingDeviceTypeTable, Type);
}
+/**
+ Display Built-in Pointing Device (Type 21) information.
+
+ @param[in] Interface The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPointingDeviceInterface (
- UINT8 Interface,
- UINT8 Option
+ IN UINT8 Interface,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_POINTING_DEVICE_INTERFACE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Interface, Option);
PRINT_TABLE_ITEM (PointingDeviceInterfaceTable, Interface);
}
-//
-// Portable Battery (Type 22)
-//
+
+/**
+ Display Portable Battery (Type 22) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPBDeviceChemistry (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_PORTABLE_BATT_DEV_CHEM), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (PBDeviceChemistryTable, Key);
}
-//
-// Voltage Probe (Type 26)
-//
+
+/**
+ Display Voltage Probe (Type 26) location information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayVPLocation (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Loc;
@@ -3626,10 +3847,16 @@ DisplayVPLocation (
PRINT_TABLE_ITEM (VPLocationTable, Loc);
}
+/**
+ Display Voltage Probe (Type 26) status ype information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayVPStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Status;
@@ -3639,13 +3866,17 @@ DisplayVPStatus (
PRINT_INFO_OPTION (Status, Option);
PRINT_TABLE_ITEM (VPStatusTable, Status);
}
-//
-// Voltage Probe (Type 27)
-//
+
+/**
+ Display Cooling (Type 27) status information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCoolingDeviceStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Status;
@@ -3656,10 +3887,16 @@ DisplayCoolingDeviceStatus (
PRINT_TABLE_ITEM (CoolingDeviceStatusTable, Status);
}
+/**
+ Display Cooling (Type 27) type information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCoolingDeviceType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Type;
@@ -3669,13 +3906,17 @@ DisplayCoolingDeviceType (
PRINT_INFO_OPTION (Type, Option);
PRINT_TABLE_ITEM (CoolingDeviceTypeTable, Type);
}
-//
-// Temperature Probe (Type 28)
-//
+
+/**
+ Display Temperature Probe (Type 28) status information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayTemperatureProbeStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Status;
@@ -3686,10 +3927,16 @@ DisplayTemperatureProbeStatus (
PRINT_TABLE_ITEM (TemperatureProbeStatusTable, Status);
}
+/**
+ Display Temperature Probe (Type 28) location information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayTemperatureProbeLoc (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Loc;
@@ -3699,13 +3946,17 @@ DisplayTemperatureProbeLoc (
PRINT_INFO_OPTION (Loc, Option);
PRINT_TABLE_ITEM (TemperatureProbeLocTable, Loc);
}
-//
-// Electrical Current Probe (Type 29)
-//
+
+/**
+ Display Electrical Current Probe (Type 29) status information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayECPStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Status;
@@ -3716,10 +3967,16 @@ DisplayECPStatus (
PRINT_TABLE_ITEM (ECPStatusTable, Status);
}
+/**
+ Display Type 29 information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayECPLoc (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
UINT8 Loc;
@@ -3729,13 +3986,17 @@ DisplayECPLoc (
PRINT_INFO_OPTION (Loc, Option);
PRINT_TABLE_ITEM (ECPLocTable, Loc);
}
-//
-// Management Device (Type 34)
-//
+
+/**
+ Display Management Device (Type 34) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMDType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_TYPE), gShellDebug1HiiHandle);
@@ -3743,36 +4004,33 @@ DisplayMDType (
PRINT_TABLE_ITEM (MDTypeTable, Key);
}
-VOID
-DisplayMDAddressType (
- UINT8 Key,
- UINT8 Option
- )
-{
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MANAGEMENT_DEV_ADDR_TYPE), gShellDebug1HiiHandle);
- PRINT_INFO_OPTION (Key, Option);
- PRINT_TABLE_ITEM (MDAddressTypeTable, Key);
-}
-//
-// Memory Channel (Type 37)
-//
+/**
+ Display Memory Channel (Type 37) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryChannelType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_MEM_CHANNEL_TYPE), gShellDebug1HiiHandle);
PRINT_INFO_OPTION (Key, Option);
PRINT_TABLE_ITEM (MemoryChannelTypeTable, Key);
}
-//
-// IPMI Device Information (Type 38)
-//
+
+/**
+ Display IPMI Device Information (Type 38) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayIPMIDIBMCInterfaceType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_QUERYTABLE_BMC_INTERFACE_TYPE), gShellDebug1HiiHandle);
@@ -3780,10 +4038,16 @@ DisplayIPMIDIBMCInterfaceType (
PRINT_TABLE_ITEM (IPMIDIBMCInterfaceTypeTable, Key);
}
+/**
+ Display the structure type information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayStructureTypeInfo (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
)
{
//
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
index 1022132f10..6809820232 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/QueryTable.h
@@ -13,8 +13,8 @@
**/
-#ifndef _SMBIOS_QUERY_TABLE_H
-#define _SMBIOS_QUERY_TABLE_H
+#ifndef _SMBIOS_QUERY_TABLE_H_
+#define _SMBIOS_QUERY_TABLE_H_
#define QUERY_TABLE_UNFOUND 0xFF
@@ -70,386 +70,665 @@ QueryTable (
IN UINTN InfoLen
);
-VOID
-PrintBitsInfo (
- IN TABLE_ITEM *Table,
- IN UINTN Number,
- IN UINT32 Bits
- );
+/**
+ Display the structure type information.
-//
-// Display the element detail information
-//
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayStructureTypeInfo (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// System Information (Type 1)
-//
+/**
+ Display System Information (Type 1) Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemWakeupType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
-//
-// System Enclosure (Type 3)
-//
+/**
+ Display System Enclosure (Type 3) Enclosure Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemEnclosureType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display System Enclosure (Type 3) Enclosure Status.
+
+ @param[in] Status The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemEnclosureStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
);
+
+/**
+ Display System Enclosure (Type 3) Security Status.
+
+ @param[in] Status The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySESecurityStatus (
- UINT8 Status,
- UINT8 Option
- );
+ IN UINT8 Status,
+ IN UINT8 Option
+ )
+;
-//
-// Processor Information (Type 4)
-//
+/**
+ Display Processor Information (Type 4) Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayProcessorType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Processor Information (Type 4) Upgrade.
+
+ @param[in] Upgrade The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayProcessorUpgrade (
- UINT8 Upgrade,
- UINT8 Option
+ IN UINT8 Upgrade,
+ IN UINT8 Option
);
-//
-// Memory Controller Information (Type 5)
-//
+/**
+ Display Memory Controller Information (Type 5) method.
+
+ @param[in] Method The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcErrorDetectMethod (
- UINT8 Method,
- UINT8 Option
+ IN UINT8 Method,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Controller Information (Type 5) Capability.
+
+ @param[in] Capability The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcErrorCorrectCapability (
- UINT8 Capability,
- UINT8 Option
+ IN UINT8 Capability,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Controller Information (Type 5) Support.
+
+ @param[in] Support The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcInterleaveSupport (
- UINT8 Support,
- UINT8 Option
+ IN UINT8 Support,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Controller Information (Type 5) speeds.
+
+ @param[in] Speed The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMcMemorySpeeds (
- UINT16 Speed,
- UINT8 Option
+ IN UINT16 Speed,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Controller Information (Type 5) voltage.
+
+ @param[in] Voltage The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryModuleVoltage (
- UINT8 Voltage,
- UINT8 Option
+ IN UINT8 Voltage,
+ IN UINT8 Option
);
-//
-// Memory Module Information (Type 6)
-//
+/**
+ Display Memory Module Information (Type 6) type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMmMemoryType (
- UINT16 Type,
- UINT8 Option
+ IN UINT16 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Module Information (Type 6) status.
+
+ @param[in] Status The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMmErrorStatus (
- UINT8 Status,
- UINT8 Option
+ IN UINT8 Status,
+ IN UINT8 Option
);
-//
-// Cache Information (Type 7)
-//
+/**
+ Display Cache Information (Type 7) SRAM Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheSRAMType (
- UINT16 Type,
- UINT8 Option
+ IN UINT16 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Cache Information (Type 7) correcting Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheErrCorrectingType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Cache Information (Type 7) Type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheSystemCacheType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Cache Information (Type 7) Associativity.
+
+ @param[in] Associativity The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCacheAssociativity (
- UINT8 Associativity,
- UINT8 Option
+ IN UINT8 Associativity,
+ IN UINT8 Option
);
-//
-// Port Connector Information (Type 8)
-//
+/**
+ Display Port Connector Information (Type 8) type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPortConnectorType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Port Connector Information (Type 8) port type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPortType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
-//
-// System Slots (Type 9)
-//
+/**
+ Display System Slots (Type 9) slot type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display System Slots (Type 9) data bus width.
+
+ @param[in] Width The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotDataBusWidth (
- UINT8 Width,
- UINT8 Option
+ IN UINT8 Width,
+ IN UINT8 Option
);
+
+/**
+ Display System Slots (Type 9) usage information.
+
+ @param[in] Usage The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotCurrentUsage (
- UINT8 Usage,
- UINT8 Option
+ IN UINT8 Usage,
+ IN UINT8 Option
);
+
+/**
+ Display System Slots (Type 9) slot length.
+
+ @param[in] Length The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySystemSlotLength (
- UINT8 Length,
- UINT8 Option
+ IN UINT8 Length,
+ IN UINT8 Option
);
+
+/**
+ Display System Slots (Type 9) characteristics.
+
+ @param[in] Chara1 The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySlotCharacteristics1 (
- UINT8 Chara1,
- UINT8 Option
+ IN UINT8 Chara1,
+ IN UINT8 Option
);
+
+/**
+ Display System Slots (Type 9) characteristics.
+
+ @param[in] Chara2 The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySlotCharacteristics2 (
- UINT8 Chara2,
- UINT8 Option
+ IN UINT8 Chara2,
+ IN UINT8 Option
);
-//
-// On Board Devices Information (Type 10)
-//
+/**
+ Display On Board Devices Information (Type 10) types.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayOnboardDeviceTypes (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
-//
-// System Event Log (Type 15)
-//
+/**
+ Display System Event Log (Type 15) types.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySELTypes (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display System Event Log (Type 15) format type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySELVarDataFormatType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display System Event Log (Type 15) dw1.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPostResultsBitmapDw1 (
- UINT32 Key,
- UINT8 Option
+ IN UINT32 Key,
+ IN UINT8 Option
);
+
+/**
+ Display System Event Log (Type 15) dw2.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPostResultsBitmapDw2 (
- UINT32 Key,
- UINT8 Option
+ IN UINT32 Key,
+ IN UINT8 Option
);
+
+/**
+ Display System Event Log (Type 15) type.
+
+ @param[in] SMType The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplaySELSysManagementTypes (
- UINT32 SMType,
- UINT8 Option
+ IN UINT32 SMType,
+ IN UINT8 Option
);
-//
-// Physical Memory Array (Type 16)
-//
+/**
+ Display Physical Memory Array (Type 16) Location.
+
+ @param[in] Location The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPMALocation (
- UINT8 Location,
- UINT8 Option
+ IN UINT8 Location,
+ IN UINT8 Option
);
+
+/**
+ Display Physical Memory Array (Type 16) Use.
+
+ @param[in] Use The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPMAUse (
- UINT8 Use,
- UINT8 Option
+ IN UINT8 Use,
+ IN UINT8 Option
);
+
+/**
+ Display Physical Memory Array (Type 16) Types.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPMAErrorCorrectionTypes (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
-//
-// Memory Device (Type 17)
-//
+/**
+ Display Memory Device (Type 17) form factor.
+
+ @param[in] FormFactor The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryDeviceFormFactor (
- UINT8 FormFactor,
- UINT8 Option
+ IN UINT8 FormFactor,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Device (Type 17) type.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryDeviceType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Memory Device (Type 17) details.
+
+ @param[in] Para The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryDeviceTypeDetail (
- UINT16 Parameter,
- UINT8 Option
+ IN UINT16 Para,
+ IN UINT8 Option
);
-//
-// 32-bit Memory Error Information (Type 18)
-//
+/**
+ Display 32-bit Memory Error Information (Type 18) type.
+
+ @param[in] ErrorType The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryErrorType (
- UINT8 ErrorType,
- UINT8 Option
+ IN UINT8 ErrorType,
+ IN UINT8 Option
);
+
+/**
+ Display 32-bit Memory Error Information (Type 18) error granularity.
+
+ @param[in] Granularity The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryErrorGranularity (
- UINT8 Granularity,
- UINT8 Option
+ IN UINT8 Granularity,
+ IN UINT8 Option
);
+
+/**
+ Display 32-bit Memory Error Information (Type 18) error information.
+
+ @param[in] Operation The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryErrorOperation (
- UINT8 Operation,
- UINT8 Option
+ IN UINT8 Operation,
+ IN UINT8 Option
);
-//
-// Memory Array Mapped Address (Type 19)
-// Memory Device Mapped Address (Type 20)
-//
-// Built-in Pointing Device (Type 21)
-//
+/**
+ Display Built-in Pointing Device (Type 21) type information.
+
+ @param[in] Type The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPointingDeviceType (
- UINT8 Type,
- UINT8 Option
+ IN UINT8 Type,
+ IN UINT8 Option
);
+
+/**
+ Display Built-in Pointing Device (Type 21) information.
+
+ @param[in] Interface The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPointingDeviceInterface (
- UINT8 Interface,
- UINT8 Option
+ IN UINT8 Interface,
+ IN UINT8 Option
);
-//
-// Portable Battery (Type 22)
-//
+/**
+ Display Portable Battery (Type 22) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayPBDeviceChemistry (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// Voltage Probe (Type 26)
-//
+/**
+ Display Voltage Probe (Type 26) location information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayVPLocation (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
+
+/**
+ Display Voltage Probe (Type 26) status ype information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayVPStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// Voltage Probe (Type 27)
-//
+/**
+ Display Cooling (Type 27) status information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCoolingDeviceStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
+
+/**
+ Display Cooling (Type 27) type information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayCoolingDeviceType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// Temperature Probe (Type 28)
-//
+/**
+ Display Temperature Probe (Type 28) status information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayTemperatureProbeStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
+
+/**
+ Display Temperature Probe (Type 28) location information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayTemperatureProbeLoc (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// Electrical Current Probe (Type 29)
-//
+/**
+ Display Electrical Current Probe (Type 29) status information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayECPStatus (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
+
+/**
+ Display Electrical Current Probe (Type 29) location information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayECPLoc (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// Management Device (Type 34)
-//
+/**
+ Display Management Device (Type 34) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMDType (
- UINT8 Key,
- UINT8 Option
- );
-VOID
-DisplayMDAddressType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// Memory Channel (Type 37)
-//
+/**
+ Display Memory Channel (Type 37) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayMemoryChannelType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
-//
-// IPMI Device Information (Type 38)
-//
+/**
+ Display IPMI Device Information (Type 38) information.
+
+ @param[in] Key The key of the structure.
+ @param[in] Option The optional information.
+**/
VOID
DisplayIPMIDIBMCInterfaceType (
- UINT8 Key,
- UINT8 Option
+ IN UINT8 Key,
+ IN UINT8 Option
);
#endif
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c
index 8d21967dcc..8df7c81123 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/Smbios.c
@@ -16,77 +16,20 @@
#include <Guid/Smbios.h>
#include "LibSmbios.h"
-EFI_STATUS
-LibGetSmbiosSystemGuidAndSerialNumber (
- IN EFI_GUID *SystemGuid,
- OUT CHAR8 **SystemSerialNumber
- )
-{
- EFI_STATUS Status;
- SMBIOS_STRUCTURE_TABLE *SmbiosTable;
- SMBIOS_STRUCTURE_POINTER Smbios;
- SMBIOS_STRUCTURE_POINTER SmbiosEnd;
- UINT16 Index;
-
- Status = GetSystemConfigurationTable (&gEfiSmbiosTableGuid, (VOID **) &SmbiosTable);
- if (EFI_ERROR (Status)) {
- return EFI_NOT_FOUND;
- }
-
- Smbios.Hdr = (SMBIOS_HEADER *) ((UINTN) (SmbiosTable->TableAddress));
-
- SmbiosEnd.Raw = (UINT8 *) ((UINTN) (SmbiosTable->TableAddress + SmbiosTable->TableLength));
- for (Index = 0; Index < SmbiosTable->TableLength; Index++) {
- if (Smbios.Hdr->Type == 1) {
- if (Smbios.Hdr->Length < 0x19) {
- //
- // Older version did not support Guid and Serial number
- //
- continue;
- }
- //
- // SMBIOS tables are byte packed so we need to do a byte copy to
- // prevend alignment faults on Itanium-based platform.
- //
- CopyMem (SystemGuid, &Smbios.Type1->Uuid, sizeof (EFI_GUID));
- *SystemSerialNumber = LibGetSmbiosString (&Smbios, Smbios.Type1->SerialNumber);
- return EFI_SUCCESS;
- }
- //
- // Make Smbios point to the next record
- //
- LibGetSmbiosString (&Smbios, (UINT16) (-1));
-
- if (Smbios.Raw >= SmbiosEnd.Raw) {
- //
- // SMBIOS 2.1 incorrectly stated the length of SmbiosTable as 0x1e.
- // given this we must double check against the lenght of
- // the structure. My home PC has this bug.ruthard
- //
- return EFI_SUCCESS;
- }
- }
+/**
+ Return SMBIOS string given the string number.
- return EFI_SUCCESS;
-}
+ @param[in] Smbios Pointer to SMBIOS structure.
+ @param[in] StringNumber String number to return. -1 is used to skip all strings and
+ point to the next SMBIOS structure.
-CHAR8 *
+ @return Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
+**/
+CHAR8*
LibGetSmbiosString (
IN SMBIOS_STRUCTURE_POINTER *Smbios,
IN UINT16 StringNumber
)
-/*++
-Routine Description:
- Return SMBIOS string given the string number.
-
- Arguments:
- Smbios - Pointer to SMBIOS structure
- StringNumber - String number to return. -1 is used to skip all strings and
- point to the next SMBIOS structure.
-
- Returns:
- Pointer to string, or pointer to next SMBIOS strcuture if StringNumber == -1
-**/
{
UINT16 Index;
CHAR8 *String;
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
index b59109c455..b280306695 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.c
@@ -14,7 +14,7 @@
#include "../UefiShellDebug1CommandsLib.h"
#include "LibSmbiosView.h"
-#include "smbiosview.h"
+#include "SmbiosView.h"
#include "PrintInfo.h"
#include "QueryTable.h"
@@ -32,6 +32,12 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
{NULL, TypeMax}
};
+/**
+ Function for 'smbiosview' command.
+
+ @param[in] ImageHandle Handle to the Image (NULL if Internal).
+ @param[in] SystemTable Pointer to the System Table (NULL if Internal).
+**/
SHELL_STATUS
EFIAPI
ShellCommandRunSmbiosView (
@@ -197,7 +203,7 @@ SMBiosView (
// structure table head.
//
- SMBIOS_STRUCTURE_POINTER pStruct;
+ SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_STRUCTURE_TABLE *SMBiosTable;
SMBiosTable = NULL;
@@ -269,14 +275,14 @@ SMBiosView (
break;
}
Offset = (UINT16) (Offset + Length);
- pStruct.Raw = Buffer;
+ SmbiosStruct.Raw = Buffer;
//
// if QueryType==Random, print this structure.
// if QueryType!=Random, but Hdr->Type==QueryType, also print it.
// only if QueryType != Random and Hdr->Type != QueryType, skiped it.
//
- if (QueryType != STRUCTURE_TYPE_RANDOM && pStruct.Hdr->Type != QueryType) {
+ if (QueryType != STRUCTURE_TYPE_RANDOM && SmbiosStruct.Hdr->Type != QueryType) {
continue;
}
@@ -284,8 +290,8 @@ SMBiosView (
ShellPrintHiiEx(-1,-1,NULL,
STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT),
gShellDebug1HiiHandle,
- pStruct.Hdr->Type,
- pStruct.Hdr->Handle
+ SmbiosStruct.Hdr->Type,
+ SmbiosStruct.Hdr->Handle
);
ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH), gShellDebug1HiiHandle, Index, Length);
//
@@ -312,12 +318,12 @@ SMBiosView (
//
// check structure legality
//
- SmbiosCheckStructure (&pStruct);
+ SmbiosCheckStructure (&SmbiosStruct);
//
// Print structure information
//
- SmbiosPrintStructure (&pStruct, gShowType);
+ SmbiosPrintStructure (&SmbiosStruct, gShowType);
ShellPrintEx(-1,-1,L"\n");
/*
@@ -363,9 +369,9 @@ InitSmbiosTableStatistics (
UINT16 Offset;
UINT16 Index;
- SMBIOS_STRUCTURE_POINTER pStruct;
+ SMBIOS_STRUCTURE_POINTER SmbiosStruct;
SMBIOS_STRUCTURE_TABLE *SMBiosTable;
- STRUCTURE_STATISTICS *pStatistics;
+ STRUCTURE_STATISTICS *StatisticsPointer;
SMBiosTable = NULL;
LibSmbiosGetEPS (&SMBiosTable);
@@ -394,7 +400,7 @@ InitSmbiosTableStatistics (
}
Offset = 0;
- pStatistics = mStatisticsTable;
+ StatisticsPointer = mStatisticsTable;
//
// search from the first one
@@ -415,19 +421,19 @@ InitSmbiosTableStatistics (
break;
}
- pStruct.Raw = Buffer;
+ SmbiosStruct.Raw = Buffer;
Offset = (UINT16) (Offset + Length);
//
// general statistics
//
- pStatistics->Index = Index;
- pStatistics->Type = pStruct.Hdr->Type;
- pStatistics->Handle = pStruct.Hdr->Handle;
- pStatistics->Length = Length;
- pStatistics->Addr = Offset;
+ StatisticsPointer->Index = Index;
+ StatisticsPointer->Type = SmbiosStruct.Hdr->Type;
+ StatisticsPointer->Handle = SmbiosStruct.Hdr->Handle;
+ StatisticsPointer->Length = Length;
+ StatisticsPointer->Addr = Offset;
- pStatistics = &mStatisticsTable[Index];
+ StatisticsPointer = &mStatisticsTable[Index];
}
return EFI_SUCCESS;
@@ -448,7 +454,7 @@ DisplayStatisticsTable (
{
UINTN Index;
UINTN Num;
- STRUCTURE_STATISTICS *pStatistics;
+ STRUCTURE_STATISTICS *StatisticsPointer;
SMBIOS_STRUCTURE_TABLE *SMBiosTable;
SMBiosTable = NULL;
@@ -477,22 +483,22 @@ DisplayStatisticsTable (
}
ShellPrintEx(-1,-1,L"============================================================\n");
- pStatistics = &mStatisticsTable[0];
+ StatisticsPointer = &mStatisticsTable[0];
Num = SMBiosTable->NumberOfSmbiosStructures;
//
// display statistics table content
//
for (Index = 1; Index <= Num; Index++) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, pStatistics->Index);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, pStatistics->Type);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, pStatistics->Handle);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_INDEX), gShellDebug1HiiHandle, StatisticsPointer->Index);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_TYPE), gShellDebug1HiiHandle, StatisticsPointer->Type);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_HANDLE), gShellDebug1HiiHandle, StatisticsPointer->Handle);
if (Option >= SHOW_DETAIL) {
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, pStatistics->Addr);
- ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, pStatistics->Length);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_OFFSET), gShellDebug1HiiHandle, StatisticsPointer->Addr);
+ ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN (STR_SMBIOSVIEW_SMBIOSVIEW_LENGTH), gShellDebug1HiiHandle, StatisticsPointer->Length);
}
ShellPrintEx(-1,-1,L"\n");
- pStatistics = &mStatisticsTable[Index];
+ StatisticsPointer = &mStatisticsTable[Index];
/*
//
// Display 20 lines and wait for a page break
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
index 3d532b4ab1..22d7b241f4 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosView.h
@@ -1,7 +1,7 @@
/** @file
Tools of clarify the content of the smbios table.
- Copyright (c) 2005 - 2010, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@@ -12,8 +12,8 @@
**/
-#ifndef _SMBIOS_VIEW_H
-#define _SMBIOS_VIEW_H
+#ifndef _SMBIOS_VIEW_H_
+#define _SMBIOS_VIEW_H_
#define STRUCTURE_TYPE_RANDOM (UINT8) 0xFE
#define STRUCTURE_TYPE_INVALID (UINT8) 0xFF
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
index de754e8bc7..3967768d1a 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
#define _UEFI_SHELL_DEBUG1_COMMANDS_LIB_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
index d4058905ff..f773cb600f 100644
--- a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
@@ -53,7 +53,7 @@
SmbiosView/LibSmbiosView.h
SmbiosView/LibSmbios.h
SmbiosView/QueryTable.h
- SmbiosView/smbiosview.h
+ SmbiosView/SmbiosView.h
UefiShellDebug1CommandsLib.c
UefiShellDebug1CommandsLib.h
UefiShellDebug1CommandsLib.uni
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
index 658e7df219..a6e27e93da 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/Devices.c
@@ -58,8 +58,6 @@ GetDeviceHandleInfo (
EFI_HANDLE *HandleBuffer;
UINTN Count;
- UINTN TestHandle = 0x43;
-
if (TheHandle == NULL
|| Type == NULL
|| Cfg == NULL
@@ -71,10 +69,6 @@ GetDeviceHandleInfo (
return (EFI_INVALID_PARAMETER);
}
- if (ConvertHandleToHandleIndex(TheHandle) == TestHandle) {
- TestHandle = TestHandle;
- }
-
*Cfg = FALSE;
*Diag = FALSE;
*Children = 0;
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
index 6b55d909e9..986dc3a056 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/DrvDiag.c
@@ -211,7 +211,7 @@ DoDiagnostics (
FreePool(Language);
}
}
- if (Found == FALSE && (Lang == NULL||(Lang!=NULL&&Lang[2]!='-'))){
+ if (!Found && (Lang == NULL||(Lang!=NULL&&(Lang[2]!='-')))){
Status = gBS->OpenProtocol(
DriverHandleList[DriverHandleListLoop],
&gEfiDriverDiagnosticsProtocolGuid,
diff --git a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
index 656958342e..699053f2d8 100644
--- a/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_SHELL_DRIVER1_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_DRIVER1_COMMANDS_LIB_H_
#define _UEFI_SHELL_DRIVER1_COMMANDS_LIB_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h
index 9d3f444813..48dcd4c2fc 100644
--- a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_SHELL_INSTALL1_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_INSTALL1_COMMANDS_LIB_H_
#define _UEFI_SHELL_INSTALL1_COMMANDS_LIB_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
index eadb501e20..7b3efd2f2c 100644
--- a/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
#define _UEFI_SHELL_LEVEL1_COMMANDS_LIB_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
index 68130d4db8..266145c08d 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
@@ -516,18 +516,19 @@ CONST CHAR16 AnyF[] = L"F*";
/**
Function to display mapping information to the user.
- if Specific is specified then Consist and Normal will be ignored since information will
+ If Specific is specified then Consist and Normal will be ignored since information will
be printed for the specific item only.
- @param[in] Verbose TRUE to display (extra) verbose information
- @param[in] Consist TRUE to display consistent mappings
- @param[in] Normal TRUE to display normal (not consist) mappings
- @param[in] TypeString pointer to string of filter types
- @param[in] SFO TRUE to display output in Standard Output Format
- @param[in] Specific pointer to string for specific map to display
+ @param[in] Verbose TRUE to display (extra) verbose information.
+ @param[in] Consist TRUE to display consistent mappings.
+ @param[in] Normal TRUE to display normal (not consist) mappings.
+ @param[in] TypeString Pointer to string of filter types.
+ @param[in] SFO TRUE to display output in Standard Output Format.
+ @param[in] Specific Pointer to string for specific map to display.
+ @param[in] Header TRUE to print the header block.
- @retval SHELL_SUCCESS the display was printed
- @retval SHELL_INVALID_PARAMETER one of Consist or Normal must be TRUE if no Specific
+ @retval SHELL_SUCCESS The display was printed.
+ @retval SHELL_INVALID_PARAMETER One of Consist or Normal must be TRUE if no Specific.
**/
SHELL_STATUS
diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
index cf862fef43..49e187fc7a 100644
--- a/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
+++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.h
@@ -20,7 +20,7 @@
**/
-#if !defined (_UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
#define _UEFI_SHELL_LEVEL2_COMMANDS_LIB_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
index 6d19d9cc68..bab34a412d 100644
--- a/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
+++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
#define _UEFI_SHELL_LEVEL3_COMMANDS_LIB_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.h b/ShellPkg/Library/UefiShellLib/UefiShellLib.h
index 9baa3e45bc..32f1c6596d 100644
--- a/ShellPkg/Library/UefiShellLib/UefiShellLib.h
+++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.h
@@ -12,7 +12,7 @@
**/
-#if !defined (_UEFI_SHELL_LIB_INTERNAL_H_)
+#ifndef _UEFI_SHELL_LIB_INTERNAL_H_
#define _UEFI_SHELL_LIB_INTERNAL_H_
#include <Uefi.h>
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
index d4326448f6..13d24969f8 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
@@ -20,7 +20,7 @@
BOOLEAN mIp4ConfigExist = FALSE;
STATIC EFI_HII_CONFIG_ROUTING_PROTOCOL *mHiiConfigRouting = NULL;
-STATIC CONST UINTN SEC_TO_NS = 10000000;
+STATIC CONST UINTN SecondsToNanoSeconds = 10000000;
STATIC CONST CHAR16 DhcpString[5] = L"DHCP";
STATIC CONST CHAR16 StaticString[7] = L"STATIC";
STATIC CONST CHAR16 PermanentString[10] = L"PERMANENT";
@@ -173,7 +173,7 @@ TestChildHandle (
Get the child handle of the NIC handle.
@param[in] Controller Routing information: GUID.
- @param[in] ChildHandle Returned child handle.
+ @param[out] ChildHandle Returned child handle.
@retval EFI_SUCCESS Successfully to get child handle.
**/
@@ -1128,7 +1128,7 @@ IfconfigStartIp4(
Status = gBS->SetTimer (
TimerToGetMap,
TimerRelative,
- MultU64x32 (SEC_TO_NS, 5)
+ MultU64x32 (SecondsToNanoSeconds, 5)
);
if (EFI_ERROR (Status)) {
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
index 7982f99c57..ab7658c45b 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ping.c
@@ -134,29 +134,21 @@ typedef struct _PING_PRIVATE_DATA {
PING_IPX_COMPLETION_TOKEN RxToken;
} PING_PRIVATE_DATA;
+/**
+ Calculate the internet checksum (see RFC 1071).
+
+ @param[in] Packet Buffer which contains the data to be checksummed.
+ @param[in] Length Length to be checksummed.
+
+ @retval Checksum Returns the 16 bit ones complement of
+ ones complement sum of 16 bit words
+**/
UINT16
EFIAPI
NetChecksum (
IN UINT8 *Buffer,
IN UINT32 Length
)
-/*++
-
-Routine Description:
-
- Calculate the internet checksum (see RFC 1071)
-
-Arguments:
-
- Packet - Buffer which contains the data to be checksummed
- Length - Length to be checksummed
-
-Returns:
-
- Checksum - Returns the 16 bit ones complement of
- ones complement sum of 16 bit words
-
---*/
{
UINT32 Sum;
UINT8 Odd;
@@ -167,11 +159,11 @@ Returns:
Sum = 0;
Odd = (UINT8) (Length & 1);
Length >>= 1;
- while (Length--) {
+ while ((Length--) != 0) {
Sum += *Packet++;
}
- if (Odd) {
+ if (Odd != 0) {
Sum += *(UINT8 *) Packet;
}
diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
index 144063c615..1093479f83 100644
--- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
+++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.h
@@ -13,7 +13,7 @@
**/
-#if !defined (_UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_)
+#ifndef _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
#define _UEFI_SHELL_NETWORK1_COMMANDS_LIB_H_
#include <Uefi.h>