From nobody Mon Apr 29 06:47:42 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+77457+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+77457+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1625397349; cv=none; d=zohomail.com; s=zohoarc; b=TlDx+Ln1p+tkBv6pwk3cMx9LTTVfUkKX+9ZmP3xru5GGWIZjp/paQDMWkISe7HUtfM7L9rIGvjzWYw8ns6zqEab/eOzp5EwZliQOo1rNGlBsLOz8nXKASafDPTDNoqtfbh/iNsGPJ8DfMFaxCSFYsr8fWeMVUdew1GFx0hrEMOY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625397349; 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=n0mG6w7nU2JnhcPAuklMxEoadrdTgL+hUiato+Mlqkg=; b=JMvo6jkb7e/MS+McOee+AAy6gcZovV+8eDhKC5uJvGjBPgF/Tv8siMWBzIlH9mg7S443AketZ41uUa3jiZlRY5rzCrYVF13zs02YmcPF16ajpXyxERtNFOAfpXzydR37okjlMbPJepGXq02QGUNe2XSwfzgwCPw23tGwpXJhIk8= 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+77457+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 1625397349695818.0591343551209; Sun, 4 Jul 2021 04:15:49 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id 94MlYY1788612xLMNJruWyTz; Sun, 04 Jul 2021 04:15:49 -0700 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.8209.1625397347743765610 for ; Sun, 04 Jul 2021 04:15:48 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10034"; a="208911456" X-IronPort-AV: E=Sophos;i="5.83,323,1616482800"; d="scan'208";a="208911456" X-Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2021 04:15:40 -0700 X-IronPort-AV: E=Sophos;i="5.83,323,1616482800"; d="scan'208";a="627123215" X-Received: from basfe001.gar.corp.intel.com ([10.66.244.207]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Jul 2021 04:15:33 -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: Sun, 4 Jul 2021 16:45:07 +0530 Message-Id: <987973b2ab6a5d949109c99bc8a46ba79de0580a.1625396731.git.ashraf.ali.s@intel.com> 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: nEmAu4qyOPV6F6JMyaBr9Ul9x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1625397349; bh=KHgToPTXrT1X9T4Va4evt0ditghWApotQ3u4jQnS1Kw=; h=Cc:Date:From:Reply-To:Subject:To; b=Fxho3ArhXMSoM1ePajTyz6X0DfOBsgwiczC3H0k72j+0Lc7pXR+EAivNyNRwBHBhLYO jHdwNxIbOOipYVA2xnJRsB0OOQUWUzpoFSXa5F8y15dVobHDFS8jJDiKOvvQBci/Z/QTz d4UH7+bHcMt3Os4E3f1niuXe6xRctqKWc5I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1625397354941100002 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, it can be update the X64 in future. 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 | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 112de4077a..765dfed8ef 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,16 @@ class Symbols: # fvOffset =3D self.getFvOffsetInFd(infFile[0:-4] + ".Fv") fdIn =3D open(infFile, "r") - rptLine =3D fdIn.readline() + rptLines =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) + for line in rptLines: + match =3D re.match("^EFI_BASE_ADDRESS\s*=3D\s*(0x[a-fA-F0-9]+)= ", line) if match is not None: self.fdBase =3D int(match.group(1), 16) - fvOffset - rptLine =3D fdIn.readline() + break 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 +401,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 +426,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 '' @@ -498,7 +498,7 @@ class Symbols: # # Get current character # - # retval elf.string[self.index] + # retval self.string[self.index] # retval '' Exception # def getCurr(self): --=20 2.26.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 (#77457): https://edk2.groups.io/g/devel/message/77457 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-