summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@arm.com>2020-05-19 14:14:19 +0200
committerArd Biesheuvel <ard.biesheuvel@arm.com>2020-05-27 07:53:51 +0200
commit5564ad46121869ea4ca03db176e1aa166c6e4698 (patch)
tree20760feb414e412ff96d11a7fee7ef1cb3f94240
parent568eee7cf319fa95183c8d3b5e8dcf6e078ab8b3 (diff)
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>
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
index e6e788e0f1..f713605c02 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,