Skip to content

Commit 5801910

Browse files
LiuZhiguang001mergify[bot]
authored andcommitted
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 <[email protected]> Cc: Ray Ni <[email protected]> Cc: Maurice Ma <[email protected]> Cc: Benjamin You <[email protected]> Signed-off-by: Zhiguang Liu <[email protected]> Reviewed-by: Guo Dong <[email protected]> Reviewed-by: Maurice Ma <[email protected]>
1 parent 59c48c9 commit 5801910

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

UefiPayloadPkg/UefiPayloadPkg.dsc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@
111111
DEFINE SERIAL_DRIVER_ENABLE = TRUE
112112
DEFINE PERFORMANCE_MEASUREMENT_ENABLE = FALSE
113113

114+
# For recent X86 CPU, 0x15 CPUID instruction will return Time Stamp Counter.
115+
# This is recommended way to get the time, and also how BaseCpuTimerLib works.
116+
# However, some CPU doesn't support this feature, so disable it by default.
117+
DEFINE CPU_TIMER_LIB_ENABLE = FALSE
118+
114119
[BuildOptions]
115120
*_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
116121
GCC:*_UNIXGCC_*_CC_FLAGS = -DMDEPKG_NDEBUG
@@ -217,7 +222,7 @@
217222
#
218223
# Platform
219224
#
220-
!if $(UNIVERSAL_PAYLOAD) == TRUE
225+
!if $(CPU_TIMER_LIB_ENABLE) == TRUE
221226
TimerLib|UefiCpuPkg/Library/CpuTimerLib/BaseCpuTimerLib.inf
222227
!else
223228
TimerLib|UefiPayloadPkg/Library/AcpiTimerLib/AcpiTimerLib.inf

0 commit comments

Comments
 (0)