From nobody Fri May 3 03:32:29 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+77473+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77473+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1625468773; cv=none; d=zohomail.com; s=zohoarc; b=kwUwY7g0Glp83d4taOacXeFY6D4phGRO5qem9GDVeOav/AMvewx43QOFJ/tHl4MmIFqlUfXbL7jyN6qT1Ouj3nJYmuWi7ax2n5xpWuh8Ws6DbfZdQe8bG+Qc8+kJbO8DvEfRkoNbvQ8FOsHxw8Yc9y3jfA/SM3IqP5BX0879lIU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625468773; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=NLi5Qk920R+4ArcI2EWrRbubkExdBv8eMZDVglgA5XU=; b=VoxJt/RZ78UXiwnlLMAPkdxFfcIiQFywwFGYX/rf0TuS6HbtiLbkp533wDrwCNo4v7hWs1s3K5xUQt7/r8ooASYxMuhxm0w4PPMEayLOkD/CKyDGhL2QoKYWwYQf2jPyUHqa1FFgFiUcteyDAHJHnTNnzBmpp8OETSsWOTSmo4U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+77473+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 16254687739039.532196999831513; Mon, 5 Jul 2021 00:06:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id ddPOYY1788612xPyedWTIa31; Mon, 05 Jul 2021 00:06:13 -0700 X-Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.7562.1625468771439766276 for ; Mon, 05 Jul 2021 00:06:12 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="208890132" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="208890132" X-Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 00:06:04 -0700 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="496020767" X-Received: from basfe001.gar.corp.intel.com ([10.66.244.207]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 00:06:00 -0700 From: "Ashraf Ali S" To: devel@edk2.groups.io Cc: Ashraf Ali S , Ray Ni , Chasel Chiu , Nate DeSimone , Star Zeng Subject: [edk2-devel] [PATCH] IntelFsp2Pkg: PatchFv parseInfFile function modification Date: Mon, 5 Jul 2021 12:35:45 +0530 Message-Id: MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ashraf.ali.s@intel.com X-Gm-Message-State: pXCuzhezoRSm7Z37T08eR4Ndx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1625468773; bh=T4+m/dVaJFPmEB6sO3ihmoaemO2K01adFS0EkSsKFkI=; h=Cc:Date:From:Reply-To:Subject:To; b=fyxAjn4KKi3md374pGYhhrPeo5OpTvKPtTTNbYa5O8ASoRVB8TCsoySxJwG8qZjH9gM UjPn+XwH42Q1Nv/4SPU9iRCiykAL7mt3rMiptdLd0JIgGTiNWee2MttndpysK3+Pg6+xO NctG2vLi0g/Bj2aZbwSpQS3XFo6SbzYXRe0= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1625468779733100002 Content-Type: text/plain; charset="utf-8" REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D3476 parseInfFile currently reading the EFI_BASE_ADDRESS from INF, once the address found still it's continues to read the complete inf file which is not required. once the EFI_BASE_ADDRESS read from the INF no need to read the INF further. MSFT compiler can generate the map file address 8 or 16 based on which architecture the INF is compiler. currently it's support for IA32, modified the patchfv to support for all. modification of few typo errors in parseModMapFile, getCurr function required Signed-off-by: Ashraf Ali S Cc: Ray Ni Cc: Chasel Chiu Cc: Nate DeSimone Cc: Star Zeng --- IntelFsp2Pkg/Tools/PatchFv.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 112de4077a..623eeb55b8 100644 --- a/IntelFsp2Pkg/Tools/PatchFv.py +++ b/IntelFsp2Pkg/Tools/PatchFv.py @@ -1,6 +1,6 @@ ## @ PatchFv.py # -# Copyright (c) 2014 - 2019, Intel Corporation. All rights reserved.
+# Copyright (c) 2014 - 2021, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent # ## @@ -297,17 +297,18 @@ class Symbols: # fvOffset =3D self.getFvOffsetInFd(infFile[0:-4] + ".Fv") fdIn =3D open(infFile, "r") - rptLine =3D fdIn.readline() + rptLine =3D fdIn.readlines() self.fdBase =3D 0xFFFFFFFF while (rptLine !=3D "" ): #EFI_BASE_ADDRESS =3D 0xFFFDF400 match =3D re.match("^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]+)= ", rptLine) if match is not None: self.fdBase =3D int(match.group(1), 16) - fvOffset + break rptLine =3D fdIn.readline() fdIn.close() if self.fdBase =3D=3D 0xFFFFFFFF: - raise Exception("Could not find EFI_BASE_ADDRESS in INF file!"= % fvFile) + raise Exception("Could not find EFI_BASE_ADDRESS in INF file!"= % infFile) return 0 =20 # @@ -402,6 +403,7 @@ class Symbols: # # retval 0 Parsed MOD MAP file successfully # retval 1 There is no moduleEntryPoint in modSymbols + # retval 2 There is no offset for moduleEntryPoint in = modSymbols # def parseModMapFile(self, moduleName, mapFile): # @@ -426,7 +428,7 @@ class Symbols: else: #MSFT #0003:00000190 _gComBase 00007a50 S= erialPo - patchMapFileMatchString =3D "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}= \s+(\w+)\s+([0-9a-fA-F]{8}\s+)" + patchMapFileMatchString =3D "^\s[0-9a-fA-F]{4}:[0-9a-fA-F]{8}= \s+(\w+)\s+([0-9a-fA-F]{8,16}\s+)" matchKeyGroupIndex =3D 1 matchSymbolGroupIndex =3D 2 prefix =3D '' @@ -455,7 +457,13 @@ class Symbols: continue =20 if not moduleEntryPoint in modSymbols: - return 1 + if matchSymbolGroupIndex =3D=3D 1: + if not '_ModuleEntryPoint' in modSymbols: + return 1 + else: + moduleEntryPoint =3D "_ModuleEntryPoint" + else: + return 1 =20 modEntry =3D '%s:%s' % (moduleName,moduleEntryPoint) if not modEntry in self.dictSymbolAddress: @@ -498,7 +506,7 @@ class Symbols: # # Get current character # - # retval elf.string[self.index] + # retval self.string[self.index] # retval '' Exception # def getCurr(self): --=20 2.30.2.windows.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#77473): https://edk2.groups.io/g/devel/message/77473 Mute This Topic: https://groups.io/mt/83975952/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-