Adds BaseAlwaysFalseDepexLib Library which always
adds DEPEX to FALSE.

Using this library will prevent module/driver being dispatched.

Usage:
MdeModulePkg/Universal/FaultTolerantWriteDxe/FaultTolerantWriteSmm.inf {
  <LibraryClasses>
    
NULL|AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
}

Cc: Abner Chang <abner.ch...@amd.com>
Cc: Paul Grimes <paul.gri...@amd.com>
Signed-off-by: Abdul Lateef Attar <abdullateef.at...@amd.com>
---
 .../AMD/AmdPlatformPkg/AmdPlatformPkg.dsc     |  2 ++
 .../BaseAlwaysFalseDepexLib.c                 | 20 +++++++++++
 .../BaseAlwaysFalseDepexLib.inf               | 35 +++++++++++++++++++
 .../BaseAlwaysFalseDepexLib.uni               | 12 +++++++
 4 files changed, 69 insertions(+)
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.c
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
 create mode 100644 
Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.uni

diff --git a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc 
b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
index 151235b791..e39ad93c83 100644
--- a/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
+++ b/Platform/AMD/AmdPlatformPkg/AmdPlatformPkg.dsc
@@ -24,6 +24,7 @@
 !include MdePkg/MdeLibs.dsc.inc
 
 [LibraryClasses.Common]
+  
AlwaysFalseDepexLib|AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
   BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
   BaseMemoryLib|MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
   
DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/BaseDebugPrintErrorLevelLib.inf
@@ -46,6 +47,7 @@
   
MemoryAllocationLib|MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf
 
 [Components]
+  AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
   AmdPlatformPkg/Universal/LogoDxe/JpegLogoDxe.inf                             
              # Server platform JPEG logo driver
   AmdPlatformPkg/Universal/LogoDxe/LogoDxe.inf                                 
              # Server platfrom Bitmap logo driver
   AmdPlatformPkg/Universal/LogoDxe/S3LogoDxe.inf
diff --git 
a/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.c
 
b/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.c
new file mode 100644
index 0000000000..e9f176223d
--- /dev/null
+++ 
b/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.c
@@ -0,0 +1,20 @@
+/** @file
+  No functionality of this file.
+
+  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+
+/**
+  Empty function to allow Library Class to be valid.
+**/
+VOID
+AlwaysFalsePlaceHolderFunction (
+  VOID
+  )
+{
+}
diff --git 
a/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
 
b/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
new file mode 100644
index 0000000000..4e86256497
--- /dev/null
+++ 
b/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.inf
@@ -0,0 +1,35 @@
+## @file
+#  This is the module used to consume the always false dependency.
+#  Used to not dispatching the specific module included by using
+#  external DSC/FDF include file.
+#  For example: MinPlatformPkg/Include/Dsc/CoreCommonLib.dsc
+#
+#  The module linked with the NULL class BaseAlwaysFalseDepexLib is still
+#  put in the FV however it won't be executed.
+#
+#  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = BaseAlwaysFalseDepexLib
+  MODULE_UNI_FILE                = BaseAlwaysFalseDepexLib.uni
+  FILE_GUID                      = 74DC464F-BC11-4E7D-8829-DD2F911988A8
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = AlwaysFalseDepexLib
+
+#
+#  VALID_ARCHITECTURES           = X64
+#
+
+[Sources]
+  BaseAlwaysFalseDepexLib.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+
+[Depex]
+  FALSE
diff --git 
a/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.uni
 
b/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.uni
new file mode 100644
index 0000000000..5c7ccf1840
--- /dev/null
+++ 
b/Platform/AMD/AmdPlatformPkg/Library/BaseAlwaysFalseDepexLib/BaseAlwaysFalseDepexLib.uni
@@ -0,0 +1,12 @@
+## @file
+#
+#  Copyright (C) 2023 - 2024 Advanced Micro Devices, Inc. All rights reserved.
+#
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+#string STR_MODULE_ABSTRACT             #language en-US "Library instance to 
provide FALSE Depex to prevent running of driver."
+
+#string STR_MODULE_DESCRIPTION          #language en-US "Library instance to 
provide FALSE Depex to prevent running of driver."
+
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#118883): https://edk2.groups.io/g/devel/message/118883
Mute This Topic: https://groups.io/mt/106090921/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to