From: "Abdul Lateef Attar via groups.io" <AbdulLateef.Attar=amd.com@groups.io>
To: <devel@edk2.groups.io>
Cc: Abdul Lateef Attar <AbdulLateef.Attar@amd.com>,
Abner Chang <abner.chang@amd.com>,
Paul Grimes <paul.grimes@amd.com>
Subject: [edk2-devel] [RESEND 2/7] AmdPlatformPkg: Adds BaseAlwaysFalseDepexLib Library
Date: Wed, 15 May 2024 09:20:20 +0530 [thread overview]
Message-ID: <5b85416b44ae4be3a14839f07c4d8a359754a999.1715744867.git.AbdulLateef.Attar@amd.com> (raw)
In-Reply-To: <cover.1715744867.git.AbdulLateef.Attar@amd.com>
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.chang@amd.com>
Cc: Paul Grimes <paul.grimes@amd.com>
Signed-off-by: Abdul Lateef Attar <AbdulLateef.Attar@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 (#118903): https://edk2.groups.io/g/devel/message/118903
Mute This Topic: https://groups.io/mt/106108332/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-
next prev parent reply other threads:[~2024-05-15 3:52 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-15 3:50 [edk2-devel] [RESEND 0/7] AmdPlatformPkg: Adds board independent modules Abdul Lateef Attar via groups.io
2024-05-15 3:50 ` [edk2-devel] [RESEND 1/7] AmdPlatformPkg: Adds LogoDxe driver Abdul Lateef Attar via groups.io
2024-05-15 3:50 ` Abdul Lateef Attar via groups.io [this message]
2024-05-15 3:50 ` [edk2-devel] [RESEND 3/7] AmdPlatformPkg: Implements SerialPortLib for simulator Abdul Lateef Attar via groups.io
2024-05-15 3:50 ` [edk2-devel] [RESEND 4/7] AmdPlatformPkg: Adds PlatformSocLib library class Abdul Lateef Attar via groups.io
2024-05-15 3:50 ` [edk2-devel] [RESEND 5/7] AmdPlatformPkg: Adds AmdConfigRouting driver Abdul Lateef Attar via groups.io
2024-05-15 3:50 ` [edk2-devel] [RESEND 6/7] AmdPlatformPkg: Adds SecureBootDefaultKeysInit driver Abdul Lateef Attar via groups.io
2024-05-15 3:50 ` [edk2-devel] [RESEND 7/7] AmdPlatformPkg: Adds ACPI common driver Abdul Lateef Attar via groups.io
2024-05-15 3:59 ` [edk2-devel] [RESEND 0/7] AmdPlatformPkg: Adds board independent modules Chang, Abner via groups.io
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=5b85416b44ae4be3a14839f07c4d8a359754a999.1715744867.git.AbdulLateef.Attar@amd.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