summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library
Commit message (Collapse)AuthorAgeFilesLines
* ShellPkg: Add ARM64 SoC ID to Processor Characteristics in smbiosviewRebecca Cran2020-10-301-0/+4
| | | | | | | | | | SMBIOS 3.4.0 defines bit 9 of the Type 4 table Processor Characteristics field to be the ARM64 SoC ID support. Add support for it to the smbiosview command. Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg: Fix smbiosview string definition name for "boot from CD"Rebecca Cran2020-10-302-2/+2
| | | | | | | | | The "boot from CD supported" string definition name should contain the word "from" instead of "form". Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg: Fix a couple of typos in smbiosviewRebecca Cran2020-10-301-2/+2
| | | | | | | | | | Fix a couple of typos in SmbiosViewStrings.uni: "Boot form CD" should be "Boot from CD", and "plugged from the wall" should be "plugged into the wall". Signed-off-by: Rebecca Cran <rebecca@nuviainc.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn>
* ShellPkg/SmbiosView: Add DDR5 supportGao, Zhichao2020-10-141-0/+8
| | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2352 Refer to SMBIOS 3.4 spec, add new memory device type - DDR5 and LPDDR5 support for the shell command "smbiosview". Cc: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* ShellPkg: Fix spelling mistake for occurredMichael D Kinney2020-08-1922-91/+91
| | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2361 Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Guomin Jiang <guomin.jiang@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: smbiosview - Change some type 17 field values formatSamer El-Haj-Mahmoud2020-08-071-7/+7
| | | | | | | | | | | | | | | | | Change how some SMBIOS TYpe 17 field values are printed: - TotalWidth, DataWidth, ConfiguredMemoryClockSpeed: Print as hex values instead of decimal, since there are some special meanings for certain values (e.g. 0xFFFF) - VolatileSize, NonVolatileSize, CacheSize, and LogicalSize: Print as "0x%lx" instead of "0x%x" to prevent truncating output when printing these QWORD fields. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Sami Mujawar <Sami.Mujawar@arm.com> Signed-off-by: Samer El-Haj-Mahmoud <samer.el-haj-mahmoud@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Add AcpiViewCommandLibTomas Pilar2020-06-304-49/+3
| | | | | | | | | | | | | | | The UefiShellAcpiViewCommandLib is converted from NULL library to a named library so that it may be used in modules other than shell. The library interface exposes the main method for to AcpiView functionality as well as a helper method to dump a buffer to a file. The Shell module is still built by pulling UefiShellAcpiViewCommandLib as a NULL library to preserve the modularity of shell builds. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Refactor DumpAcpiTableToFileTomas Pilar2020-06-303-38/+76
| | | | | | | | | | | | | | Method is refactored into two parts. A new method is created that dumps arbitrary buffers into a newly created file. This method is called from core code after the core code determined the appropriate filename to be used. This improves the modular design. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Move parameter parsingTomas Pilar2020-06-304-211/+240
| | | | | | | | | | | Parsing command line parameters is done in the shell command wrapper. This declutters the core code and improves modular design. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Move table count resetTomas Pilar2020-06-301-3/+5
| | | | | | | | | | | The table count module level symbols are now reset when executing the core method, rather than the shell command wrapper. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Refactor configurationTomas Pilar2020-06-3012-315/+479
| | | | | | | | | | | | | | A new file and header (AcpiViewConfig.[ch]) is created that houses the user configuration. This declutters the core code and improves modularity of the design. The module level symbols for verbosity, table selection, and highlighting are refactored into the new file. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg/AcpiView: Move log reset to main methodTomas Pilar2020-06-301-4/+4
| | | | | | | | | | The error and warning counters are reset in the AcpiView main method. This improves reusability of the main method. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Tomas Pilar <tomas.pilar@arm.com>
* ShellPkg: Update timezone of 3 citiesDorapika Wu2020-06-181-6/+6
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2780 The timezone of following cities should be updated: Istanbul: UTC+3 Novosibirsk: UTC+7 Georgetown (Guyana): UTC-4 Signed-off-by: Dorapika Wu <chuan-hsun.wu@hpe.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: smbiosview - print field values as unsigned integersRebecca Cran2020-06-151-3/+3
| | | | | | | | | | | | This prevents overflow when printing DWORD fields such as the type 17 tables's extended DIMM size. Signed-off-by: Rebecca Cran <rebecca@bsdio.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Check if SBBR mandatory ACPI tables are installedKrzysztof Koch2020-05-062-0/+38
| | | | | | | | | | | | | | | | | | | | | For Arm-based platforms, count the instances of installed tables for each ACPI table listed as 'mandatory' in any Server Base Boot Requirements (SBBR) specification. Validate that the all the mandatory SBBR tables present. Report an error for each missing table. This new feature is optional and can be enabled with the -r command line parameter. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Add library for SBBR ACPI requirements validationKrzysztof Koch2020-05-063-1/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For Arm-based platforms, define and implement an interface for Server Base Boot Requirements (SBBR) compliance checks. The library is responsible for validating that all mandatory ACPI tables are installed on the platform. Internally, the library maintains a data structure which tracks instance counts for ACPI tables which are labeled as 'mandatory' in any SBBR specification version. The provided interface allows: - resetting all instance counts to 0 - incremementing the instance count for a table with a given signature - validating the instance counts against the requirements in SBBR The ACPI table requirements for each SBBR spec version are represented internally as a list of table signatures. Every missing mandatory table (for the input SBBR version) is reported to the user as a separate error. If all requirements are met, an info message is displayed. Reference(s): - Arm Server Base Boot Requirements 1.2, September 2019 - Arm Server Base Boot Requirements 1.1, May 2018 - Arm Server Base Boot Requirements 1.0, March 2016 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Add -r parameter for table requirements validationKrzysztof Koch2020-05-063-4/+136
| | | | | | | | | | | | | | | | | | | | | | | Define a new command line parameter '-r' to enable checking if all mandatory ACPI tables listed in a specification are present. The -r parameter takes an integer value to specify which specification the validation should be performed against. The parameter is used to set two Acpiview variables. An interface to access these variables is implemented in this patch. The new functionality is aimed at Arm-based platforms, however, there are no restriction on extending it to other architectures. For the 32-bit and 64-bit Arm architectures, the possible values for the -r parameter are: 0: Arm Server Base Boot Requirements 1.0, March 2016 1: Arm Server Base Boot Requirements 1.1, May 2018 2: Arm Server Base Boot Requirements 1.2, September 2019 Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: Fix 'ping' command Ip4 receive flow.Maciej Rabeda2020-04-011-4/+5
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2032 'ping' command's receive flow utilizes a single Rx token which it attempts to reuse before recycling the previously received packet. This causes a situation where under ICMP traffic, Ping6OnEchoReplyReceived() function will receive an already recycled packet with EFI_SUCCESS token status and finally dereference invalid pointers from RxData structure. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Maciej Rabeda <maciej.rabeda@linux.intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Acked-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Prevent infinite loop if structure length is 0Krzysztof Koch2020-02-206-52/+47
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2534 Extend validation of ACPI structure lengths which are read from the ACPI table being parsed. Additionally check if the structure 'Length' field value is positive. If not, stop parsing the faulting table. Some ACPI tables define internal structures of variable size. The 'Length' field inside the substructure is used to update a pointer used for table traversal. If the byte-length of the structure is equal to 0, acpiview can enter an infinite loop. This condition can occur if, for example, the zero-allocated ACPI table buffer is not fully populated. This is typically a bug on the ACPI table writer side. In short, this method helps acpiview recover gracefully from a zero-valued ACPI structure length. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Validate ACPI table 'Length' fieldKrzysztof Koch2020-02-191-1/+19
| | | | | | | | | | | | Check if the ACPI table length, as reported in the ACPI table header, is big enough to fit at least the header itself. If not, report an error to the user and stop parsing the table in order to prevent buffer overruns. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: Remove duplicate ACPI structure size definitionsKrzysztof Koch2020-02-192-25/+5
| | | | | | | | | | | | | | | | | | | | Remove duplicate Generic Address Structure (GAS) and ACPI table header size definitions. Replace any dependencies with the definitions from Acpi63.h. AcpiParser.h redefines the size of Generic Address Structure (GAS) and the ACPI table header. The motivation is to 'minimise any reference to the EDK2 ACPI headers in an attempt to provide cross checking'. While the redefined values are unlikely to change, redefinition causes unnecessary maintenance overhead for acpiview. In addition to this, EDK2 ACPI headers are referenced throughout the entire project, so the assumption should be that the definitions in these header files are correct. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: acpiview: DBG2: Validate global pointers before useKrzysztof Koch2020-02-111-0/+43
| | | | | | | Check if global (in the scope of the DBG2 parser) pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: GTDT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+37
| | | | | | | Check if global (in the scope of the GTDT parser) pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: IORT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+52
| | | | | | | Check if global (in the scope of the IORT parser) pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: PPTT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+25
| | | | | | | | Check if the NumberOfPrivateResources, ProcessorTopologyStructureType and ProcessorTopologyStructureLength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: MADT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+13
| | | | | | | | Check if the MadtInterruptControllerType and MadtInterruptControllerLength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: SRAT: Validate global pointers before useKrzysztof Koch2020-02-111-0/+13
| | | | | | | Check if SratRAType and SratRALength pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: SLIT: Validate System Locality countKrzysztof Koch2020-02-111-5/+42
| | | | | | | | | | | | | | | 1. Check if the 'Number of System Localities' provided can be represented in the SLIT table. The table 'Length' field is a 32-bit value while the 'Number of System Localities' field is 64-bit long. 2. Check if the SLIT matrix fits in the table buffer. If N is the SLIT locality count, then the matrix used to represent the localities is N*N bytes long. The ACPI table length must be big enough to fit the matrix. 3. Remove (now) redundant 64x64 bit multiplication. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: SLIT: Validate global pointer before useKrzysztof Koch2020-02-111-2/+14
| | | | | | | Check if SlitSystemLocalityCount pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: FADT: Validate global pointer before useKrzysztof Koch2020-02-111-10/+11
| | | | | | | Check if global pointers have been successfully updated before they are used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: RSDP: Validate global pointer before useKrzysztof Koch2020-02-111-0/+12
| | | | | | | Check if XsdtAddress pointer has been successfully updated before it is used for further table parsing. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg: acpiview: Set ItemPtr to NULL for unprocessed table fieldsKrzysztof Koch2020-02-111-1/+8
| | | | | | | | | | | | | | | | | | | | | | | For fields outside the buffer length provided, reset any pointers, which were supposed to be updated by a ParseAcpi() function call to NULL. This way one can easily validate if a pointer was successfully updated. The ParseAcpi() function parses the given ACPI table buffer by a number of bytes which is a minimum of the buffer length and the length described by ACPI_PARSER array. If the buffer length is shorter than the array describing how to process the ACPI structure, then it is possible that the ItemPtr inside ACPI_PARSER may not get updated or initialized. This can lead to an error if the value pointed to by ItemPtr is later used to control the parsing logic. A typical example would be a 'number of elements' field in an ACPI structure header which defines how many substructures of a given type are present in the structure body. If the 'number of elements' field is not parsed, we will have a dangling pointer which could cause a problem later. Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg/UefiShellAcpiViewCommandLib: Fix FADT ParserAshish Singhal2020-02-111-1/+1
| | | | | | | | | FADT parser was checking for reduced ACPI flag incorrectly leading to incorrect error message if FIRMWARE_CTRL and X_FIRMWARE_CTRL are both 0. Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Ashish Singhal <ashishsingha@nvidia.com>
* ShellPkg: acpiview: Update SRAT parser to ACPI 6.3Krzysztof Koch2020-01-153-6/+252
| | | | | | | | | | | | | | | | Add support for revision 3 of System Resource Affinity Table (SRAT). Decode and dump the new Generic Initiator Affinity Structure. Validate the Device Handle Type field inside the Generic Initiator Affinity Structure. Reviewed-by: Alexei Fedorov <Alexei.Fedorov@arm.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Tested-by: Sudipto Paul <sudipto.paul@arm.com> Signed-off-by: Krzysztof Koch <krzysztof.koch@arm.com>
* ShellPkg/UefiHandleParsingLib: Fix error allocate poolZhichao Gao2019-12-051-4/+8
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1965 For function InsertNewGuidNameMapping, it rellocate the mGuidList with new size "mGuidListCount+1 * sizeof(GUID_INFO_BLOCK)". That isn't its purpose and would cause a overflow operation in "mGuidList[mGuidListCount - 1].xxx = xxx". Its purpose is to increase 1 block size of mGuidList. Change it to "(mGuidListCount + 1) * sizeof (GUID_INFO_BLOCK)". Adjust the coding style of this function. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Andrew Fish <afish@apple.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/edit: typo "%d Lines Wrote"Heinrich Schuchardt2019-12-052-2/+2
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2379 When a file is saved in the edit command a status message L"%d Lines Wrote" is displayed. The hexedit command suffers from the same typo. Change the message to L"%d Lines Written". Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
* ShellPkg: acpiview: IORT Spec Rev D updatesSami Mujawar2019-12-051-4/+9
| | | | | | | | | | | | | | | | Updated IORT parser to conform to the IO Remapping Table, Platform Design Document, Revision D, March 2018. The following structure parsers have been updated: 1. SMMUv3 - added proximity domain and device Id mapping index. 2. RootComplex - added memory address size limit. 2. PMCG - added page 1 support. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg: acpiview: Add support for parsing FACSSami Mujawar2019-12-055-5/+179
| | | | | | | | | | | | | | | | | | Add support for parsing the ACPI FACS table. The FADT parser has also been updated as it links the FACS table using the FIRMWARE_CTRL or X_FIRMWARE_CTRL fields. Since the FACS table does not follow the standard ACPI header, the FADT parser extracts the FACS signature, length and version fields before invoking the FACS parser. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Sami Mujawar <sami.mujawar@arm.com>
* ShellPkg/SmbiosView: SMBIOS 3.3.0 Update "Intel persistent memory"Gao, Zhichao2019-11-141-2/+2
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2305 Memory Device (Type 17): - SMBIOSCR00179: update the string for Intel persistent memory Cc: Ray Ni <ray.ni@intel.com> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/SmbiosView: SMBIOS 3.3.0 Add value HBM and Die for type 17Gao, Zhichao2019-11-141-0/+12
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2305 Memory Device (Type 17): - SMBIOSCR00178: add new memory device type value (HBM) and new form factor value (Die) Cc: Ray Ni <ray.ni@intel.com> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/SmbiosView: SMBIOS 3.3.0 add support for CXL FlexbusGao, Zhichao2019-11-141-0/+8
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2305 Various: - SMBIOSCR00183: add support for CXL Flexbus Cc: Ray Ni <ray.ni@intel.com> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/SmbiosView: SMBIOS 3.3.0 add PCI gen4 values for type 9Gao, Zhichao2019-11-142-2/+28
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2305 System Slots (Type 9): - SMBIOSCR00184: add PCI Express Gen 4 values Add the SmBios.h to use the MARCOs or enums. Cc: Ray Ni <ray.ni@intel.com> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/CommandLib: Use first found UC for unsupported PlatformLangMarvin H?user2019-11-081-1/+5
| | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2300 On some firmwares PlatformLang is set to the local language (e.g. ru-RU), however there is no Unicode Collation protocol instance that supports it. As for missing PlatformLang, fall back to the first found instance. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de>
* ShellPkg/Ls: Return empty content for all empty foldersMarvin Haeuser2019-11-041-5/+28
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2296 Currently, when 'ls' is run on an entirely empty directory (this includes not having '.' and '..'), the output is always 'File not found'. For when not filtering its children, this patch rather displays the usual header and footer. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/Ls: Consider UEFI timezone may not be setMarvin Haeuser2019-11-041-1/+1
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2294 EFI_RUNTIME_SERVICES.GetTime() might return an unspecified Timezone, such as when SetTime() has not been called after the RTC was cut off power. Consider this case by not attempting Timezone translations for when it is invalid. Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/UefiShellDebug1CommandsLib: Update to support SmBios 3.3.0Abner Chang2019-10-175-5/+100
| | | | | | | | | | | | | | | | Shell command smbiosview updates for SMBIOS 3.3.0 spec. Bugzilla link, https://bugzilla.tianocore.org/show_bug.cgi?id=2202 Signed-off-by: Abner Chang <abner.chang@hpe.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Leif Lindholm <leif.lindholm@linaro.org> Cc: Gilbert Chen <gilbert.chen@hpe.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg/UefiShellLib: clarify workaround for unfixable EdkShell bugLaszlo Ersek2019-10-091-2/+20
| | | | | | | | | | | | | | | | | | | The EDK 1 Shell (available at <https://github.com/tianocore/edk-Shell>) has a bug in its EFI_SHELL_ENVIRONMENT2.Execute() implementation that edk2's UefiShellLib has no choice but to work around. Improve the explanation in the code. Also, document the implicit EFI_HANDLE -> (EFI_HANDLE*) conversion, which happens implicitly after dereferencing ParentHandle, with an explicit cast. In practice, this patch is a no-op. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com>
* ShellPkg/UefiShellDebug1CommandsLib: fix ShellCloseFile() callLaszlo Ersek2019-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | In the FileBufferSave() function, we invoke ShellCloseFile() if "Directory Can Not Be Saved". The ShellCloseFile() function takes a (SHELL_FILE_HANDLE*) parameter called "FileHandle", and correctly passes the de-referenced (*FileHandle) to EFI_SHELL_CLOSE_FILE, which takes a SHELL_FILE_HANDLE. However, FileBufferSave() passes SHELL_FILE_HANDLE to ShellCloseFile(), not the expected (SHELL_FILE_HANDLE*). Correct it. This fixes an actual bug that has remained hidden for two reasons: - pointer-to-VOID converts from/to any pointer-to-object type silently, - the bug is on an error path which has likely never fired in practice. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: stop taking EFI_HANDLE in place of SHELL_FILE_HANDLELaszlo Ersek2019-10-092-2/+2
| | | | | | | | | | | | | | | | | | The TouchFileByHandle() and IsDirectoryEmpty() functions are passed SHELL_FILE_HANDLE parameters, and they use those parameters correctly. However, their parameter lists say EFI_HANDLE. Spell out the right type in the parameter lists. In practice, this change is a no-op (because, quite regrettably, both EFI_HANDLE and SHELL_FILE_HANDLE are specified to be typedefs of (VOID*)). Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
* ShellPkg: stop using EFI_HANDLE in place of EFI_HII_HANDLELaszlo Ersek2019-10-0919-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The UefiShell*CommandsLib instances have constructor functions that do something like: gHiiHandle = HiiAddPackages (...); ... ShellCommandRegisterCommandName (..., gHiiHandle, ...); and destructor functions that implement the following pattern: HiiRemovePackages (gHiiHandle); The -- semantic, not functional -- problem is that "gHiiHandle" is declared with type EFI_HANDLE, and not EFI_HII_HANDLE, in all of these library instances, even though HiiAddPackages() correctly returns EFI_HII_HANDLE, and HiiRemovePackages() takes EFI_HII_HANDLE. Once we fix the type of "gHiiHandle", it causes sort of a butterfly effect, because it is passed around widely. Track down and update all of those locations. The DynamicCommand lib instances use a similar pattern, so they are affected too. NOTE: in practice, this patch is a no-op, as both EFI_HII_HANDLE and EFI_HANDLE are typedefs to (VOID*). However, we shouldn't use EFI_HANDLE where semantically EFI_HII_HANDLE is passed around. Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>