[PATCH v3 04/22] ArmPkg/ArmHvcNullLib: Add NULL instance of ArmHvcLib


PierreGondois
 

From: Pierre Gondois <Pierre.Gondois@...>

Add a Null instance of ArmHvcLib in case of library dependencies.

Signed-off-by: Pierre Gondois <Pierre.Gondois@...>
---
ArmPkg/ArmPkg.dsc | 1 +
ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.c | 29 +++++++++++++++++++
.../Library/ArmHvcNullLib/ArmHvcNullLib.inf | 22 ++++++++++++++
3 files changed, 52 insertions(+)
create mode 100644 ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.c
create mode 100644 ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.inf

diff --git a/ArmPkg/ArmPkg.dsc b/ArmPkg/ArmPkg.dsc
index 3afd212f472b..e33b40f2c215 100644
--- a/ArmPkg/ArmPkg.dsc
+++ b/ArmPkg/ArmPkg.dsc
@@ -134,6 +134,7 @@ [Components.common]
ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
ArmPkg/Library/ArmSmcLibNull/ArmSmcLibNull.inf
ArmPkg/Library/ArmHvcLib/ArmHvcLib.inf
+ ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.inf
ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
ArmPkg/Library/ArmMonitorLib/ArmMonitorLib.inf
ArmPkg/Library/OpteeLib/OpteeLib.inf
diff --git a/ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.c b/ArmPkg/Librar=
y/ArmHvcNullLib/ArmHvcNullLib.c
new file mode 100644
index 000000000000..6905631ccb6c
--- /dev/null
+++ b/ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.c
@@ -0,0 +1,29 @@
+/** @file
+ Arm HyperVisor Call (HVC) Null Library.
+
+ Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+
+ SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Library/DebugLib.h>
+#include <Library/ArmHvcLib.h>
+
+/**
+ Trigger an HVC call
+
+ HVC calls can take up to 8 arguments and return up to 4 return values.
+ Therefore, the 4 first fields in the ARM_HVC_ARGS structure are used
+ for both input and output values.
+
+ @param [in, out] Args Arguments for the HVC call.
+**/
+VOID
+ArmCallHvc (
+ IN OUT ARM_HVC_ARGS *Args
+ )
+{
+ ASSERT (FALSE);
+ return;
+}
diff --git a/ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.inf b/ArmPkg/Libr=
ary/ArmHvcNullLib/ArmHvcNullLib.inf
new file mode 100644
index 000000000000..c4665d34018b
--- /dev/null
+++ b/ArmPkg/Library/ArmHvcNullLib/ArmHvcNullLib.inf
@@ -0,0 +1,22 @@
+## @file
+# Arm Hvc Null Library
+#
+# Copyright (c) 2022, Arm Limited. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+##
+
+[Defines]
+ INF_VERSION =3D 0x00010005
+ BASE_NAME =3D ArmHvcNullLib
+ FILE_GUID =3D 02076A46-D6DB-48DD-8E5F-153172DD73A=
1
+ MODULE_TYPE =3D BASE
+ VERSION_STRING =3D 1.0
+ LIBRARY_CLASS =3D ArmHvcLib
+
+[Sources]
+ ArmHvcNullLib.c
+
+[Packages]
+ ArmPkg/ArmPkg.dec
+ MdePkg/MdePkg.dec
--=20
2.25.1