From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mx.groups.io with SMTP id smtpd.web10.88677.1638338603901260497 for ; Tue, 30 Nov 2021 22:03:24 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 192.55.52.136, mailfrom: k.kavyax.sravanthi@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10184"; a="216408309" X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="216408309" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2021 22:03:23 -0800 X-IronPort-AV: E=Sophos;i="5.87,278,1631602800"; d="scan'208";a="500107308" Received: from ksravanx-mobl1.gar.corp.intel.com ([10.215.138.78]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Nov 2021 22:03:20 -0800 From: "kavya" To: devel@edk2.groups.io Cc: kavya , Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [PATCH] MinPlatformPkg: Check if the Acpi table is already installed. Date: Wed, 1 Dec 2021 11:32:28 +0530 Message-Id: <20211201060228.7804-1-k.kavyax.sravanthi@intel.com> X-Mailer: git-send-email 2.16.2.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: kavya --- 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