diff options
author | Ard Biesheuvel <ard.biesheuvel@arm.com> | 2020-05-19 14:23:50 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2020-06-03 14:04:59 +0000 |
commit | b1d3895fb97fa8b387739eb4600c6a0b820e4ec0 (patch) | |
tree | 67c278380144383b348ccdd94597f25645b7ff2a /ArmPkg/Library/PlatformBootManagerLib | |
parent | ca407c7246bf405da6d9b1b9d93e5e7f17b4b1f9 (diff) | |
download | edk2-b1d3895fb97fa8b387739eb4600c6a0b820e4ec0.zip edk2-b1d3895fb97fa8b387739eb4600c6a0b820e4ec0.tar.gz edk2-b1d3895fb97fa8b387739eb4600c6a0b820e4ec0.tar.bz2 |
ArmPkg/PlatformBootManagerLib: use static assertion for console type
Replace the runtime ASSERT with the build time STATIC_ASSERT on the
check that ensures that the terminal type we use for the serial
console matches the one we explicitly add to the ConIn/ConOut/StdErr
variables.
This helps catch serial console issues early, even in RELEASE builds,
reducing the risk of ending up with no console at all, which can be
tricky to debug on bare metal.
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@arm.com>
Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Reviewed-by: Sami Mujawar <Sami.Mujawar@arm.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Diffstat (limited to 'ArmPkg/Library/PlatformBootManagerLib')
-rw-r--r-- | ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index e6e788e..f713605 100644 --- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c +++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c @@ -583,7 +583,9 @@ PlatformBootManagerBeforeConsole ( //
// Add the hardcoded serial console device path to ConIn, ConOut, ErrOut.
//
- ASSERT (FixedPcdGet8 (PcdDefaultTerminalType) == 4);
+ STATIC_ASSERT (FixedPcdGet8 (PcdDefaultTerminalType) == 4,
+ "PcdDefaultTerminalType must be TTYTERM");
+
CopyGuid (&mSerialConsole.TermType.Guid, &gEfiTtyTermGuid);
EfiBootManagerUpdateConsoleVariable (ConIn,
|