In some situations, we may not want to actually emit any boot log. This
commit adds a null bootlog handler. We will use this in situations where
we can not maintain a boot log, such as during the SEC phase.
Signed-off-by: Alexander Graf <graf@amazon.com>
---
.../BaseDebugBootlogNullLib.inf | 26 +++++++++++++++
.../BaseDebugBootlog/DebugBootlogNull.c | 32 +++++++++++++++++++
2 files changed, 58 insertions(+)
create mode 100644 MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf
create mode 100644 MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c
diff --git a/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf b/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf
new file mode 100644
index 0000000000..0f650f6260
--- /dev/null
+++ b/MdePkg/Library/BaseDebugBootlog/BaseDebugBootlogNullLib.inf
@@ -0,0 +1,26 @@
+## @file
+# Null Debug library instance for a RAM based boot log.
+# It provides function stubs for boot log that do nothing.
+#
+# Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2012, Red Hat, Inc.<BR>
+# Copyright (c) 2022, Amazon Development Center Germany GmbH. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = BaseDebugBootlogNull
+ FILE_GUID = DF934DA3-CD31-49FE-AF50-B3C87C79325F
+ MODULE_TYPE = BASE
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = DebugBootlogLib
+
+[Sources]
+ DebugBootlogNull.c
+
+[Packages]
+ MdePkg/MdePkg.dec
diff --git a/MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c b/MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c
new file mode 100644
index 0000000000..fbb304e6e2
--- /dev/null
+++ b/MdePkg/Library/BaseDebugBootlog/DebugBootlogNull.c
@@ -0,0 +1,32 @@
+/** @file
+ Null Debug library instance for a RAM based boot log.
+ It provides function stubs for boot log that do nothing.
+
+ Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
+ Copyright (c) 2012, Red Hat, Inc.<BR>
+ Copyright (c) 2022, Amazon Development Center Germany GmbH.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+
+UINT32
+EFIAPI
+GetDebugBootlogErrorLevel (
+ VOID
+ )
+{
+ return 0;
+}
+
+RETURN_STATUS
+EFIAPI
+DebugBootlogAppend (
+ IN CONST CHAR8 *String,
+ IN UINTN Length,
+ IN UINTN ErrorLevel
+ )
+{
+ return RETURN_SUCCESS;
+}
--
2.28.0.394.ge197136389
Amazon Development Center Germany GmbH
Krausenstr. 38
10117 Berlin
Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss
Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B
Sitz: Berlin
Ust-ID: DE 289 237 879
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#90066): https://edk2.groups.io/g/devel/message/90066
Mute This Topic: https://groups.io/mt/91368901/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-