summaryrefslogtreecommitdiff
path: root/MdePkg
AgeCommit message (Collapse)Author
2017-04-01MdePkg/Shell.h: Update Shell version from 2.1 to 2.2Ruiyu Ni
All the Shell 2.2 features are implemented except DMEM/MM changes which are pending on spec change. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Kinney D Michael <kinney.d.michael@intel.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-30MdePkg/UefiDevicePathLib: Refine the DevPathFromTextiSCSI protocol parsingJiaxin Wu
For current iSCSI protocol parsing, UINT16 truncation may be happened. Since the Spec already have declaimed that 0 is TCP Protocol and 1+ is reserved, the parsing can be refined as below: if (StrCmp (ProtocolStr, L"TCP") == 0) { ISCSIDevPath->NetworkProtocol = 0; } else { // // Undefined and reserved. // ISCSIDevPath->NetworkProtocol = 1; } Cc: Warner Losh <imp@bsdimp.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Warner Losh <imp@bsdimp.com>
2017-03-23MdePkg/DevicePathLib: Fix FromText bug for multi-instance devicepathRuiyu Ni
UefiDevicePathLibConvertTextToDevicePath correctly detects when it has hit a ',' splicing together multiple paths. However, the code that tries to cope with it: {code} if (IsInstanceEnd) { DeviceNode = (EFI_DEVICE_PATH_PROTOCOL *) AllocatePool ( END_DEVICE_PATH_LENGTH); ASSERT (DeviceNode != NULL); SetDevicePathEndNode (DeviceNode); NewDevicePath = AppendDevicePathNode (DevicePath, DeviceNode); FreePool (DevicePath); FreePool (DeviceNode); DevicePath = NewDevicePath; } {code} causes a problem. The END node that's appended it the node for the entire list. So when the node is appended in AppendDevicePathNode, it winds up disappearing. This leads to the path 'PciRoot(0x0),PciRoot(0x0)' parsing as if 'PciRoot(0x0)/PciRoot(0x0)' were specified. These are two very different things. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Warner Losh <imp@bsdimp.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2017-03-15MdePkg/UefiDevicePathLib: Fix the wrong MAC address lengthJiaxin Wu
Network interface type should be checked before the conversion between text device path node and MAC device path. Otherwise, the MAC text string can't be converted to the representation of a device node, which leads to the series failure of network HII configuration(e.g. IP, VLAN, HTTP Boot configuration in Network Device List). Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
2017-03-15MdePkg/HiiImageEx: Fix incorrect comments of functionsDandan Bi
https://bugzilla.tianocore.org/show_bug.cgi?id=383 Cc: Liming Gao <liming.gao@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Eric Dong <eric.dong@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-13MdePkg/SmiHandlerProfile: Add Context support in UnregisterJiewen Yao
The reason is that we observe that a platform may use same Handler for different context. In order to support Unregister such handler, we have to input context information as well. Cc: Jeff Fan <jeff.fan@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Feng Tian <feng.tian@intel.com>
2017-03-13MdePkg/BasePrintLib: Refine the comment for AsciiValueToStringS APIHao Wu
The commit refines the comment description for PrintLib API AsciiValueToStringS. This API will not ASSERT when the input/output parameter 'Buffer' is not aligned on a 16-bit boundary. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-10MdePkg/Pci22.h: Remove deprecated macrosRuiyu Ni
The following deprecated macros are removed.The removal doesn't cause any build failure to existing packages. #define DEVICE_ID_NOCARE 0xFFFF #define PCI_BAR_OLD_ALIGN 0xFFFFFFFFFFFFFFFFULL #define PCI_BAR_EVEN_ALIGN 0xFFFFFFFFFFFFFFFEULL #define PCI_BAR_SQUAD_ALIGN 0xFFFFFFFFFFFFFFFDULL #define PCI_BAR_DQUAD_ALIGN 0xFFFFFFFFFFFFFFFCULL #define PCI_BAR_ALL 0xFF #define PCI_ACPI_UNUSED 0 #define PCI_BAR_NOCHANGE 0 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-07MdePkg/SafeString.c: Fix code to be more readableRuiyu Ni
The change doesn't impact the functionality. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com>
2017-03-06MdePkg/ProcessorBind: add defines for page allocation granularityArd Biesheuvel
The UEFI spec differs between architectures in the minimum alignment and granularity of page allocations that are visible to the OS as EFI_MEMORY_RUNTIME regions. So define macros that carry these values to the respective ProcessorBind.h header files. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-03-06MdePkg: Refine casting expression result to bigger sizeHao Wu
There are cases that the operands of an expression are all with rank less than UINT64/INT64 and the result of the expression is explicitly cast to UINT64/INT64 to fit the target size. An example will be: UINT32 a,b; // a and b can be any unsigned int type with rank less than UINT64, like // UINT8, UINT16, etc. UINT64 c; c = (UINT64) (a + b); Some static code checkers may warn that the expression result might overflow within the rank of "int" (integer promotions) and the result is then cast to a bigger size. The commit refines codes by the following rules: 1). When the expression is possible to overflow the range of unsigned int/ int: c = (UINT64)a + b; 2). When the expression will not overflow within the rank of "int", remove the explicit type casts: c = a + b; 3). When the expression will be cast to pointer of possible greater size: UINT32 a,b; VOID *c; c = (VOID *)(UINTN)(a + b); --> c = (VOID *)((UINTN)a + b); 4). When one side of a comparison expression contains only operands with rank less than UINT32: UINT8 a; UINT16 b; UINTN c; if ((UINTN)(a + b) > c) {...} --> if (((UINT32)a + b) > c) {...} For rule 4), if we remove the 'UINTN' type cast like: if (a + b > c) {...} The VS compiler will complain with warning C4018 (signed/unsigned mismatch, level 3 warning) due to promoting 'a + b' to type 'int'. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
2017-03-02MdePkg/BasePrintLib: Add deprecated flag for APIs [A|U]ValueToStringHao Wu
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-28MdePkg/UefiDevicePathLib: Use BaseLib string conversion servicesRuiyu Ni
Update UefiDevicePathLib to use StrToGuid/StrHexToBytes /StrToIpv4Address/StrToIpv6Address provided by BaseLib. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-28MdePkg/BaseLib: Add AsciiStrToGuid/HexToBytes/ToIpv[4/6]AddressRuiyu Ni
The patch adds 4 APIs to convert ASCII string to GUID, bytes buffer, IP v4 address and IP v6 address. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com>
2017-02-28MdePkg/BaseLib: Add StrToGuid/StrHexToBytes/StrToIpv[4/6]AddressRuiyu Ni
The patch adds 4 APIs to convert Unicode string to GUID, bytes buffer, IP v4 address and IP v6 address. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com>
2017-02-28MdePkg/UefiDevicePathLib: Rename StrToGuid to avoid link failureRuiyu Ni
Since the next patch will add StrToGuid in BaseLib, renaming the internal function StrToGuid to DevicePathLibStrToGuid to avoid link failure. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-28MdePkg: Define IPv4_ADDRESS and IPv6_ADDRESS in Base.hRuiyu Ni
Since the following patch needs to add API converting string to IP address in BaseLib, define the IP address as base types in Base.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-22MdePkg/dsc: add SmiHandlerProfileLib to dsc.Jiewen Yao
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-22MdePkg/SmiHandlerProfileLibNull: Add NULL instance.Jiewen Yao
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-22MdePkg/Include: Add SmiHandlerProfileLib.hJiewen Yao
This library should be linked by SmmChildDispatch to report the hardware SMI handler maintained by SmmChildDispatch. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-21MdePkg/BasePrintLib: Add safe print functions [A|U]ValueToStringSHao Wu
Add the following 2 APIs: UnicodeValueToStringS AsciiValueToStringS These safe version APIs are used to enhance their counterpart (APIs without trailing 'S' in function names). They perform checks to the input parameters and will return relative status to reflect the check result. Return RETURN_INVALID_PARAMETER when: 1). The input Buffer is NULL. 2). The input BufferSize is greater than (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for UnicodeValueToStringS or greater than PcdMaximumAsciiStringLength for AsciiValueToStringS. 3). The input Flags is not set properly. 4). The input Width is not smaller than MAXIMUM_VALUE_CHARACTERS. Return RETURN_BUFFER_TOO_SMALL when: 1). The input BufferSize cannot hold the converted value. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-21MdePkg/BasePrintLib: Refine the SPrint functionsHao Wu
For the following 12 APIs in MdePkg/BasePrintLib: UnicodeVSPrint UnicodeBSPrint UnicodeSPrint UnicodeVSPrintAsciiFormat UnicodeBSPrintAsciiFormat UnicodeSPrintAsciiFormat AsciiVSPrint AsciiBSPrint AsciiSPrint AsciiVSPrintUnicodeFormat AsciiBSPrintUnicodeFormat AsciiSPrintUnicodeFormat They will ASSERT when: 1) The input parameter 'StartOfBuffer' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 2) The input parameter 'FormatString' is NULL if 'BufferSize' indicates at least 1 Ascii/Unicode character can be held. 3) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. 4) The produced string contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. This commits removes the ASSERT case 4) and add the following new ASSERT case: 4) The input parameter 'BufferSize' is greater than (PcdMaximumAsciiStringLength * sizeof (CHAR8)) for Ascii format string or (PcdMaximumUnicodeStringLength * sizeof (CHAR16) + 1) for Unicode format string. And for those ASSERT cases, 0 will be returned by those 12 APIs. For the following 2 APIs in MdePkg/BasePrintLib: SPrintLength SPrintLengthAsciiFormat They will ASSERT when: 1) The input parameter 'FormatString' is NULL. 2) The input parameter 'FormatString' contains more than PcdMaximum[Ascii|Unicode]StringLength Ascii/Unicode characters. And for those ASSERT cases, 0 will be returned by those 2 APIs. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-02-15MdePkg/BaseLib: Refine logic for (Ascii)StrnLenS to handle MaxSize = 0Hao Wu
https://bugzilla.tianocore.org/show_bug.cgi?id=378 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-02-14MdePkg ACPI: Incorrect definition name for ACPI IORT Table signatureStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=363 The definition name for ACPI IO Remapping Table signature is incorrect in Acpi60.h and Acpi61.h as below: EFI_ACPI_6_0_INTERRUPT_SOURCE_OVERRIDE_SIGNATURE EFI_ACPI_6_1_INTERRUPT_SOURCE_OVERRIDE_SIGNATURE The name should be changed to EFI_ACPI_6_0_IO_REMAPPING_TABLE_SIGNATURE EFI_ACPI_6_1_IO_REMAPPING_TABLE_SIGNATURE The comments /// /// "IORT" Interrupt Source Override /// will be also changed to /// /// "IORT" I/O Remapping Table /// Cc: Alexei Fedorov <Alexei.Fedorov@arm.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-02-10MdePkg/Pci22.h: Deprecate out-of-Spec IncompatiblePciDevice macrosRuiyu Ni
DEVICE_ID_NOCARE is defined as 0xFFFF but Spec says (UINT64) -1 should be used to match any VendorId/DeviceId/RevisionId/ SubsystemVendorId/SubsystemDeviceId. PCI_BAR_OLD_ALIGN/PCI_BAR_EVEN_ALIGN/PCI_BAR_SQUAD_ALIGN/ PCI_BAR_DQUAD_ALIGN are defined but Spec doesn't have such definitions. PCI_BAR_ALL is defined as 0xFF but Spec says (UINT64)-1 should be used to match all BARs. PCI_ACPI_UNUSED and PCI_BAR_NOCHANGE are defined as 0 which compliant with Spec but the name is too general and causes confusing. IncompatiblePciDeviceSupport could directly use 0. All of the above macros are marked as deprecated. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Cc: Jeff Fan <jeff.fan@intel.com>
2017-02-06MdePkg: UefiTcgPlatform.h: Add TCG_PCR_EVENT2_HDR definitionZhang, Chao B
Add TCG_PCR_EVENT2_HDR definition. Follow TCG EFI Spec 2.0 00.13 Section 5.2 Crypto Agile Log Entry Format https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf Cc: Long Qin <qin.long@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com>
2017-01-25MdePkg: UefiTcgPlatform.h: Add UEFI_VARIABLE_DATAZhang, Chao B
Add UEFI_VARIABLE_DATA according to TCG PC-Client PFP Spec 00.21. http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
2017-01-24MdePkg: Add definitions for SMBIOS spec 3.1.1Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=349 This patch is to add definitions for below items. Processor Information (Type 4): - add socket SP3r2 - add AMD Zen Processor Family Management Controller Host Interface (Type 42): - include Host Interface Type and Protocol Identifier enumerations Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-24MdePkg : UefiTcgPlatform.h: Define Startup Locality Event & IndicatorZhang, Chao B
Add Startup Locality Event definition according to PC Client PFP 00.21 http://www.trustedcomputinggroup.org/wp-content/uploads/PC-ClientSpecific_Platform_Profile_for_TPM_2p0_Systems_v21.pdf Add Locality Indicator definition according to PC Client PTP 00.43 https://www.trustedcomputinggroup.org/wp-content/uploads/PC-Client-Specific-Platform-TPM-Profile-for-TPM-2-0-v43-150126.pdf Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
2017-01-22MdePkg: Add definitions for SMBIOS spec 3.1.0Star Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=340 TPM Device (Type 43) definition has been added at 713e4b007cb791829397522ad8f366dd1e08bee6. This patch is to add definitions for below items. • BIOS Information (Type 0): – Add new entry for extended BIOS ROM size • System Enclosure or Chassis (Type 3): – Add new chassis types: IoT Gateway and Embedded PC – Add new chassis types: Mini PC and Stick PC • Processor Information (Type 4): – Add Intel Core m3 m5 m7 processors – Add processor socket AM4 – Add processor socket LGA1151 – Add processor socket BGA1356, BGA1440, BGA1515 – Add AMD Opteron A-Series processor – Add processor socket LGA3647-1 – Add processor socket SP3 Processors – Add families for ARMv7 and ARMv8 – Add family for AMD Opteron(TM) X3000 Series APU • Cache Information (Type 7): – Extend to support Cache sizes >2047 MB • System Slots (Type 9): – Add Mini PCIe support Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-20MdePkg UefiLib: Make the event empty function publicStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=298 Then this event empty function can be used to remove the duplication in drivers and other libraries. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-20MdePkg: Avoid Non-Boolean type used as BooleanDandan Bi
Cc: Brijesh Singh <brijesh.singh@amd.com> Cc: Leo Duran <leo.duran@amd.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-20MdePkg DxeHobLib: Make GetHobList working before Constructor is calledStar Zeng
The latest PiSmmCore driver added several debug messages in the function SmmAddMemoryRegion in Page.c. The function SmmAddMemoryRegion is called by the library constructor PiSmmCoreMemoryAllocationLibConstructor. When PiSmmCoreMemoryAllocationLibConstructor is executed, the constructor of DxeHobLib (HobLibConstructor in HobLib.c) is not executed yet. But platform instance of DebugLib may need get hob before printing any message. As a result, an ASSERT happens in the function GetHobList. The patch is to update GetHobList to get HOB list from system configuration table when the HOB list is not retrieved and not cached yet, and HobLibConstructor is also to be updated to just call GetHobList. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Amy Chan <amy.chan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-18MdePkg: Correct comments of macros FixedPcdGetX/PatchPcdXXX in PcdLib.hStar Zeng
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=311 The patch is also to refine comments of macros PcdToken and PcdTokenEx. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-17MdePkg/SmmIoLibSmmCpuIo2: Add new Fifo routines in IoLib classLeo Duran
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-01-17MdePkg/DxeIoLibEsal: Add new Fifo routines in IoLib classLeo Duran
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-17MdePkg/PeiIoLibCpuIo: Add new Fifo routines in IoLib classLeo Duran
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-01-17MdePkg/DxeIoLibCpuIo2: Add new Fifo routines in IoLib classLeo Duran
Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-01-17MdePkg: Expand BaseIoLibIntrinsic (IoLib class) libraryLeo Duran
The UefiCpuPkg/CpuIo2Dxe driver and the QemuCfgLib library have duplicate implementations of I/O Fifo routines. This patch clones the I/O Fifo routines into the BaseIoLibIntrinsic library and expands the IoLib class to include the ported I/O Fifo routines. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Brijesh Singh <brijesh.singh@amd.com> Signed-off-by: Leo Duran <leo.duran@amd.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2017-01-12MdePkg/UefiFileHandleLib: Refine the check for valid Ascii characterHao Wu
The commit will check if bit 7 is set of an Ascii character to judge its validity. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-12MdePkg: Add comments for SMBIOS Type 3 structure to cover SKU NumberChris Phillips
Starting with SMBIOS spec version 2.7, Type 3 added SKU Number. SKU Number is at a variable offset (depends on count and length of Contained Elements), so cannot add SKU Number to the SMBIOS_TABLE_TYPE3 structure. Adding comments to explain how to get SKU Number. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chris Phillips <chrisp@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-01-12MdePkg/SmBios.h: Add new defines for SMBIOS record type 43Linson Augustine
Added definitions for the new SMBIOS Type 43 record. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Augustine Linson P <linson.augustine@hpe.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
2017-01-11MdePkg: Tpm2Acpi.h: Fix incompatible changeZhang, Chao B
Fix incompatible change. Some modules are still referencing old definition. Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
2017-01-10MdePkg/Include: Add include file to FileHandleLib.hMichael Kinney
FileHandleLib.h uses the data type EFI_FILE_INFO, so this library class should include <Guid/FileInfo.h>. Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2017-01-10MdePkg: Tpm2Acpi.h: Update TPM2 ACPI table versionZhang, Chao B
Update TPM2 ACPI Table revision to 4. New version & data structure is defined in TCG ACPI Spec 00.37 Cc: Star Zeng <star.zeng@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
2017-01-09MdePkg/BaseLib: Add safe string functions [U|A]StrnTo[A|U]StrSHao Wu
Add the following 2 APIs: UnicodeStrnToAsciiStrS AsciiStrnToUnicodeStrS These APIs are used to enhance APIs UnicodeStrToAsciiStrS and AsciiStrToUnicodeStrS (without 'n' in names) by: 1. Adds an input parameter 'Length' to specify the maximum number of Ascii/Unicode characters to convert. 2. Adds an output parameter 'DestinationLength' to indicate the number of Ascii/Unicode characters successfully converted. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-01-09MdePkg/BaseLib: Enhance the return value for string to uint functionsHao Wu
For the following 8 APIs in MdePkg/BaseLib: [Ascii]StrDecimalToUintn [Ascii]StrDecimalToUint64 [Ascii]StrHexToUintn [Ascii]StrHexToUint64 They will ASSERT for DEBUG build when the input string exceeds the range of UINTN/UINT64. However, for RELEASE build, incorrect value will be returned. This commit refines those APIs to direcly call their enhanced counterparts (with trailing 'S' in API names) so as to remove those exceed-range ASSERT checks and to make those APIs to return MAX_UINTN/MAX_UINT64 instead. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-01-09MdePkg/BaseLib: Add safe string functions that convert str to valueHao Wu
Add the following 8 APIs: [Ascii]StrDecimalToUintnS [Ascii]StrDecimalToUint64S [Ascii]StrHexToUintnS [Ascii]StrHexToUint64S These safe version APIs are used to enhance their counterpart (APIs without trailing 'S' in function names). These safe version APIs perform checks to the input string and will return relative status to reflect the check result: When the input string exceeds the range of UINTN/64, these APIs will return RETURN_UNSUPPORTED and store MAX_UINTN/64 in the output data. When no conversion can be performed for the input string, these APIs will return RETURN_SUCCESS and store 0 in the output data. The optional parameter 'EndPointer', if provided, will point to the character that stopped the scan. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-01-09MdePkg/BaseLib: Add safe string functions [Ascii]StrnSizeSHao Wu
Add StrnSizeS() and AsciiStrnSizeS() APIs. These 2 safe version APIs are used to replace StrSize() and AsciiStrSize(). Those two APIs use similar checks as [Ascii]StrnLenS(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2017-01-06MdePkg, NetworkPkg: Refine the coding style.Jiaxin Wu
Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>