From: Liu, Zhiguang Date: Fri, 14 Jan 2022 06:15:18 +0000 (-0700) Subject: UefiPayloadPkg: Not use BaseCpuTimerLib by default. X-Git-Tag: edk2-stable202202~54 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=5801910013757bd626f67ed77eea6c16a176eebf;p=mirror_edk2.git UefiPayloadPkg: Not use BaseCpuTimerLib by default. For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter. This is recommended way to get the time, and also how BaseCpuTimerLib works However, some CPU doesn't support this feature, so disable it by default. Cc: Guo Dong Cc: Ray Ni Cc: Maurice Ma Cc: Benjamin You Signed-off-by: Zhiguang Liu Reviewed-by: Guo Dong Reviewed-by: Maurice Ma --- diff --git a/UefiPayloadPkg/UefiPayloadPkg.dsc b/UefiPayloadPkg/UefiPayloadPkg.dsc index 3d08edfe31..65c1bd610e 100644 --- a/UefiPayloadPkg/UefiPayloadPkg.dsc +++ b/UefiPayloadPkg/UefiPayloadPkg.dsc @@ -111,6 +111,11 @@ DEFINE SERIAL_DRIVER_ENABLE = TRUE DEFINE PERFORMANCE_MEASUREMENT_ENABLE = FALSE + # For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter. + # This is recommended way to get the time, and also how BaseCpuTimerLib works. + # However, some CPU doesn't support this feature, so disable it by default. + DEFINE CPU_TIMER_LIB_ENABLE = FALSE + [BuildOptions] *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG @@ -217,7 +222,7 @@ # # Platform # -!if $(UNIVERSAL_PAYLOAD) == TRUE +!if $(CPU_TIMER_LIB_ENABLE) == TRUE TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf !else TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf