summaryrefslogtreecommitdiff
path: root/MdePkg
AgeCommit message (Collapse)AuthorFilesLines
2017-02-15MdePkg/BaseLib: Refine logic for (Ascii)StrnLenS to handle MaxSize = 0Hao Wu1-4/+4
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 Zeng2-6/+6
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 Ni1-9/+18
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 B1-0/+11
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 B1-0/+17
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 Zeng1-2/+23
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 B1-1/+28
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 Zeng1-4/+42
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 Zeng4-47/+43
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 Bi3-13/+12
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 Zeng1-33/+34
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 Zeng1-22/+22
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 Duran1-0/+216
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 Duran1-2/+276
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 Duran1-0/+261
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 Duran2-11/+320
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 Duran9-1/+1229
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 Wu1-2/+2
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 Phillips1-0/+11
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 Augustine1-1/+18
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 B1-2/+5
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 Kinney1-1/+2
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 B1-3/+5
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 Wu2-0/+344
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 Wu2-325/+25
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 Wu3-5/+1598
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 Wu2-2/+145
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 Wu1-5/+5
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>
2017-01-03MdePkg, MdeModulePkg: S3BootScriptSaveMemPoll(): accept 64-bit LoopTimesLaszlo Ersek2-2/+2
The BaseNull instance of S3BootScriptLib obviously doesn't care about the type of the S3BootScriptSaveMemPoll() function's LoopTimes parameter; this lib instance doesn't do anything with the parameters received in S3BootScriptSaveMemPoll(). The PiDxe instance saves the LoopTimes parameter in EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This target field already has UINT64 type. Furthermore, the BootScriptExecuteMemPoll() function in the same library instance already uses a local UINT64 variable called LoopTimes to count up to EFI_BOOT_SCRIPT_MEM_POLL.LoopTimes. This means that the the UINTN type for S3BootScriptSaveMemPoll()'s LoopTimes parameter is an unnecessary restriction. The callers of S3BootScriptSaveMemPoll() will be updated in the next patches, functionally. At this stage, they will continue to compile, since UINT64 parameters can accept UINTN arguments. Cc: Feng Tian <feng.tian@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Star Zeng <star.zeng@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: "Yao, Jiewen" <jiewen.yao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2016-12-29MdePkg/BaseLib: Fix PathCleanUpDirectories to correctly handle "\.\"Ruiyu Ni1-35/+25
The old code incorrectly cleans path like "fs0:\abc\.\.." to "fs0:\abc", instead of "fs0:\" The patch fixes this bug. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chen A Chen <chen.a.chen@intel.com> Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-12-22MdePkg: Add a header to standardize TLS definitionsJiaxin Wu1-0/+93
This path is used to standardize TLS definitions from related RFCs. Including TLS Cipher Suites, TLS Version, TLS Content Type and TLS Record Header, etc. Cc: Long Qin <qin.long@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Thomas Palmer <thomas.palmer@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Qin Long <qin.long@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-12-22MdePkg: Add TLS related protocol definitionJiaxin Wu3-0/+601
This patch is used to add Tls.h and TlsConfig.h header files to define EFI TLS Configuration Protocol, EFI TLS Service Binding Protocol and EFI TLS Configuration Protocol. Cc: Long Qin <qin.long@intel.com> Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Zhang Lubo <lubo.zhang@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Thomas Palmer <thomas.palmer@hpe.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com> Reviewed-by: Qin Long <qin.long@intel.com> Reviewed-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Ye Ting <ting.ye@intel.com>
2016-12-22MdePkg/MemoryLib: Refine InternalMemSetMem16|32|64 functions logicHao Wu3-27/+27
This commit refines the logic for InternalMemSetMem16|32|64 functions. It avoids using the decrement operator '--' for array index to prevent possible mis-reports by static code checkers. Please note that those modified functions are only consumed within MemoryLib by APIs SetMem16|32|64, and those APIs will handle the case when the input number of bytes to set is 0. Hence, the behavior of APIs SetMem16|32|64 is not changed. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2016-12-22MdePkg/BaseLib: Add an additional check within (Ascii)StrnCmpHao Wu1-1/+3
This commit adds an addtional check in AsciiStrnCmp and StrnCmp. It explicitly checks the end of the sting pointed by 'SecondString' to make the code logic easier for reading and to prevent possible mis-reports by static code checkers. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2016-12-22MdePkg/BaseLib: Refine (Ascii)StrnLenS functions logicHao Wu1-4/+12
This commit refines the logic for AsciiStrnLenS and StrnLenS. It makes the logic more straightforward to prevent possible mis-reports by static code checkers. 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>
2016-11-28MdePkg IndustryStandard: Add DDR3, DDR4 and LPDDR definition per SPD specLiming Gao4-11/+2221
https://bugzilla.tianocore.org/show_bug.cgi?id=201 In V3, Use Odt to replace ODT, Cke to replace CKE, Id to replace ID, and Cl to replace CL in structure field name. In V2, separate DDR3, DDR4 and LPDDR definition into the different files; use the different SPD prefix as structure definitions for each SPD type. Cc: Giri P Mudusuru <giri.p.mudusuru@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
2016-11-23MdeModulePkg/EbcDxe: reorganize EBC header definitionsPete Batard1-0/+161
VM related defs are now in EbcVmTest.h, and opocode related definitions in Ebc.h. Because it is used by both the EBC Debugger and driver, EbcDebugSignalException() sees its definition factorized in EbcDebuggerHook.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
2016-11-21MdePkg BaseLib: API PathRemoveLastItem not handle root paths properlyHao Wu2-6/+6
https://bugzilla.tianocore.org/show_bug.cgi?id=239 When the input path for API PathRemoveLastItem() is a root path like 'fs0:\', the API will return TRUE (indicating a directory or file was removed from the path) and modifies the path to 'fs0:'. In fact, there's no directory or file removed in the above case. This commit adds additional check to resolve this issue and modifies the API's description to make it more straightforward. Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hao Wu <hao.a.wu@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-11-18MdePkg Base.h: Add add comments on __ prefix in enum VERIFY_UINTXX_ENUM_SIZELiming Gao1-0/+7
Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
2016-11-17MdePkg/BaseSynchronizationLib: Fix function names in function headersMichael Kinney10-10/+10
Some of the function names in function header comment blocks in assembly files do not match the symbol name in the assembly sources. Update function header comment blocks to match symbol name. Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Andrew Fish <afish@apple.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-17MdePkg/BaseSynchronizationLib: Add volatile Interlocked*() APIsMichael Kinney33-86/+86
The SpinLock functions in the SynchronicationLib use volatile parameters to keep compiler from optimizing these functions too much. The volatile keyword is missing from the Interlocked*() functions in this same library instance. Update the library instance to consistently use volatile on all functions in the SynchronizationLib class. Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Andrew Fish <afish@apple.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-17MdePkg/Include: Add volatile to SynchronizationLib parametersMichael Kinney1-7/+7
The SpinLock functions in the SynchronicationLib use volatile parameters to keep compiler from optimizing these functions too much. The volatile keyword is missing from the Interlocked*() functions in this same library class. Update the library class to consistently use volatile on all functions in this class. Cc: Liming Gao <liming.gao@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Cc: Andrew Fish <afish@apple.com> Cc: Jeff Fan <jeff.fan@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-17MdePkg/BaseMemoryLib: Fix VS2015 build errorMichael Kinney1-4/+4
https://bugzilla.tianocore.org/show_bug.cgi?id=237 Make the smallest change possible to workaround a VS2015 build error. The change is to the loop that handles the case where neither the source nor the destination are 64-bit or 32-bit aligned and the logic falls through to a loop that performs the copy as bytes. Only the loop that copies bytes backwards needs to be updated to avoid the VS2015 build error. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: 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>
2016-11-17MdePkg HobLib: Check FV alignment when building FV HOBStar Zeng4-4/+78
If the FvImage buffer is not at its required alignment, then ASSERT(). Also update the function header description of BuildFv(2)Hob() correspondingly. Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=205 Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D 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> Reviewed-by: Liming Gao <liming.gao@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
2016-11-16MdePkg/BaseLib: Add one wrapper on RdRand access for parameter check.Qin Long9-61/+188
Add one wrapper implementation over assembly RdRand access to check possible NULL parameter, for better alignment with comment description. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qin Long <qin.long@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2016-11-14MdePkg: Fix spec mismatch in string representation of EMMC dev nodeFeng Tian2-2/+2
Cc: Eric Jin <eric.jin@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Feng Tian <feng.tian@intel.com> Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
2016-11-09MdePkg UefiDevicePathLib: Validate before touch input buffer.Eric Dong1-5/+21
Current code not validate the input buffer before touch. it may touch the buffer outside the validate scope. This patch validate the input size big enough to touch the first node. Cc: Ruiyu NI <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com>
2016-11-09MdePkg UefiDevicePathLib: Rollback former change.Eric Dong1-16/+6
Former patch still has some bugs, so rollback it and enhance the original code. Cc: Ruiyu NI <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com>
2016-11-09MdePkg DevicePathLib: Validate before touch input buffer.Eric Dong1-5/+21
Current code not validate the input buffer before touch. it may touch the buffer outside the validate scope. This patch validate the input size big enough to touch the first node. Cc: Ruiyu NI <ruiyu.ni@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com>
2016-11-09MdePkg DevicePathLib: Rollback former change.Eric Dong1-16/+6
Former patch still has some bugs, so rollback it and enhance the original code. Cc: Ruiyu NI <ruiyu.ni@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Eric Dong <eric.dong@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>