1492 Commits

Author SHA1 Message Date
9e815d789b ShellPkg/SmbiosView: Display Type 44 "Referenced Handle" field
Signed-off-by: Cassandra Lam <Cassandra.Lam@amd.com>
2025-10-16 08:57:01 +00:00
28b7a6d5ea ShellPkg/SmbiosView: Display Type 2 Contained Objects info
Add prints for SMBIOS Type 2 "Number of Contained Object Handles" and
"Contained Object Handles" fields.

Signed-off-by: Cassandra Lam <Cassandra.Lam@amd.com>
2025-10-16 08:57:01 +00:00
a0e8b71ee5 ShellPkg: Review SMBIOS 3.9 specification
Add new structure members RackType and RackHeight in Smbios Type3.

Signed-off-by: Anupriya <anupriyak@ami.com>
2025-10-16 07:49:51 +00:00
5cf1be671b ShellPkg/pci.c: Fix typo in source code.
Signed-off-by: Chasel Chiu <chasel.chiu@intel.com>
2025-10-03 17:14:30 +00:00
5550d8f0b7 ShellPkg: Add PCIe boundary check and enhance DVSEC size calculation
1. Safe wrapper function for DumpHex that validates PCI configuration
   space boundaries. This function ensures that hex dumps do not exceed
   the standard 4KB PCIe configuration space boundary. If the requested
   dump would exceed this boundary, it prints an error message and
   truncates the dump size to remain within valid bounds.

2. Enhance DVSEC capability structure size calculation method. Size is
   now obtained from the DesignatedVendorSpecificHeader1.Bits.DvsecLength
   register.

Issue: https://github.com/tianocore/edk2/issues/11554

Signed-off-by: Pranav V V <pranav.v.v@intel.com>
2025-10-03 17:14:30 +00:00
8b22c532b3 ShellPkg/Library: rework Shell...CommandsLib Load.c
CodeQL incorrectly flags that LoadedDriverImage might be derferenced
while NULL, but the actual code paths make that impossible.

Strip several levels of success handling to improve readability for
humans and static analyzers both.

Signed-off-by: Leif Lindholm <leif.lindholm@oss.qualcomm.com>
2025-10-01 10:02:57 +02:00
aa29d51637 ShellPkg: Use the newly introduced ShellPrintDefaultEx() alias
Make use the newly introduced ShellPrintDefaultEx() alias and
replace wherever it is possible:
- "ShellPrintEx (-1, -1,"
with:
- "ShellPrintDefaultEx ("

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
c4a8b001f3 ShellPkg: Use the newly introduced ShellPrintHiiDefaultEx() alias
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-01 10:02:57 +02:00
44a3048c7c ShellPkg/ShellLib.h: Add aliases for ShellPrintEx() and ShellPrintHiiEx()
Most calls to ShellPrintEx() and ShellPrintHiiEx() are done
using the default optional value for the:
- location, through the column/row arguments
- language

Create aliases that automatically populate the col, row and language
optional parameters with their default value. This helps to reduce:
- the information to read/understand by users
- the code size

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
9363f19900 ShellPkg/Connect: Extract a ConnectFromEfiVariable() function
In an effort to simplify the code in the ShellPkg,
extract a ConnectFromEfiVariable() function to connect devices
pointed by a list of EFI variables.

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
53f83ae00d ShellPkg/Connect: Extract a ConnectConsoles() function
In an effort to simplify the code in the ShellPkg,
extract a ConnectConsoles() function to connect device consoles.

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
bcfbaf5f00 ShellPkg/Connect: Simplify error handling in ShellConnectFromDevPaths()
In an effort to simplify the code in the ShellPkg,
simplify error handling case in ShellConnectFromDevPaths().

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
7ae7bd8ef2 ShellPkg/DrvCfg: Simplify error handling in ParseBufferConfig()
In an effort to simplify the code in the ShellPkg,
simplify error handling cases in ParseBufferConfig().

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
3fcea99da0 ShellPkg/DrvCfg: Extract a ParseBufferConfig() function
In an effort to simplify the code in the ShellPkg,
extract a ParseBufferConfig().

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
16ffc09be1 ShellPkg/MemMap: Extract a ParseMemoryDescriptors() function
In an effort to simplify the code in the ShellPkg,
extract a ParseMemoryDescriptors() function.

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
5ff8948a12 ShellPkg/MemMap: Create arrays of MemoryType configuration and Page
In an effort to simplify the code in the ShellPkg:
- create a MEMORY_TYPE_INFO struct, storing per-MemoryType configuration
  information to facilitate the operations to do for each MemoryType.
- create a MEMORY_TYPE_PAGES_INFO struct, storing per-MemoryType
  Pages and PagesSize count.
Also use these arrays to facilitate Pages accounting and remove
per-MemoryType variables.

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
25daa0fcc9 ShellPkg/MemMap: Create array of MemoryType names
In an effort to simplify the code in the ShellPkg,
replace the MemoryType names that are currently stored in individual
variables by an array of names, facilitating access to these names.

