summaryrefslogtreecommitdiff
path: root/MdePkg/Library/BaseLib/UnitTestHostBaseLib.inf
AgeCommit message (Collapse)AuthorFilesLines
2026-09-06MdePkg: UnitTestHostBaseLib: Support reading CNTPCT_EL0, ID_AA64ISAR0_EL1Kun Qin1-0/+4
This change adds the support of reading CNTPCT_EL0 and ID_AA64ISAR0_EL1 through current BaseLib definition. This paves way to allow the linkage of these functions needed on other host based unit tests. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31MdePkg: UnitTestHostBaseLib: Clean up source entriesKun Qin1-11/+1
The existing UnitTestHostBaseLib has some source entries that are either redundant or for unsupported architectures. This change consolidated the redundant entries and removed the entries for unsupported architectures. Signed-off-by: Kun Qin <kun.qin@microsoft.com>
2026-07-31MdePkg: UnitTestHostBaseLib: Added preprocessor for AArch64 instancesKun Qin1-2/+3
This change adds a few preprocessors to build AArch64 host based unit tests properly. An AArch64 specific instance of `gUnitTestHostBaseLib` is created to abstract the reference of arch specific special instructions. Signed-off-by: Kun Qin <kuqin12@gmail.com>
2025-12-24MdePkg/Library/BaseLib: Use PcdControlFlowEnforcementPropertyMask as fixedMichael D Kinney1-1/+3
Always access PcdControlFlowEnforcementPropertyMask using FixedPcdGet() in NASM source files and update INFs to correctly declare that PcdControlFlowEnforcementPropertyMask is always accessed as a Fixed PCD. PcdControlFlowEnforcementPropertyMask is declared in MdePkg.dec in the [PcdsFixedAtBuild] section, so this PCD does not support any other PCD access types. This change resolves ld warnings from GCC and CLANGDWARF builds for relocations in read-only text sections because use of PcdGet() in NASM source files reads the value into eax from the memory location of a const global variable that requires a relocation fixup. By changing PcdGet() to FixedPcdGet(), eax is loaded with an immediate value known at build time and no relocation fixups for PcdControlFlowEnforcementPropertyMask are required. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2025-11-04MdePkg: Add code to detect running as an SEV guestRARelph1-0/+2
Similar to Intel's Tdx, we need a mechanism to detect running as an AMD SEV guest that will work in all phases everywhere. This will be immediately used to prevent usage of MTRRs with SEV guests. Signed-off-by: Richard Relph <richard.relph@amd.com>
2025-09-26MdePkg: Remove ARM32 Support from BaseLibOliver Smith-Denny1-21/+2
edk2 is dropping support for the ARM32 architecture. This commit removes ARM32 code from BaseLib. Signed-off-by: Oliver Smith-Denny <osde@microsoft.com>
2025-09-19MdePkg/Library/BaseLib: Remove __chkstk() from BaseLibMichael D Kinney1-1/+0
Remove workaround for GCC compilers that is no longer required. Keeping this implementation of __chkstk() generates duplicate symbol build failures with Windows/CLANGPDB builds host-based unit test builds. Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com>
2023-04-10MdePkg/Library/BaseLib: HOST_APPLICATION IA32/X64 onlyMichael D Kinney1-1/+1
Update BaseLib host-based unit test INF file to only list VALID_ARCHITECTURES of IA32 and X64 to align with all other host-based unit test INF files. The UnitTestFrameworkPkg only provides build support of host-based unit tests to OS applications for IA32 and X64. Cc: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Reviewed-by: Oliver Smith-Denny <osde@linux.microsoft.com>
2022-12-14MdePkg/UnitTestHostBaseLib: Remove HOST_APPLICATION limitationLiu, Zhiguang1-3/+6
Remove HOST_APPLICATION limitation for UnitTestHostBaseLib, so that this library can be used as BaseLib by Emulator. Also, add some missing files Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <gaoliming@byosoft.com.cn> Signed-off-by: Ray Ni <ray.ni@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com>
2022-05-13MdePkg: Remove RVCT supportRebecca Cran1-8/+0
RVCT is obsolete and no longer used. Remove support for it. Signed-off-by: Rebecca Cran <quic_rcran@quicinc.com> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
2021-10-13MdePkg/BaseLib: Add QuickSort function on BaseLibIanX Kuo1-1/+2
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3675 Add QuickSort function into BaseLib Reviewed-by: Ray Ni <ray.ni@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <gaoliming@byosoft.com.cn> Cc: Zhiguang Liu <zhiguang.liu@intel.com> Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
2020-07-28MdePkg/Library/UnitTestHostBaseLib: Add missing servicesMichael D Kinney1-0/+34
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2862 Add ReadMmx()/WriteMmx() services Add MemoryFence() service Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
2020-07-15MdePkg/Library/BaseLib: Add BaseLib instance for host based unit testsMichael D Kinney1-0/+217
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2800 Add a new version of BaseLib that is safe for use from host based unit test applications. Host based unit test applications may need to provide implementations of some BaseLib functions that provide simple emulation to exercise the code under test. The structure UNIT_TEST_HOST_BASE_LIB is filled in with services that provide default emulation for BaseLib APIs that would normally generate exceptions in a host based unit test application. This structure allows an individual unit test to replace the default emulation of a BaseLib service with an alternate version that is required by a specific unit test. A global variable of type UNIT_TEST_HOST_BASE_LIB is provided through the new UnitTestHostBaseLib library class. Normally cmocka would be used to mock services the code under test calls. However, the BaseLib is used by the Unit Test Framework itself, so using a mocked interface is not possible. The use of a structure to provide hooks for unit test is not expected to be a common feature. It should only be required for libraries that are used by both the Unit Test Framework and the code under test where the code under test requires a different behavior than the Unit Test Framework. Cc: Liming Gao <liming.gao@intel.com> Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Bret Barkelew <Bret.Barkelew@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>