summaryrefslogtreecommitdiffstats
path: root/MdePkg/Library
Commit message (Collapse)AuthorAgeFilesLines
...
* MdePkg/UefiDebugLibStdErr: Pass the correct buffer sizeMarvin Haeuser2019-11-041-2/+2
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2302 The second argument of "UnicodeVSPrintAsciiFormat" is "BufferSize", which takes the size of the buffer in bytes. Replace the currently used MAX_DEBUG_MESSAGE_LENGTH usage, which is the buffer's length, with the actual buffer size. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibConOut: Pass the correct buffer sizeMarvin Haeuser2019-11-041-2/+2
| | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2302 The second argument of "UnicodeVSPrintAsciiFormat" is "BufferSize", which takes the size of the buffer in bytes. Replace the currently used MAX_DEBUG_MESSAGE_LENGTH usage, which is the buffer's length, with the actual buffer size. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Marvin Haeuser <mhaeuser@outlook.de> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg BaseIoLibIntrinsic: Remove __inline__ attribute for IO functionsLiming Gao2019-10-241-6/+0
| | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 __inline__ has no functional difference effect with the GCC48 / GCC49 / GCC5 toolchains, but it breaks the build with CLANG9. Remove __inline__. Signed-off-by: Liming Gao <liming.gao@intel.com> Acked-by: Laszlo Ersek <lersek@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdePkg/DxeServicesLib: remove bogus castLaszlo Ersek2019-10-091-1/+1
| | | | | | | | | | | | | | The HandleProtocol() boot service takes an EFI_HANDLE, not an (EFI_HANDLE*). Remove the bogus cast in the InternalImageHandleToFvHandle() function. This is a semantic cleanup; there is no change in behavior. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com>
* MdePkg: Implement SCSI commands for Security Protocol In/OutZurcher, Christopher J2019-09-291-1/+228
| | | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1546 This patch implements the Security Protocol In and Security Protocol Out commands in UefiScsiLib to prepare support for the Storage Security Command Protocol. Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Jian J Wang <jian.j.wang@intel.com> Signed-off-by: Christopher J Zurcher <christopher.j.zurcher@intel.com> Reviewed-by: Hao A Wu <hao.a.wu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: UefiLib: Add a function to check if a language is supportedTom Zhao2019-09-171-21/+39
| | | | | | | | | | | Add a function that checks if a target language is in the supported languages list. Add some calls to this function where appropriate in UefiLib.c Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Tom Zhao <tzhao@solarflare.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/DxeHstiLib: Added checks to improve error handling.Jayanth Raghuram2019-09-021-1/+1
| | | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2138 Added checks for return parameters of GetSupportedTypes function calls in InternalHstiFindAip to improve error handling. An issue was observed on Dell Poweredge R740, where the Dell PERC H740P controller UEFI driver returned InfoTypesBuffer = NULL, InfoTypesBufferCount = 0 and caused an FreePool assert. Signed-off-by: Jayanth Raghuram <Jayanth.Raghuram@Dell.com> Cc: Wei G Liu <Wei_G_Liu@Dell.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseUefiDecompressLib: Add missing description for parameterShenglei Zhang2019-08-131-0/+1
| | | | | | | | | | The description of parameter Version is missing in comments. So add the description. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibStdErr: Add destructor to CloseEventXu, Wei62019-07-292-0/+24
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2012 When driver is unloaded, the ExitBootSerivesEvent must be closed at the same time. Otherwise exception will occur when ExitBootServices. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibDebugPortProtocol: Add destructor to CloseEventXu, Wei62019-07-292-0/+24
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2012 When driver is unloaded, the ExitBootSerivesEvent must be closed at the same time. Otherwise exception will occur when ExitBootServices. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibConOut: Add destructor to CloseEventXu, Wei62019-07-292-0/+24
| | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2012 When driver is unloaded, the ExitBootSerivesEvent must be closed at the same time. Otherwise exception will occur when ExitBootServices. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Wei6 Xu <wei6.xu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Base64Decode(): don't declare variables in nested blocksLaszlo Ersek2019-07-171-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The EDK II C Coding Standards Specification (v2.20) strongly discourages variable declarations in nested block scope: 5 Source Files 5.4 Code File Structure 5.4.1 Scoping Rules 5.4.1.1 Scope > Block (local) Scope > > [...] > > Data declarations may follow the opening brace of a compound statement, > regardless of nesting depth, and before any code generating statements > have been entered. Other than at the outermost block of a function body, > this type of declaration is strongly discouraged. Hoist such variable declarations in Base64Decode() to the outermost function scope. Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Fixes: 35e242b698cdc6205e99a6d6a188bf27fecf9fb4 Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1980 Reported-by: Zhichao Gao <zhichao.gao@intel.com> Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Rebecca Cran <rebecca@bsdio.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Tested-by: Philippe Mathieu-Daude <philmd@redhat.com>
* MdePkg/BaseLib: rewrite Base64Decode()Laszlo Ersek2019-07-161-2/+247
| | | | | | | | | | | | | | | | | | | | | | | | | | Rewrite Base64Decode() from scratch, due to reasons listed in the second reference below. Implement Base64Decode() according to the specification added in the previous patch. The decoder scans the input buffer once, it has no inner loop(s), and it spills each output byte as soon as the output byte is complete. The intent is to only strengthen the checks (sanity and input) relative to the previous implementation, hence the MAX_ADDRESS checks are reinstated. Cc: Liming Gao <liming.gao@intel.com> Cc: Marvin Häuser <mhaeuser@outlook.de> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1891 Ref: http://mid.mail-archive.com/c495bd0b-ea4d-7206-8a4f-a7149760d19a@redhat.com Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Tested-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> [lersek@redhat.com: add last para to commit msg per talks w/ Marvin & Phil]
* MdePkg/BaseLib: re-specify Base64Decode(), and add temporary stub implLaszlo Ersek2019-07-161-198/+87
| | | | | | | | | | | | | | | | | | | Rewrite Base64Decode() from scratch, due to reasons listed in the second reference below. As first step, redo the interface contract, and replace the current implementation with a stub that asserts FALSE, then fails. Cc: Liming Gao <liming.gao@intel.com> Cc: Marvin Häuser <mhaeuser@outlook.de> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1891 Ref: http://mid.mail-archive.com/c495bd0b-ea4d-7206-8a4f-a7149760d19a@redhat.com Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Merge TianoCustomDecompress algorithm intoDandan Bi2019-05-155-17/+360
| | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1722 We plan to merge the BaseUefiTianoCustomDecompressLib in MdeModulePkg into the BaseUefDecompressLib in MdePkg. In order to reduce the duplicated codes and maintain easily. This patch adds a new fdf file in BaseUefDecompressLib (BaseUefiTianoCustomDecompressLib.inf) to keep the same functionality and usage model with the one in MdeModulePkg, and then update consumer to use this new one one and remove the one in MdeModulePkg finally. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Dandan Bi <dandan.bi@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Use PcdSpeculationBarrierTypeMichael D Kinney2019-04-302-2/+7
| | | | | | | | | | | Use PcdSpeculationBarrierType in the x86 implementation of SpeculationBarrier() to select between AsmLfence(), AsmCpuid(), and no operation. Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Brian J. Johnson <brian.johnson@hpe.com>
* MdePkg/UefiDebugLibStdErr: make global variable staticZhichao Gao2019-04-281-1/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740 Add a 'static' storage-class specifier to the global variables that only used in a single file to minimize the name collisions. This is only for the variable named 'mExitBootServicesEvent'. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibDebugPortProtocol: make global variable staticZhichao Gao2019-04-281-1/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740 Add a 'static' storage-class specifier to the global variables that only used in a single file to minimize the name collisions. This is only for the variable named 'mExitBootServicesEvent'. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibConOut: make global variable staticZhichao Gao2019-04-281-1/+1
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1740 Add a 'static' storage-class specifier to the global variables that only used in a single file to minimize the name collisions. This is only for the variable named 'mExitBootServicesEvent'. Cc: Laszlo Ersek <lersek@redhat.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/PeiServicesLib.c: Change comments of PeiServicesResetSystem2Zhichao Gao2019-04-281-4/+2
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1460 Refer to Uefi spec 2.8, the ResetData is valid while ResetStatus is EFI_SUCCESS regardless of the ResetType is EfiResetPlatformSpecific or not. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Remove support of INTEL tool chainShenglei Zhang2019-04-241-187/+7
| | | | | | | | | | | | | As Intel tool chain will be removed, support of INTEL tool chain should be removed first. https://bugzilla.tianocore.org/show_bug.cgi?id=1666 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit dd611bfeaac249cebb6c12ffdcbbf510f8ed1980)
* MdePkg/BaseIoLibIntrinsic: Remove IoLibIcc.cShenglei Zhang2019-04-243-212/+0
| | | | | | | | | | | | | As ICC tool chain will be removed, IoLibIcc.c should also be removed. https://bugzilla.tianocore.org/show_bug.cgi?id=1666 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> (cherry picked from commit 9b5be294b93f7ff7fe1bcafdc3c57016f58ee4e8)
* MdePkg/UefiDebugLibStdErr: Make it runtime safeAaron Antone2019-04-223-57/+145
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1416 After ExitBootServices, some pointer would be invalid such as the Protocol pointer and gST. The function depend on those should be prevent. So disable the related function while after ExitBootServices. Change the gST to a internal one, because there will be a cycle consume between UefiBootServicesTableLib and DebugLib due to the library constructors. Also remove the SMM support for this instance. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefidebugLibConOut: Make it runtime safeAaron Antone2019-04-223-58/+147
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1416 After ExitBootServices, some pointer would be invalid such as the Protocol pointer and gST. The function depend on those should be prevent. So disable the related function while after ExitBootServices. Change the gST to a internal one, because there will be a cycle consume between UefiBootServicesTableLib and DebugLib due to the library constructors. Also remove the SMM support for this instance. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibDebugPortProtocol: Make it runtime safeAaron Antone2019-04-223-72/+163
| | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1416 After ExitBootServices, some pointer would be invalid such as the Protocol pointer and gBS. The function depend on those should be prevent. So disable the related function while after ExitBootServices. Change the gBS to a internal one, because there will be a cycle consume between UefiBootServicesTableLib and DebugLib due to the library constructors. Also remove the SMM support for this instance. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Remove LongJump.c and SetJump.cShenglei Zhang2019-04-153-171/+2
| | | | | | | | | | | | MdePkg BaseLib still uses the inline X86 assembly code in C code files.For now, inline SetJump/LongJump() can be removed. https://bugzilla.tianocore.org/show_bug.cgi?id=1163 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091035-7124/+1035
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseMemoryLibSse2: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-0323-1417/+0
| | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseMemoryLibRepStr: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-0323-1180/+0
| | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseMemoryLibOptPei: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-0323-1173/+0
| | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseMemoryLibOptDxe: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-0323-1222/+0
| | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseMemoryLibMmx: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-0323-1290/+0
| | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-0339-2412/+0
| | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseCpuLib: Remove .S files for IA32 and X64 archShenglei Zhang2019-04-033-73/+0
| | | | | | | | | | | | | | | .nasm file has been added for X86 arch. .S assembly code is not required any more. https://bugzilla.tianocore.org/show_bug.cgi?id=1594 v2: Remove CpuSleep.nasm| GCC and CpuFlushTlb.nasm| GCC in X64 arch in BaseCpuLib.inf. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebuglibDebugPortProtocol: Add new APIsBret Barkelew2019-04-021-5/+101
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs' implementation (DebugVPrint, DebugBPrint) in the DebugLib instance. These APIs would expose print routines with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/DxeRuntimeDebugLibSerialPort: Add new APIsBret Barkelew2019-04-021-5/+101
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs' implementation (DebugVPrint, DebugBPrint) in the DebugLib instance. These APIs would expose print routines with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiDebugLibStdErr: Add new APIsBret Barkelew2019-04-021-5/+102
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs' implementation (DebugVPrint, DebugBPrint) in the DebugLib instance. These APIs would expose print routines with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefidebugLibConOut: Add new APIsBret Barkelew2019-04-021-5/+101
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs' implementation (DebugVPrint, DebugBPrint) in the DebugLib instance. These APIs would expose print routines with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseDebugLibSerialPort: Add new APIsBret Barkelew2019-04-021-5/+101
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs' implementation (DebugVPrint, DebugBPrint) in the DebugLib instance. These APIs would expose print routines with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseDebugLibNull: Add new APIs for DebugLibBret Barkelew2019-04-021-1/+55
| | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1395 Add new APIs' implementation (DebugVPrint, DebugBPrint) in the DebugLib instance. These APIs would expose print routines with VaList parameter and BaseList parameter. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zhichao Gao <zhichao.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Michael Turner <Michael.Turner@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseUefiDecompressLib: Improve performance of boundary validationShenglei Zhang2019-03-271-3/+4
| | | | | | | | | | | | | The boundary validation checking in MakeTable() performs on every loop iteration. This could be improved by checking just once before the loop. https://bugzilla.tianocore.org/show_bug.cgi?id=1329 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/PciSegmentLibSegmentInfo: Change parameters typeShenglei Zhang2019-03-191-7/+7
| | | | | | | | | | | | | | The current structure can lead to dependency on VC++ compiler support functions when build for "IA32" with "/Od" switch, such as _aullshr(). So change the type of parameters in structure PCI_SEGMENT_LIB_ADDRESS_STRUCTURE from UINT64 to UINT32. https://bugzilla.tianocore.org/show_bug.cgi?id=1532 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Add Shadow Stack Support for X86.Yao, Jiewen2019-02-287-7/+150
| | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1521 This patch adds SSP - shadow stack pointer to JumpBuffer. It will be used for the platform that enabled CET/ShadowStack. We add gEfiMdePkgTokenSpaceGuid.PcdControlFlowEnforcementPropertyMask to control the global enable/disable. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Laszlo Ersek <lersek@redhat.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Yao Jiewen <jiewen.yao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
* MdePkg/UefiDevicePathLibDevicePathProtocol: Add sanity check for FilePath ↵Jian J Wang2019-02-211-0/+9
| | | | | | | | | | | | | | | | | | device path REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1497 Current implementation of IsDevicePathValid() is not enough for type of MEDIA_FILEPATH_DP, which has NULL-terminated string in the device path. This patch add a simple NULL character check at Length position. Cc: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdePkg/UefiDevicePathLib: Add sanity check for FilePath device pathJian J Wang2019-02-211-0/+9
| | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1497 Current implementation of IsDevicePathValid() is not enough for type of MEDIA_FILEPATH_DP, which has NULL-terminated string in the device path. This patch add a simple NULL character check at Length position. Cc: Liming Gao <liming.gao@intel.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jian J Wang <jian.j.wang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com>
* MdePkg/BaseLib: Change a variable type in a bitwise operationShenglei Zhang2019-02-191-1/+1
| | | | | | | | | | | | | Change the type of variable Chr from CHAR8 to UINT32 in a bitwise operation, to make the two variables in the operation have the same size. https://bugzilla.tianocore.org/show_bug.cgi?id=1527 Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: implement SpeculationBarrier() for ARM and AArch64Ard Biesheuvel2019-02-126-32/+160
| | | | | | | | | | | | Replace the dummy C implementation of SpeculationBarrier() with implementations consisting of the recommended DSB SY + ISB sequence, as recommended by ARM in the whitepaper "Cache Speculation Side-channels" version 2.4, dated October 2018. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
* MdePkg: Fix coding style issuesBi, Dandan2019-02-022-4/+4
| | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1478 Fix issues that reported by Edk2 coding style check tool(ECC) that: in Comment, <@param SystemTable> does NOT consistent with parameter name MmSystemTable. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Dandan Bi <dandan.bi@intel.com> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseLib: Add Base64Encode() and Base64Decode()Mike Turner2019-02-021-0/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce public functions Base64Encode and Base64Decode. https://bugzilla.tianocore.org/show_bug.cgi?id=1370 v2:1.Remove some white space. 2.Add unit test with test vectors in RFC 4648. https://github.com/shenglei10/edk2/tree/encode_test https://github.com/shenglei10/edk2/tree/decode_test v3:1.Align white space. 2.Update comments of Base64Encode and Base64Decode. 3.Change the use of macro RETURN_DEVICE_ERROR to RETURN_INVALID_PARAMETER in string.c. v4:Change parameters' names. v5:1.Update usage of variables. 2.Remove debug message in Base64Decode(). Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> Reviewed-by: Ray Ni <ray.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/UefiLib: Add a new API GetVariable3Bret Barkelew2019-01-311-0/+81
| | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1396 Add a new API GetVariable3, which can return the attributes of a variable during reading it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Jiansong Xu <jiansongx.xu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>