summaryrefslogtreecommitdiff
path: root/ShellPkg/Library/UefiShellDebug1CommandsLib/Dmem.c
AgeCommit message (Collapse)AuthorFilesLines
2026-08-04ShellPkg/Dmem: Refactor MainCmdDmem()Pierre Gondois1-26/+51
Refactor MainCmdDmem() to make it easier to understand. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04ShellPkg/UefiShellDebug1: Lower indentation level in MainCmdXXX() (1/4)Pierre Gondois1-15/+15
This patch aims to help breaking down the long functions present in the ShellPkg and reduce complexity/nested code and conditions. Lower the indentation level in the newly created MainCmdXXX() functions. To avoid having one large commit updating all the UefiShellDebug1 commands, only update these files: - Comp.c - Cxl.c - Dblk.c - Dmem.c - DmpStore.c No functional change should be induced by this patch. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04ShellPkg/UefiShellDebug1: Extract MainCmdXXX() function (1/4)Pierre Gondois1-42/+61
This patch aims to help breaking down the long functions present in the ShellPkg and reduce complexity/nested code and conditions. Extract a MainCmdXXX() function for each shell command. This command contains the possible operations the command aims to operate. The ShellCommandRunXXX() function from which it is extracted is only responsible of: - initializing the shell/command environment - parsing the command parameter and creating a Package - freeing the Package For the MemMap and SetVar commands, ShellCommandLineFreeVarList() calls are removed as the Package is now freed in the caller function: ShellCommandRunXXX(). To avoid having one large commit updating all the UefiShellDebug1 commands, only update these files: - Comp.c - Cxl.c - Dblk.c - Dmem.c - DmpStore.c No functional change should be induced by this patch. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2026-08-04ShellPkg/UefiShellDebug1: Return if ShellCommandLineParse() failed (1/4)Pierre Gondois1-28/+30
This patch aims to help breaking down the long functions present in the ShellPkg and reduce complexity/nested code and conditions. Return directly if ShellCommandLineParse() returned an error Status. In such case, the "Package" that should be allocated by ShellCommandLineParse() is already freed in: ShellCommandLineParse() \-ShellCommandLineParseEx() \-InternalCommandLineParse() so there is no need to free it with ShellCommandLineFreeVarList(). To avoid having one large commit updating all the UefiShellDebug1 commands, only update these files: - Comp.c - Cxl.c - Dblk.c - Dmem.c - DmpStore.c No functional change should be induced by this patch. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg: Use the newly introduced ShellPrintHiiDefaultEx() aliasPierre Gondois1-36/+21
Make use the newly introduced ShellPrintHiiDefaultEx() alias and replace wherever it is possible: - "ShellPrintHiiEx (-1, -1, NULL," with: - "ShellPrintHiiDefaultEx (" No functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Remove return parameter from DisplayXXX() functionsPierre Gondois1-42/+20
In an effort to simplify the code in the ShellPkg, remove the SHELL_STATUS parameter returned by: - DisplayRtProperties() - DisplayImageExecutionEntries() - DisplayConformanceProfiles() These functions are independent display functions. Thus failing to display a configuration table should not prevent from displaying the remaining tables. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Remove unnecessary EfiGetSystemConfigurationTable() callsPierre Gondois1-38/+32
In an effort to simplify the code in the ShellPkg, remove EfiGetSystemConfigurationTable() calls fetching Configuration Table addresses that have already been collected. No functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Simplify logic by inverting Address checksPierre Gondois1-78/+81
In an effort to simplify the code in the ShellPkg, inverse checks against the 'Address'. This also lowers the indentation level. No functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Replace per-System Table variable by indexed arraysPierre Gondois1-125/+72
In an effort to simplify the code in the ShellPkg, remove the per-System Table variables by indexed arrays. The only functional change introduced is that a non-null Smbios3 System Table: - always replaces an Smbios System Table - ASSERT if (Smbios3 != 0) and (Smbios != 0) Otherwise no functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Remove Memory Range Capsule supportPierre Gondois1-3/+0
Memory Range Capsule is described in the UEFI spec 2.9 s8.5.3 Update Capsule with the following GUID: {0DE9F0EC-88B6-428F-977A-258F1D0E5E72} Support to print the EFI_MEMORY_RANGE_CAPSULE address in the EFI Configuration table was added in commit: 42b0443599a6 ("ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c") but EFI_MEMORY_RANGE_CAPSULE type and GUID is not present in edk2. Thus dmem always print a 0 value for this configuration table. Remove support of EFI_MEMORY_RANGE_CAPSULE in dmem. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Remove remaining of SAL System TablePierre Gondois1-3/+0
The SAL System Table is unsupported and its support was removed in commit: f4c874c45dbc ("ShellPkg/UefiShellDebug1CommandsLib") Remove remaining of SAL System Table handling. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01ShellPkg/Dmem: Extract a DisplaySystemTable() functionPierre Gondois1-163/+185
In an effort to simplify the code in the ShellPkg, extract a DisplaySystemTable(). This also lowers the indentation level. No functional change is introduced. Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-24ShellPkg: DtbTableAddress via config in dmemPrachotan Reddy Bathi1-0/+5
DTB address can be modified through the config table. Use this address in dmem output. EmbeddedPkg dependency added to ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf and ShellPkg/ShellPkg.ci.yaml Adds to: 42b0443599a6 ("ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c") Signed-off-by: Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>
2025-01-29ShellPkg: fix warnings about uninitialized variableMike Maslenkin1-10/+13
Dmem.c: In function 'GetImageExecutionInfo': Dmem.c:241:10: error: 'Status' may be used uninitialized in this function [-Werror=maybe-uninitialized] return Status; ^~~~~~ Dmem.c:284:35: note: 'Status' was declared here EFI_STATUS Status; ^~~~~~ Dmem.c: In function 'ShellCommandRunDmem': Dmem.c:586:27: error: 'ConformanceProfileTableAddress' may be used uninitialized in this function [-Werror=maybe-uninitialized] ShellStatus = DisplayConformanceProfiles (ConformanceProfileTableAddress); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dmem.c:582:27: error: 'ImageExecutionTableAddress' may be used uninitialized in this function [-Werror=maybe-uninitialized] ShellStatus = DisplayImageExecutionEntries (ImageExecutionTableAddress); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Dmem.c:578:27: error: 'RtPropertiesTableAddress' may be used uninitialized in this function [-Werror=maybe-uninitialized] ShellStatus = DisplayRtProperties (RtPropertiesTableAddress); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: all warnings being treated as errors Signed-off-by: Mike Maslenkin <mike.maslenkin@gmail.com>
2024-07-10ShellPkg: UefiShellDebug1CommandsLib: Conformance Profiles in Dmem.cSam Kaynor1-0/+80
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented dumping of the UEFI Conformance Profiles Table using Dmem.c Uses header file for GUIDs added in previous patches Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Tested-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Stuart Yoder <stuart.yoder@arm.com>
2024-07-10ShellPkg: UefiShellDebug1CommandsLib: Image Execution Table in Dmem.cSam Kaynor1-0/+136
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented dumping of the Image Execution Table using Dmem.c Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Tested-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2024-07-10ShellPkg: UefiShellDebug1CommandsLib: Dumping RT Properties in Dmem.cSam Kaynor1-2/+64
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4352 Implemented the dumping of the UEFI RT Properties Table using Dmem.c Added new entry to the help command for the -verbose option Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Tested-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Stuart Yoder <stuart.yoder@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
2023-04-13ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.cSam Kaynor1-6/+93
Added entries for UEFI Config Tables not present in current Dmem output. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sam Kaynor <Sam.Kaynor@arm.com> Reviewed-by: Sunny Wang <sunny.wang@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <Samer.El-Haj-Mahmoud@arm.com>
2021-12-07ShellPkg: Apply uncrustify changesMichael Kubacki1-75/+86
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737 Apply uncrustify changes to .c/.h files in the ShellPkg package Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
2019-04-28ShellPkg/UefiShellDebug1CommandsLibShenglei Zhang1-5/+0
With Itanium architecture unsupported, gEfiSalSystemTableGuid and gEfiMpsTableGuid will be no longer used. https://bugzilla.tianocore.org/show_bug.cgi?id=1560 v2:Withdraw the removal of #include <Guid/Mps.h> and gEfiMpsTableGuid. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2019-04-09ShellPkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney1-7/+1
https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2018-10-24ShellPkg/dmem: Only dump sizeof (EFI_SYSTEM_TABLE) bytes for gSTRuiyu Ni1-1/+1
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1236 When "dmem" runs without additional arguments, it dumps the memory content of EFI_SYSTEM_TABLE. But today's implementation dumps 512 bytes. It's not correct because sizeof (EFI_SYSTEM_TABLE) is less than 512, the 512-read causes page fault exception in a heap-guard enabled environment. The patch changes the implementation to only dump sizeof (EFI_SYSTEM_TABLE) bytes for gST. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jim Dailey <jim_dailey@.com>
2018-06-28ShellPkg: Clean up source filesLiming Gao1-11/+11
1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-10-09ShellPkg/UefiShellDebug1CommandsLib: Remove unnecessary EFIAPIChen A Chen1-2/+0
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2016-07-18ShellPkg/DMem: Handle memory allocation failureRuiyu Ni1-2/+4
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
2015-09-18ShellPkg: Added SMBIOS 3.0 support in dmem.Samer El-Haj-Mahmoud1-1/+6
Added SMBIOS 3.0 support in dmdem Shell command since SMBIOS 3.0 uses a different GUID in the System Configuration Table. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@hpe.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18506 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-05ShellPkg: Standardized HP Copyright Message StringTapan Shah1-1/+1
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16759 6f19259b-4bc3-4df7-8a09-765794883524
2015-02-04ShellPkg: Update Debug1 profile commands response outputTapan Shah1-6/+7
Updates to Debug1 profile commands response output. Updating Debug1 profile commands source code to include command name as a prefix in error message. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Tapan Shah <tapandshah@hp.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16729 6f19259b-4bc3-4df7-8a09-765794883524
2012-12-19ShellPkg: Updates to DumpHex() and ‘dmem’ command for correct output formatjcarsey1-2/+2
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hp.com> reviewed-by: Jaben Carsey <jaben.carsey@intel.com> git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@14010 6f19259b-4bc3-4df7-8a09-765794883524
2011-04-08Fix Xcode, clang, and ARM build and link issues.andrewfish1-14/+14
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11513 6f19259b-4bc3-4df7-8a09-765794883524
2011-03-26comp - add comments and add input verification jcarsey1-17/+95
bcfg - updated for bugs. compress - rename for coding standards. add comments. dblk - add comments, input verification, and a header line dmem - add comments, add input verification, add system table info dmpstore - add comments eficompress - add comments and add input verification efidecompress - add comments and add input verification loadpcirom - add comments and more output messages memmap - add more output to exceed the spec. mm - move functions, add comments, add input verification. mode - add comment pci - add input verification. SerMode - add comments and add input verification setsize - add comments and add input verification setvar - add comments and add input verification smbiosview - add input verification. clarify error messages. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11438 6f19259b-4bc3-4df7-8a09-765794883524
2010-11-17Add "Debug1" profile (all but Edit and HexEdit commands)jcarsey1-0/+149
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11068 6f19259b-4bc3-4df7-8a09-765794883524