public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [PATCH] MinPlatformPkg: Check if the Acpi table is already installed.
@ 2021-12-01  6:02 kavya
  0 siblings, 0 replies; only message in thread
From: kavya @ 2021-12-01  6:02 UTC (permalink / raw)
  To: devel; +Cc: kavya, Chasel Chiu, Nate DeSimone, Liming Gao, Eric Dong

Check if Acpi table is already installed by locating Acpi system description
table protocol. If protocol is not installed then continue to install
the acpi table.

Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Eric Dong <eric.dong@intel.com>
Signed-off-by: kavya <k.kavyax.sravanthi@intel.com>
---
 Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
index 785cf4c2f9..03193c99fa 100644
--- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
+++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c
@@ -1053,6 +1053,18 @@ InstallMcfgFromScratch (
   UINTN                                                                                 SegmentCount;
   PCI_SEGMENT_INFO                                                                      *PciSegmentInfo;
   UINTN                                                                                 TableHandle;
+  UINTN                                                                                 Handle;
+  EFI_ACPI_DESCRIPTION_HEADER                                                           *Table;
+
+  Handle = 0;
+  Status = LocateAcpiTableBySignature (
+              EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPPED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE,
+              (EFI_ACPI_DESCRIPTION_HEADER **) &Table,
+              &Handle
+              );
+  if (!EFI_ERROR (Status)) {
+    return EFI_SUCCESS;
+  }
 
   PciSegmentInfo = GetPciSegmentInfo (&SegmentCount);
 
@@ -1368,10 +1380,22 @@ UpdateLocalTable (
   EFI_ACPI_TABLE_VERSION        Version;
   UINTN                         TableHandle;
   UINTN                         Index;
+  UINTN                         Handle;
+  EFI_ACPI_DESCRIPTION_HEADER   *Table;
 
   for (Index = 0; Index < sizeof(mLocalTable)/sizeof(mLocalTable[0]); Index++) {
     CurrentTable = mLocalTable[Index];
 
+    Handle = 0;
+    Status = LocateAcpiTableBySignature (
+                CurrentTable->Signature,
+                (EFI_ACPI_DESCRIPTION_HEADER **) &Table,
+                &Handle
+                );
+    if (!EFI_ERROR (Status)) {
+      continue;
+    }
+
     PlatformUpdateTables (CurrentTable, &Version);
 
     TableHandle = 0;
-- 
2.16.2.windows.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-12-01  6:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-01  6:02 [PATCH] MinPlatformPkg: Check if the Acpi table is already installed kavya

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox