[edk2-devel] [edk2/master PATCH DxeIplHandoffLib v2] MdeModulePkg/DxeIplHandoffLibNullLib: Abstract DxeIpl

Abner Chang posted 1 patch 4 years ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/edk2 tags/patchew/20200316025308.27924-1-abner.chang@hpe.com
MdeModulePkg/MdeModulePkg.dec                 |  7 +++-
MdeModulePkg/MdeModulePkg.dsc                 |  2 ++
.../DxeIplHandoffLibNull.inf                  | 30 ++++++++++++++++
.../Include/Library/DxeIplHandoffLib.h        | 34 +++++++++++++++++++
.../DxeIplHandoffLibNull.c                    | 34 +++++++++++++++++++
.../DxeIplHandoffLibNull.uni                  | 14 ++++++++
6 files changed, 120 insertions(+), 1 deletion(-)
create mode 100644 MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.inf
create mode 100644 MdeModulePkg/Include/Library/DxeIplHandoffLib.h
create mode 100644 MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.c
create mode 100644 MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.uni
[edk2-devel] [edk2/master PATCH DxeIplHandoffLib v2] MdeModulePkg/DxeIplHandoffLibNullLib: Abstract DxeIpl
Posted by Abner Chang 4 years ago
BZ:2583:
https://bugzilla.tianocore.org/show_bug.cgi?id=2583

Current DxeIpl has bindings for different processor
architectures, this results in MdeModulePkg has the
dependence with processor architecture packages such as
ArmPkg or RiscVPkg. This also leads CI testing to error
during package dependency check. Provide a default
DxeIplHandoff library to abstract processor
architecture from DxeIpl driver, platform can provide
its own library instance for the processor architecture-
specific implementation.

Signed-off-by: Abner Chang <abner.chang@hpe.com>

Cc: Leif Lindholm <leif@nuviainc.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Laszlo Ersek <lersek@redhat.com>
Cc: Dandan Bi <dandan.bi@intel.com>
Cc: Daniel Schaefer <daniel.schaefer@hpe.com>
Cc: Gilbert Chen <gilbert.chen@hpe.com>
---
 MdeModulePkg/MdeModulePkg.dec                 |  7 +++-
 MdeModulePkg/MdeModulePkg.dsc                 |  2 ++
 .../DxeIplHandoffLibNull.inf                  | 30 ++++++++++++++++
 .../Include/Library/DxeIplHandoffLib.h        | 34 +++++++++++++++++++
 .../DxeIplHandoffLibNull.c                    | 34 +++++++++++++++++++
 .../DxeIplHandoffLibNull.uni                  | 14 ++++++++
 6 files changed, 120 insertions(+), 1 deletion(-)
 create mode 100644 MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.inf
 create mode 100644 MdeModulePkg/Include/Library/DxeIplHandoffLib.h
 create mode 100644 MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.c
 create mode 100644 MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.uni

diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec
index 91a3c60823..2876b97846 100644
--- a/MdeModulePkg/MdeModulePkg.dec
+++ b/MdeModulePkg/MdeModulePkg.dec
@@ -6,7 +6,7 @@
 # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
 # Copyright (c) 2007 - 2020, Intel Corporation. All rights reserved.<BR>
 # Copyright (c) 2016, Linaro Ltd. All rights reserved.<BR>
-# (C) Copyright 2016 - 2019 Hewlett Packard Enterprise Development LP<BR>
+# (C) Copyright 2016 - 2020 Hewlett Packard Enterprise Development LP<BR>
 # Copyright (c) 2017, AMD Incorporated. All rights reserved.<BR>
 # Copyright (c) 2016, Microsoft Corporation<BR>
 # SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -144,6 +144,11 @@
   #
   DisplayUpdateProgressLib|Include/Library/DisplayUpdateProgressLib.h
 
+  ## @libraryclass  Provides interface to performs a CPU architecture specific operations to
+  ## transit to DXE phase.
+  #
+  DxeIplHandoffLib|Include/Library/DxeIplHandoffLib.h
+
 [Guids]
   ## MdeModule package token space guid
   # Include/Guid/MdeModulePkgTokenSpace.h
diff --git a/MdeModulePkg/MdeModulePkg.dsc b/MdeModulePkg/MdeModulePkg.dsc
index f7dbb27ce2..ea018fac92 100644
--- a/MdeModulePkg/MdeModulePkg.dsc
+++ b/MdeModulePkg/MdeModulePkg.dsc
@@ -3,6 +3,7 @@
 #
 # (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
 # Copyright (c) 2007 - 2019, Intel Corporation. All rights reserved.<BR>
+# (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
 #
 #    SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -321,6 +322,7 @@
   MdeModulePkg/Library/BaseBmpSupportLib/BaseBmpSupportLib.inf
   MdeModulePkg/Library/DisplayUpdateProgressLibGraphics/DisplayUpdateProgressLibGraphics.inf
   MdeModulePkg/Library/DisplayUpdateProgressLibText/DisplayUpdateProgressLibText.inf
+  MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.inf
 
   MdeModulePkg/Universal/BdsDxe/BdsDxe.inf
   MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenuApp.inf
diff --git a/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.inf b/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.inf
new file mode 100644
index 0000000000..b7210656b7
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.inf
@@ -0,0 +1,30 @@
+## @file
+#  Null DXE IPL handoff to DXE Core Library instance.
+#
+#  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x0001001b
+  BASE_NAME                      = DxeIplHandoffLibNull
+  MODULE_UNI_FILE                = DxeIplHandoffLibNull.uni
+  FILE_GUID                      = 5c18812d-3684-4093-bc75-fc846a595353
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = DxeIplHandoffLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+#  VALID_ARCHITECTURES           = RISCV64
+#
+
+[Sources]
+  DxeIplHandoffLibNull.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+
diff --git a/MdeModulePkg/Include/Library/DxeIplHandoffLib.h b/MdeModulePkg/Include/Library/DxeIplHandoffLib.h
new file mode 100644
index 0000000000..a2c4cddf87
--- /dev/null
+++ b/MdeModulePkg/Include/Library/DxeIplHandoffLib.h
@@ -0,0 +1,34 @@
+/** @file
+  Provides interface to performs a CPU architecture specific operations to
+  transit to DXE phase.
+
+  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. <BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef DXEIPL_HANDOFF_LIB__
+#define DXEIPL_HANDOFF_LIB__
+
+#include <PiPei.h>
+
+/**
+   Transfers control to DxeCore.
+
+   This function performs a CPU architecture specific operations to execute
+   the entry point of DxeCore with the parameters of HobList.
+   It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+
+   @param DxeCoreEntryPoint         The entry point of DxeCore.
+   @param HobList                   The start of HobList passed to DxeCore.
+
+**/
+VOID
+EFIAPI
+HandOffToDxeCore (
+  IN EFI_PHYSICAL_ADDRESS   DxeCoreEntryPoint,
+  IN EFI_PEI_HOB_POINTERS   HobList
+  );
+
+#endif
diff --git a/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.c b/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.c
new file mode 100644
index 0000000000..44bdb10837
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.c
@@ -0,0 +1,34 @@
+/** @file
+  NULL instance of DXE IPL handoff to DXE Core Library.
+
+  Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <PiPei.h>
+#include <Library/DebugLib.h>
+
+/**
+   Transfers control to DxeCore.
+
+   This function performs a CPU architecture specific operations to execute
+   the entry point of DxeCore with the parameters of HobList.
+   It also installs EFI_END_OF_PEI_PPI to signal the end of PEI phase.
+
+   @param DxeCoreEntryPoint         The entry point of DxeCore.
+   @param HobList                   The start of HobList passed to DxeCore.
+
+**/
+VOID
+EFIAPI
+HandOffToDxeCore (
+  IN EFI_PHYSICAL_ADDRESS   DxeCoreEntryPoint,
+  IN EFI_PEI_HOB_POINTERS   HobList
+  )
+{
+  DEBUG ((DEBUG_INFO, "No implementation of DXE IPL handoff to DXE Core library.\r\n"));
+  ASSERT (FALSE);
+}
+
diff --git a/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.uni b/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.uni
new file mode 100644
index 0000000000..5a8973d6e5
--- /dev/null
+++ b/MdeModulePkg/Library/DxeIplHandoffLibNull/DxeIplHandoffLibNull.uni
@@ -0,0 +1,14 @@
+// /** @file
+// Null DXE IPL handoff to DXE Core Library instance.
+//
+// Copyright (c) 2020, Hewlett Packard Enterprise Development LP. All rights reserved.<BR>
+//
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+//
+// **/
+
+
+#string STR_MODULE_ABSTRACT             #language en-US "Null DXE IPL handoff to DXE Core Library instance."
+
+#string STR_MODULE_DESCRIPTION          #language en-US "Null DXE IPL handoff to DXE Core Library instance."
+
-- 
2.25.0


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#55862): https://edk2.groups.io/g/devel/message/55862
Mute This Topic: https://groups.io/mt/71990217/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-