public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Alexander Graf" <graf@amazon.com>
To: <devel@edk2.groups.io>
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Dandan Bi <dandan.bi@intel.com>,
	Zhichao Gao <zhichao.gao@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>
Subject: [PATCH 02/12] MdePkg: Add Null BaseDebugBootlog
Date: Fri, 27 May 2022 04:43:07 +0200	[thread overview]
Message-ID: <20220527024317.13476-3-graf@amazon.com> (raw)
In-Reply-To: <20220527024317.13476-1-graf@amazon.com>

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




  parent reply	other threads:[~2022-05-27  2:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-27  2:43 [PATCH 00/12] Introduce Bootlog DEBUG() output Alexander Graf
2022-05-27  2:43 ` [PATCH 01/12] MdePkg: Add DebugBootlog header Alexander Graf
2022-05-27  2:43 ` Alexander Graf [this message]
2022-05-27  2:43 ` [PATCH 03/12] MdePkg: Add Fallback timer support for BaseDebugBootlog Alexander Graf
2022-05-27  2:43 ` [PATCH 04/12] MdePkg: Add X86 " Alexander Graf
2022-05-27  2:43 ` [PATCH 05/12] MdePkg: Add ARM " Alexander Graf
2022-05-27  2:43 ` [PATCH 06/12] MdePkg: Add Pei phase BaseDebugBootlog Alexander Graf
2022-05-27  2:43 ` [PATCH 07/12] MdePkg: Add Dxe " Alexander Graf
2022-05-27  2:43 ` [PATCH 08/12] MdePkg: Add BaseDebugLibBootlog Alexander Graf
2022-05-27  2:43 ` [PATCH 09/12] Scripts: Add bootlog decyphering script Alexander Graf
2022-05-27  2:43 ` [PATCH 10/12] BaseDebugLibSerialPort: Include BaseDebugBootlog in all dscs Alexander Graf
2022-05-27  2:43 ` [PATCH 11/12] BaseDebugLibSerialPort: Emit messages to boot log Alexander Graf
2022-05-27  2:43 ` [PATCH 12/12] OvmfPkg/PlatformDebugLibIoPort: Add Bootlog support Alexander Graf
2022-06-01  9:33 ` [edk2-devel] [PATCH 00/12] Introduce Bootlog DEBUG() output Gerd Hoffmann
2022-06-01 16:58   ` Benjamin Doron
2022-06-02  8:35     ` Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220527024317.13476-3-graf@amazon.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox