From nobody Sat May 18 23:55:15 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+77474+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+77474+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1625472459; cv=none; d=zohomail.com; s=zohoarc; b=aPEkaZ64XcqD0AnxtoATUgeNqZnz6pyZL5VrZyOtrS2YPRHOQznQjsoU3mJA/eNMhHqrBGhvxG6JFOgYT35jpDv4+ZYvXefa+/hs5503DN+a5JwOSIeixzRZZfF/wMsEKjDoKtAdUui8iGuhrgKGimek1mDKYE2WOkXfldWV1eQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1625472459; 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=pyw8b/bj7vVvEQUGewQf+/vWUJ20HXCDPuaJuRpCXRQ=; b=jP4UzVq2dzRZYHhrCj3QVm85rtVrpJzYDMvyeQJH/07T4MurFRMy18a0Ymk4ZDzoKpEDs2hw5rl8tlcAUAhn1ogyQzmmgb1fGIGXBmCf9e8amzfs9Kf+TyomtUAgkS9I3NP6o/51Pyubqmai26+IfosDnu8jkBrZb4pXFfNB+vQ= 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+77474+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 1625472459668269.7027759962001; Mon, 5 Jul 2021 01:07:39 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id H4TWYY1788612xbRFE4zS8Zt; Mon, 05 Jul 2021 01:07:39 -0700 X-Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mx.groups.io with SMTP id smtpd.web12.8081.1625472453315514137 for ; Mon, 05 Jul 2021 01:07:33 -0700 X-IronPort-AV: E=McAfee;i="6200,9189,10035"; a="272792125" X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="272792125" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 01:07:29 -0700 X-IronPort-AV: E=Sophos;i="5.83,325,1616482800"; d="scan'208";a="490928207" X-Received: from basfe001.gar.corp.intel.com ([10.66.244.207]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2021 01:07:27 -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 13:36:54 +0530 Message-Id: <0956afefed4e9314879c4a6661ad96b4633d1568.1625472387.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: d26EKB2SJ5fjRO9bqRyhe80wx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1625472459; bh=Y21tc6UlwWVwxsZ4mvbcw6DafK+ZnkTz/gGXM/B2fPY=; h=Cc:Date:From:Reply-To:Subject:To; b=b5n16AanEOTyPeX9l3EnZ2t3v+rS0oXsg2uVJfky8yextTsQb/mfo3FLvoBz6nUTHON eOjeVFAadduuDTyHs3N8/DzWBYJkwjxxpMb44vH+vwYmytp+lCQ0umNkKM9UmBY4d05+n +tcR7iVm3Rq+dkXvvIShMfShPcWKe9A/ubo= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1625472467074100001 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 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/IntelFsp2Pkg/Tools/PatchFv.py b/IntelFsp2Pkg/Tools/PatchFv.py index 112de4077a..64b4e927a0 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 # ## @@ -304,10 +304,11 @@ class Symbols: 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 (#77474): https://edk2.groups.io/g/devel/message/77474 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-