Introduce a build flag "RT_DEBUG" to enable runtime debug, so that we can have a handy method for UEFI runtime services debug.
This build flag only applies to DEBUG build; the reason for not enabling it for DEBUG build by default is that we are still using the same UART of OS and it may cause potential conflict. User needs to specify "-D RT_DEBUG=TRUE"; "-D RT_DEBUG" is not enough for we use !if $(RT_DEBUG)==TRUE in the code. Cc: Laszlo Ersek <ler...@redhat.com> Cc: Ard Biesheuvel <ard.biesheu...@linaro.org> Cc: Julien Grall <julien.gr...@arm.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Heyi Guo <guoh...@huawei.com> Signed-off-by: Heyi Guo <heyi....@linaro.org> --- ArmVirtPkg/ArmVirt.dsc.inc | 4 ++++ ArmVirtPkg/ArmVirtQemu.dsc | 1 + 2 files changed, 5 insertions(+) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index d172a08..5ace31b 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -240,8 +240,12 @@ MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf CapsuleLib|MdeModulePkg/Library/DxeCapsuleLibNull/DxeCapsuleLibNull.inf !if $(TARGET) != RELEASE +!if $(RT_DEBUG) == TRUE + SerialPortLib|ArmVirtPkg/Library/FdtPL011SerialPortLib/FdtPL011SerialPortLibRuntime.inf +!else DebugLib|MdePkg/Library/DxeRuntimeDebugLibSerialPort/DxeRuntimeDebugLibSerialPort.inf !endif +!endif !if $(SECURE_BOOT_ENABLE) == TRUE BaseCryptLib|CryptoPkg/Library/BaseCryptLib/RuntimeCryptLib.inf diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index d703317..b279d7d 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -37,6 +37,7 @@ DEFINE SECURE_BOOT_ENABLE = FALSE DEFINE NETWORK_IP6_ENABLE = FALSE DEFINE HTTP_BOOT_ENABLE = FALSE + DEFINE RT_DEBUG = FALSE !include ArmVirtPkg/ArmVirt.dsc.inc -- 1.8.3.1 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel