mirror of
https://github.com/tianocore/edk2
synced 2026-08-27 00:23:19 -04:00
Add a new PCD `PcdSerialDebugPrintErrorLevel` that overrides the verbosity set in `DebugPrintErrorLevel` for the serial port debug output and does not affect memory debug logging. Accepted values are: - "silent": DEBUG_ERROR only - "verbose": use the `DebugPrintErrorLevel` value. - a hex bitmask (e.g. "0x80000040"). This PCD value can be overridden at runtime using the fw_cfg entry "opt/org.tianocore/DebugLevel" without rebuilding the firmware. The runtime override takes priority over the compile-time one. When neither is set, the serial output uses the compiled-in PcdDebugPrintErrorLevel. SEC and PEI_CORE phases do not support this override because they run from flash, where global variables are not available. Supporting it would require parsing the device tree on every debug write to locate the fw_cfg device and read the DebugLevel value — unnecessary overhead given the low volume of logs in those phases. ParseSerialDebugLevel() is duplicated as a STATIC function in Flash.c and PlatformPeiLib.c rather than shared via a header, because EDK2 coding style forbids function definitions in headers. A dedicated library class would be excessive for a small helper with only two consumers. Example QEMU command line: -fw_cfg name=opt/org.tianocore/DebugLevel,string=silent -fw_cfg name=opt/org.tianocore/DebugLevel,string=verbose -fw_cfg name=opt/org.tianocore/DebugLevel,string=0x80000000 Suggested-by: Gerd Hoffmann <kraxel@redhat.com> Signed-off-by: Luigi Leonardi <leonardi@redhat.com> |
||
|---|---|---|
| .. | ||
| DebugLib.c | ||
| DebugLibFdtPL011UartFlash.inf | ||
| DebugLibFdtPL011UartRam.inf | ||
| DxeRuntimeDebugLibFdtPL011Uart.inf | ||
| Flash.c | ||
| Ram.c | ||
| Ram.h | ||
| RamNonRuntime.c | ||
| Runtime.c | ||
| Write.h | ||