No functional change is introduced.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
0f57fc7cf7 ShellPkg/Dmem: Remove return parameter from DisplayXXX() functions
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-01 10:02:57 +02:00
2bebeb1ad4 ShellPkg/Dmem: Remove unnecessary EfiGetSystemConfigurationTable() calls
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-01 10:02:57 +02:00
482781a7f9 ShellPkg/Dmem: Simplify logic by inverting Address checks
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-01 10:02:57 +02:00
e78453fb54 ShellPkg/Dmem: Replace per-System Table variable by indexed arrays
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-01 10:02:57 +02:00
0235ac23c5 ShellPkg/Dmem: Remove Memory Range Capsule support
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: 42b0443599
("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-01 10:02:57 +02:00
cf67a0c78e ShellPkg/Dmem: Remove remaining of SAL System Table
The SAL System Table is unsupported and its support was
removed in commit:
f4c874c45d ("ShellPkg/UefiShellDebug1CommandsLib")

Remove remaining of SAL System Table handling.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-10-01 10:02:57 +02:00
ace36ed376 ShellPkg/Dmem: Extract a DisplaySystemTable() function
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-10-01 10:02:57 +02:00
bc431cece3 ShellPkg: add support for AGDI table in acpiview
The AGDI table is a Global Diagnostic Dump and Reset Interface table
defined by Arm. Add support for dumping the table contents in the
acpiview command.

Signed-off-by: Sughosh Ganu <sughosh.ganu@arm.com>
2025-09-29 10:44:12 +00:00
9c657c3685 ShellPkg: Remove ARM32 Support
edk2 is dropping support for the ARM32 architecture. This commit
removes support from ShellPkg.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
f451d187c3 ShellPkg: AcpiView: Fix CodeQL Error
When removing ARM32 code from edk2, a CodeQL
error in AcpiView (pointer used without null
check) was flagged in GH.

This updates the code to eliminate the duplicate code in that
function and instead call EfiGetSystemConfigurationTable.

Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-25 22:04:10 +00:00
406aeb5a97 ShellPkg/SmbiosView: Add decode for DSP0134 SMBIOS Spec v3.9.0
Add decode for Type17 Memory based on SMBIOS Spec v3.9.0

Signed-off-by: Giri Mudusuru <girimudusuru@microsoft.com>
2025-09-09 10:39:33 +00:00
cf5f907cd5 ShellPkg: Deprecate EFI_UNICODE_COLLATION_PROTOCOL_GUID
As EFI_UNICODE_COLLATION_PROTOCOL_GUID is being deprecated.
Remove the instances used in ShellPkg.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
e27779e2c1 ShellPkg/Library: Deprecate EFI_DEVICE_IO_PROTOCOL
gEfiDeviceIoProtocolGuid identifies EFI_DEVICE_IO_PROTOCOL,
which provided low-level I/O and MMIO access for UEFI drivers.

It was removed in UEFI 2.10A and 2.11 due to overlapping
functionality with modern protocols like EFI_PCI_IO_PROTOCOL
and EFI_CPU_IO2_PROTOCOL. These newer protocols offer improved
modularity, abstraction, and safety, making EFI_DEVICE_IO_PROTOCOL
obsolete.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
c3cab06d2b ShellPkg/Library: Deprecate EFI_IP4_CONFIG_PROTOCOL
EFI_IP4_CONFIG_PROTOCOL is superseded by
EFI_IP4_CONFIG2_PROTOCOL, which provides better
support for modern network stack requirements.

It was officially removed from UEFI specifications
2.10A and 2.11 and should no longer be used in
current implementations.

Cc: Sachin Ganesh <sachinganesh@ami.com>
Signed-off-by: Gowtham M <gowthamm@ami.com>
2025-09-05 13:50:50 +00:00
c992bffaef ShellPkg: Add support for PCIe Extended IDs
Add a support to print PTM (001F) structure.

Signed-off-by: Nanjinmoorthy <nanjinmoorthyj@ami.com>
2025-09-05 12:04:06 +00:00
f718b0ffd6 ShellPkg/UefiShellDebug1CommandsLib: Add MRDIMM entry to QueryTable
Added the MRDIMM (0x08) entry to the MemoryDeviceMemoryTechnologyTable
in QueryTable.c.  This enables proper display and decoding of MRDIMM memory
technology in SMBIOS Type 17 structures.

Signed-off-by: Ning Feng <ning.feng@intel.com>
2025-09-02 17:11:24 +00:00
d46aa46c83 ShellPkg: Remove EmbeddedPkg dependency
Commit dcde148 introduced EmbeddedPkg as a dependency
since gFdtTableGuid was in the EmbeddedPkg, but has now
been moved to MdePkg.

Signed-off-by: Prachotan Bathi <prachotan.bathi@arm.com>
2025-08-12 17:42:44 +00:00
47e818016a ShellPkg/Library: Remove unecessary error check
Remove the error handling from the connect.c file as it is redundant.

Signed-off-by: Nanjinmoorthy <nanjinmoorthyj@ami.com>
2025-07-25 09:57:50 +00:00
be6342d64f ShellPkg: Fixed Deadcode and Null field Coverity warnings.
Updated fixes for all Deadcode and Null field Coverity fixes in ShellPkg

Signed-off-by: Revathy <revathyv@ami.com>
2025-07-24 07:57:29 +00:00
01295fd25b ShellPkg: DtbTableAddress via config in dmem
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: 42b0443599
("ShellPkg: UefiShellDebug1CommandsLib: Uefi Config Tables in Dmem.c")

Signed-off-by: Prachotan Reddy Bathi <Prachotan.Bathi@arm.com>
2025-07-24 05:59:45 +00:00
c27552f343 ShellPkg: Shell Validate parameter before use.
When FvSimpleFileSystem is included in a firmware image,
the FV is accessible as a simple file system.

Shell contained a bad assumption that the FileDevicepath,
the path where the efi shell was loaded from, was always
a Media device path/media vendor device path. It would
make a blind cast of the device path node.

Add a check to verify device path type/subtype before
casting the node to a FILEPATH_DEVICE_PATH.

Signed-off-by: Aaron Pop <aaronpop@microsoft.com>
2025-07-23 06:07:09 +00:00
ea2ef8c3c9 ShellPkg: Remove UGA support
The Universal Graphics Adapter (UGA) is a graphic abstraction.
The UGA I/O and Draw protocols are deprecated since UEFI 2.0 was
introduced. Cf. the UEFI spec v2.9:
"Appendix L - EFI 1.10 Protocol Changes and Deprecation List"
section L.2 "Deprecated Protocols"

Remove the UGA support.

Signed-off-by: GuoMinJ <newexplorerj@gmail.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-07-08 15:42:03 +00:00
f2e9785b6e ShellPkg: Correct spelling errors and typos
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>
2025-07-04 09:41:47 +08:00
9d4eda962a ShellPkg: Remove PcdShellSupportOldProtocols
PcdShellSupportOldProtocols aimed to force using the following protocols:
- gEfiShellEnvironment2Guid
- gEfiShellInterfaceGuid
over the UEFI Shell 2.0 protocols:
- gEfiShellProtocolGuid

These 2 protocols seem to originate from the original EDK(1) implementation
and are now deprecated. The protocols are not implemented in EDK2.

Remove the PcdShellSupportOldProtocols which does not switch to using
the original shell protocols. Setting the PCD to TRUE prevents from
loading the UEFI Shell.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-06-13 21:11:49 +00:00
c2eb2136b4 ShellPkg/UefiShellLib: Fix Buffer underflow
Having StrLen(Buffer) == 0 results in a Buffer underflow.
Also, StrLen iterates over the Buffer elements until finding a NULL
character. This results in a quadratic search for '\r' characters
in the while loop.

Fix these issues.

Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-06-13 21:11:49 +00:00
f242a0e87f ShellPkg/UefiShellLevel2CommandLib: Free Buffer after use
Free the allocated Buffer after use.

Reported-by: Ramesh R <rameshr@ami.com>
Signed-off-by: Pierre Gondois <pierre.gondois@arm.com>
2025-06-13 21:11:49 +00:00
dfc8e90fdb ShellPkg: Prevent memcpy intrinsics in VS22 (17.14.2)
The latest VS2022 update replaces some code patterns with struct
assignments with `memcpy`. This change convert the code to
explicitly use `CopyMem`.

Signed-off-by: Michael Kubacki <michael.kubacki@microsoft.com>
2025-06-08 18:07:56 +00:00
de0c610d3d ShellPkg: Removed Pei, Dxe, Smm and mm header files
Signed-off-by: Bhavani Subramanian <v-bhavanisu@microsoft.com>
2025-05-28 08:01:10 +00:00
2781647298 ShellPkg: Removed comments on ShellPkgHostTest.dsc as per PR review
Signed-off-by: Bhavani Subramanian <v-bhavanisu@microsoft.com>
2025-05-28 08:01:10 +00:00
5f510abf66 ShellPkg: Added MockShellCommandLib
Signed-off-by: Bhavani Subramanian <v-bhavanisu@microsoft.com>
2025-05-28 08:01:10 +00:00
6ea05b5c95 ShellPkg: Added MockShellLib
Signed-off-by: Bhavani Subramanian <v-bhavanisu@microsoft.com>
2025-05-28 08:01:10 +00:00
defdccd4ae ShellPkg: Add PCIe extended capability
Updates PCIe shell command to display previously undefined
PCIe extended capabilities.

Signed-off-by: Cian Costello <ccostello@nvidia.com>
2025-04-30 04:11:42 +00:00
d3b2ee2df3 ShellPkg: Updated Memory Form Factor definition per SMBIOS 3.8.0
This patch adds additional support for the new CAMM form factor
defined in SMBIOS specification 3.8.0

Signed-off-by: Shveta Gupta <shvetag@nvidia.com>
2025-04-22 17:32:39 +00:00