From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=ziFhV+js; spf=pass (domain: intel.com, ip: 134.134.136.65, mailfrom: michael.a.kubacki@intel.com) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by groups.io with SMTP; Thu, 03 Oct 2019 11:05:30 -0700 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2019 11:05:30 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.67,253,1566889200"; d="scan'208";a="185992876" Received: from fmsmsx107.amr.corp.intel.com ([10.18.124.205]) by orsmga008.jf.intel.com with ESMTP; 03 Oct 2019 11:05:29 -0700 Received: from fmsmsx121.amr.corp.intel.com (10.18.125.36) by fmsmsx107.amr.corp.intel.com (10.18.124.205) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 11:05:29 -0700 Received: from FMSEDG001.ED.cps.intel.com (10.1.192.133) by fmsmsx121.amr.corp.intel.com (10.18.125.36) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 11:05:29 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.52) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 3 Oct 2019 11:05:20 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=lsUSwtgTmMfy2XTCcdNkHsMoPDmiSxy3jpChryUostzgm6g78hrn3jZgF+l7N/a5OUSh614tBBIhI2qb93tH78J1g9sC9Onuh+G53Q9znoJHjew6KlJtUt2A38yKaQQbDR3UUiaAj6k5SMm3Sciz02hwO3All1nnJqaG1b8FdqOM7SoOH678tBY9mdLs+T4JLxA1NhntdzWuJC4ErD/cWV15hUWyokfJNTucD9rnFqCoWX5ZjPDUmIoJwSFRbYINzPmnTxyQctDNTXiUKe1x0oD9Q01JDuBzhbmdK/GAOPd1Rb4FD0o5VHtnvXGlT/yccKL6bytYdT5SqAdfhMQtCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ppABlg37fpRyBWn0pz7V9q7cXBNFgppV5wepYbn6E8=; b=idMEFCjaibk5Blqi+dZPx1kel3gdkxnol0hR9EUvdMZyB+BBSCTXSqarVf89Vb2KtkpAtHaRHEb4hwsouwxVW1Jm1z2KFx9N93GY9neFZkKZtpKGNKsnDNwUX2bXTqcO3GKc9VFyZHKcDJD0lHDZIauoWmp3h67QRY5nU0hkB/divQIljU1jXa8kNqqQg9B3YHhKyjRLcK0Ca5DWX/c7alZbDBd6nYXviLK80OQl+6t/YwVzE4+uXSQX3PdP6HR3pDC1DpXerJ4XrlmBWOPnknYBJdaka6DvGh/cdmtvl0qBmNGGvVY19HTE2Tz8MYh1HfwlOMQFv1U7WkqarbUQtQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ppABlg37fpRyBWn0pz7V9q7cXBNFgppV5wepYbn6E8=; b=ziFhV+jse0GujYF/tAq1NKqKSmzFz2pz8ZMzMZ+Lltm86M6wtYP3LImlWYWbR9qXw1LXPqYtkoWPJ+AnuZT1iYtQO29UbbZULtG2I8s8grQBRTQ0PRXtDrExrCa8Cm+XOiOHXJOMbSzopuQFRhRqhkH1+E0MB5DVn0aPRHqpvH0= Received: from DM6PR11MB3834.namprd11.prod.outlook.com (20.179.17.87) by DM6PR11MB3084.namprd11.prod.outlook.com (20.177.218.213) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2305.20; Thu, 3 Oct 2019 18:04:47 +0000 Received: from DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::59cc:8a30:6b9e:584e]) by DM6PR11MB3834.namprd11.prod.outlook.com ([fe80::59cc:8a30:6b9e:584e%3]) with mapi id 15.20.2305.023; Thu, 3 Oct 2019 18:04:47 +0000 From: "Kubacki, Michael A" To: "Wu, Hao A" , "devel@edk2.groups.io" CC: "Bi, Dandan" , Ard Biesheuvel , "Dong, Eric" , Laszlo Ersek , "Gao, Liming" , "Kinney, Michael D" , "Ni, Ray" , "Wang, Jian J" , "Yao, Jiewen" Subject: Re: [PATCH V2 2/9] MdeModulePkg/Variable: Parameterize GetNextVariableEx() store list Thread-Topic: [PATCH V2 2/9] MdeModulePkg/Variable: Parameterize GetNextVariableEx() store list Thread-Index: AQHVdZ61whsGybAqqEC3YhFUf6CSOadCKeKggAcM2tA= Date: Thu, 3 Oct 2019 18:04:46 +0000 Message-ID: References: <20190928014717.31372-1-michael.a.kubacki@intel.com> <20190928014717.31372-3-michael.a.kubacki@intel.com> In-Reply-To: Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiM2Y1ZjhkNDItZTA0ZS00NzYyLWJkMWUtOGFiNDAyOWUwYzI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiT0ZKcUtmY3VSWWRCbzJyTUhqZ2tidGlVT1NKV2VzcHRQbkM4RlAxa3lmYUVIaGk0WXlZWG5NTmJnQktGdVVhcCJ9 dlp-reaction: no-action dlp-version: 11.2.0.6 authentication-results: spf=none (sender IP is ) smtp.mailfrom=michael.a.kubacki@intel.com; x-originating-ip: [134.134.136.217] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ea7eae15-64de-493f-dfb5-08d7482c2d43 x-ms-traffictypediagnostic: DM6PR11MB3084: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 01792087B6 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(376002)(346002)(39860400002)(136003)(396003)(366004)(189003)(51914003)(13464003)(199004)(7696005)(71200400001)(71190400001)(2501003)(76176011)(8676002)(186003)(30864003)(8936002)(102836004)(25786009)(476003)(99286004)(7736002)(3846002)(6116002)(66066001)(4326008)(110136005)(76116006)(305945005)(54906003)(81166006)(81156014)(26005)(52536014)(316002)(66476007)(66946007)(64756008)(66446008)(74316002)(66556008)(33656002)(107886003)(86362001)(6246003)(14454004)(486006)(14444005)(5660300002)(55016002)(9686003)(2906002)(478600001)(6506007)(6436002)(256004)(229853002)(53546011)(446003)(11346002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM6PR11MB3084;H:DM6PR11MB3834.namprd11.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lyODTdQ1an98g2tC6OgdvB2bQ+9u+tmscqYg3NuvCZPbTdWwmQjbUZYv3dJrDhWNaAPAhadUPPYhfTK9y3dlEsx4fvuRfghx8mD3+dDE6yP+ubQQFzSwCd4O5+cFIoJ4D5oIcpuINB2iXt6yNkruXTzcLKSnfPzm5qKVt4MFyhnuu4M8CoXx4cpDIKqjXv7zZSKgkd80+0i9Y8fTHG4AoHg31TNyWhykqNoDorjecs66Zy5ifMct1VTkvr5kVQjhhDYZn87uZCn34f/izCp1ZOkm4p4s57vUyA6W0sDvz5/Eth4p2rga9ga2+hjRL96RC8fCiCmG4BbJX/4+tS6IsBcANp5eoAlmRlhI7avDGJfX+NhgBOdFJCuDuBnSjjYYY+cGxPcHmxg47FJfBJROz+phbed3VeMQPt6WHtDN9g8= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: ea7eae15-64de-493f-dfb5-08d7482c2d43 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Oct 2019 18:04:46.9299 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: UBwZ8GwPqvRKw8LpPv5aao81NABXEcYYRW+4gg+XmACzOhzxYs0ed+kb50Z/DbxCuPrdm5wmAYKea9CZnYeRsd/PajdYUe36us4W94KV2Sw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB3084 Return-Path: michael.a.kubacki@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Thanks for the feedback, I'll rename it back to VariableServiceGetNextVaria= bleInternal () and update the comments to refer to FindVariableEx () instead of FindVaria= ble () in V3. Thanks, Michael > -----Original Message----- > From: Wu, Hao A > Sent: Thursday, October 3, 2019 1:03 AM > To: Kubacki, Michael A ; > devel@edk2.groups.io > Cc: Bi, Dandan ; Ard Biesheuvel > ; Dong, Eric ; Laszlo Ers= ek > ; Gao, Liming ; Kinney, Michael > D ; Ni, Ray ; Wang, Jian J > ; Yao, Jiewen > Subject: RE: [PATCH V2 2/9] MdeModulePkg/Variable: Parameterize > GetNextVariableEx() store list >=20 > A couple of inline comments below: >=20 >=20 > > -----Original Message----- > > From: Kubacki, Michael A > > Sent: Saturday, September 28, 2019 9:47 AM > > To: devel@edk2.groups.io > > Cc: Bi, Dandan; Ard Biesheuvel; Dong, Eric; Laszlo Ersek; Gao, Liming; > > Kinney, Michael D; Ni, Ray; Wang, Jian J; Wu, Hao A; Yao, Jiewen > > Subject: [PATCH V2 2/9] MdeModulePkg/Variable: Parameterize > > GetNextVariableEx() store list > > > > The majority of logic related to GetNextVariableName () is currently > > implemented in VariableServiceGetNextVariableInternal (). The list of > > variable stores to search for the given variable name and variable > > GUID is defined in the function body. This change renames the function > > to GetNextVariableEx () since the function is no longer internal to a > > specific source file and adds a new parameter so that the caller must > > pass in the list of variable stores to be used in the variable search. >=20 >=20 > I am not sure if 'GetNextVariableEx' is a good name for the function, sin= ce: >=20 > 1. There is no function named GetNextVariable(), so it is not clear what = "Ex" > means here. >=20 > 2. The origin function VariableServiceGetNextVariableInternal() does get > used > in multiple source files (Variable.c & VariableExLib.c). I am not sure= what > is the intention for such renaming. >=20 >=20 > > > > Cc: Dandan Bi > > Cc: Ard Biesheuvel > > Cc: Eric Dong > > Cc: Laszlo Ersek > > Cc: Liming Gao > > Cc: Michael D Kinney > > Cc: Ray Ni > > Cc: Jian J Wang > > Cc: Hao A Wu > > Cc: Jiewen Yao > > Signed-off-by: Michael Kubacki > > --- > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h | 15 > ++- > > - > > MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c | 12 ++- > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c | 8 +- > > MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c | 78 > > ++++++++++++-------- > > 4 files changed, 73 insertions(+), 40 deletions(-) > > > > diff --git > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > index 9d77c4916c..0d231511ea 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.h > > @@ -248,27 +248,30 @@ FindVariableEx ( > > ); > > > > /** > > - This code Finds the Next available variable. > > + This code finds the next available variable. > > > > Caution: This function may receive untrusted input. > > This function may be invoked in SMM mode. This function will do > > basic validation, before parse the data. > > > > - @param[in] VariableName Pointer to variable name. > > - @param[in] VendorGuid Variable Vendor Guid. > > - @param[out] VariablePtr Pointer to variable header address. > > + @param[in] VariableName Pointer to variable name. > > + @param[in] VendorGuid Variable Vendor Guid. > > + @param[in] VariableStoreList A list of variable stores that should > > + be used > > to get the next variable. > > + The maximum number of entries is the > > + max value of > > VARIABLE_STORE_TYPE. > > + @param[out] VariablePtr Pointer to variable header address. > > > > @retval EFI_SUCCESS The function completed successfully. > > @retval EFI_NOT_FOUND The next variable was not found. > > - @retval EFI_INVALID_PARAMETER If VariableName is not an empty > > string, while VendorGuid is NULL. > > + @retval EFI_INVALID_PARAMETER If VariableName is nt an empty > > + string, > > while VendorGuid is NULL. > > @retval EFI_INVALID_PARAMETER The input values of VariableName and > > VendorGuid are not a name and > > GUID of an existing variable. > > > > **/ > > EFI_STATUS > > EFIAPI > > -VariableServiceGetNextVariableInternal ( > > +GetNextVariableEx ( > > IN CHAR16 *VariableName, > > IN EFI_GUID *VendorGuid, > > + IN VARIABLE_STORE_HEADER **VariableStoreList, > > OUT VARIABLE_HEADER **VariablePtr > > ); > > > > diff --git a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > index 76536308e6..816e8f7b8f 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/Variable.c > > @@ -2358,6 +2358,7 @@ VariableServiceGetNextVariableName ( > > UINTN MaxLen; > > UINTN VarNameSize; > > VARIABLE_HEADER *VariablePtr; > > + VARIABLE_STORE_HEADER > > *VariableStoreHeader[VariableStoreTypeMax]; > > > > if (VariableNameSize =3D=3D NULL || VariableName =3D=3D NULL || Vend= orGuid > > =3D=3D > > NULL) { > > return EFI_INVALID_PARAMETER; > > @@ -2377,7 +2378,16 @@ VariableServiceGetNextVariableName ( > > > > AcquireLockOnlyAtBootTime(&mVariableModuleGlobal- > > >VariableGlobal.VariableServicesLock); > > > > - Status =3D VariableServiceGetNextVariableInternal (VariableName, > > VendorGuid, &VariablePtr); > > + // > > + // 0: Volatile, 1: HOB, 2: Non-Volatile. > > + // The index and attributes mapping must be kept in this order as > > FindVariable > > + // makes use of this mapping to implement search algorithm. > > + // > > + VariableStoreHeader[VariableStoreTypeVolatile] =3D > > (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal- > > >VariableGlobal.VolatileVariableBase; > > + VariableStoreHeader[VariableStoreTypeHob] =3D > > (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal- > > >VariableGlobal.HobVariableBase; > > + VariableStoreHeader[VariableStoreTypeNv] =3D mNvVariableCache; > > + > > + Status =3D GetNextVariableEx (VariableName, VendorGuid, > > VariableStoreHeader, &VariablePtr); > > if (!EFI_ERROR (Status)) { > > VarNameSize =3D NameSizeOfVariable (VariablePtr); > > ASSERT (VarNameSize !=3D 0); > > diff --git > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c > > index dc78f68fa9..232d9ffe25 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableExLib.c > > @@ -98,10 +98,16 @@ VariableExLibFindNextVariable ( > > EFI_STATUS Status; > > VARIABLE_HEADER *VariablePtr; > > AUTHENTICATED_VARIABLE_HEADER *AuthVariablePtr; > > + VARIABLE_STORE_HEADER > > *VariableStoreHeader[VariableStoreTypeMax]; > > > > - Status =3D VariableServiceGetNextVariableInternal ( > > + VariableStoreHeader[VariableStoreTypeVolatile] =3D > > (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal- > > >VariableGlobal.VolatileVariableBase; > > + VariableStoreHeader[VariableStoreTypeHob] =3D > > (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal- > > >VariableGlobal.HobVariableBase; > > + VariableStoreHeader[VariableStoreTypeNv] =3D mNvVariableCache; > > + > > + Status =3D GetNextVariableEx ( > > VariableName, > > VendorGuid, > > + VariableStoreHeader, > > &VariablePtr > > ); > > if (EFI_ERROR (Status)) { > > diff --git > > a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > index 7de0a90772..9bc5369a90 100644 > > --- a/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > +++ b/MdeModulePkg/Universal/Variable/RuntimeDxe/VariableParsing.c > > @@ -476,14 +476,16 @@ FindVariableEx ( } > > > > /** > > - This code Finds the Next available variable. > > + This code finds the next available variable. > > > > Caution: This function may receive untrusted input. > > This function may be invoked in SMM mode. This function will do > > basic validation, before parse the data. > > > > - @param[in] VariableName Pointer to variable name. > > - @param[in] VendorGuid Variable Vendor Guid. > > - @param[out] VariablePtr Pointer to variable header address. > > + @param[in] VariableName Pointer to variable name. > > + @param[in] VendorGuid Variable Vendor Guid. > > + @param[in] VariableStoreList A list of variable stores that should > > + be used > > to get the next variable. > > + The maximum number of entries is the > > + max value of > > VARIABLE_STORE_TYPE. > > + @param[out] VariablePtr Pointer to variable header address. > > > > @retval EFI_SUCCESS The function completed successfully. > > @retval EFI_NOT_FOUND The next variable was not found. > > @@ -494,20 +496,41 @@ FindVariableEx ( **/ EFI_STATUS EFIAPI > > -VariableServiceGetNextVariableInternal ( > > +GetNextVariableEx ( > > IN CHAR16 *VariableName, > > IN EFI_GUID *VendorGuid, > > + IN VARIABLE_STORE_HEADER **VariableStoreList, > > OUT VARIABLE_HEADER **VariablePtr > > ) > > { > > - VARIABLE_STORE_TYPE Type; > > + EFI_STATUS Status; > > + VARIABLE_STORE_TYPE StoreType; > > VARIABLE_POINTER_TRACK Variable; > > VARIABLE_POINTER_TRACK VariableInHob; > > VARIABLE_POINTER_TRACK VariablePtrTrack; > > - EFI_STATUS Status; > > - VARIABLE_STORE_HEADER > *VariableStoreHeader[VariableStoreTypeMax]; > > > > - Status =3D FindVariable (VariableName, VendorGuid, &Variable, > > &mVariableModuleGlobal->VariableGlobal, FALSE); > > + Status =3D EFI_NOT_FOUND; > > + > > + if (VariableStoreList =3D=3D NULL) { > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + // Check if the variable exists in the given variable store list > > + for (StoreType =3D (VARIABLE_STORE_TYPE) 0; StoreType < > > VariableStoreTypeMax; StoreType++) { > > + if (VariableStoreList[StoreType] =3D=3D NULL) { > > + continue; > > + } > > + > > + Variable.StartPtr =3D GetStartPointer (VariableStoreList[StoreType= ]); > > + Variable.EndPtr =3D GetEndPointer (VariableStoreList[StoreType= ]); > > + Variable.Volatile =3D (BOOLEAN) (StoreType =3D=3D > > + VariableStoreTypeVolatile); > > + > > + Status =3D FindVariableEx (VariableName, VendorGuid, FALSE, &Varia= ble); > > + if (!EFI_ERROR (Status)) { > > + break; > > + } > > + } > > + > > if (Variable.CurrPtr =3D=3D NULL || EFI_ERROR (Status)) { > > // > > // For VariableName is an empty string, FindVariable() will try > > to find and >=20 >=20 > Some description comments within this function that mention > "FindVariable()" > can be updated. Since the calling of the FindVariable() has been replaced= by > the above 'for' loop. >=20 >=20 > Best Regards, > Hao Wu >=20 >=20 > > return > > @@ -527,39 +550,30 @@ VariableServiceGetNextVariableInternal ( > > > > if (VariableName[0] !=3D 0) { > > // > > - // If variable name is not NULL, get next variable. > > + // If variable name is not empty, get next variable. > > // > > Variable.CurrPtr =3D GetNextVariablePtr (Variable.CurrPtr); > > } > > > > - // > > - // 0: Volatile, 1: HOB, 2: Non-Volatile. > > - // The index and attributes mapping must be kept in this order as > > FindVariable > > - // makes use of this mapping to implement search algorithm. > > - // > > - VariableStoreHeader[VariableStoreTypeVolatile] =3D > > (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal- > > >VariableGlobal.VolatileVariableBase; > > - VariableStoreHeader[VariableStoreTypeHob] =3D > > (VARIABLE_STORE_HEADER *) (UINTN) mVariableModuleGlobal- > > >VariableGlobal.HobVariableBase; > > - VariableStoreHeader[VariableStoreTypeNv] =3D mNvVariableCache; > > - > > while (TRUE) { > > // > > - // Switch from Volatile to HOB, to Non-Volatile. > > + // Switch to the next variable store if needed > > // > > while (!IsValidVariableHeader (Variable.CurrPtr, Variable.EndPtr))= { > > // > > // Find current storage index > > // > > - for (Type =3D (VARIABLE_STORE_TYPE) 0; Type < VariableStoreTypeM= ax; > > Type++) { > > - if ((VariableStoreHeader[Type] !=3D NULL) && (Variable.StartPt= r =3D=3D > > GetStartPointer (VariableStoreHeader[Type]))) { > > + for (StoreType =3D (VARIABLE_STORE_TYPE) 0; StoreType < > > VariableStoreTypeMax; StoreType++) { > > + if ((VariableStoreList[StoreType] !=3D NULL) && > > + (Variable.StartPtr =3D=3D > > GetStartPointer (VariableStoreList[StoreType]))) { > > break; > > } > > } > > - ASSERT (Type < VariableStoreTypeMax); > > + ASSERT (StoreType < VariableStoreTypeMax); > > // > > // Switch to next storage > > // > > - for (Type++; Type < VariableStoreTypeMax; Type++) { > > - if (VariableStoreHeader[Type] !=3D NULL) { > > + for (StoreType++; StoreType < VariableStoreTypeMax; StoreType++)= { > > + if (VariableStoreList[StoreType] !=3D NULL) { > > break; > > } > > } > > @@ -568,12 +582,12 @@ VariableServiceGetNextVariableInternal ( > > // 1. current storage is the last one, or > > // 2. no further storage > > // > > - if (Type =3D=3D VariableStoreTypeMax) { > > + if (StoreType =3D=3D VariableStoreTypeMax) { > > Status =3D EFI_NOT_FOUND; > > goto Done; > > } > > - Variable.StartPtr =3D GetStartPointer (VariableStoreHeader[Type]= ); > > - Variable.EndPtr =3D GetEndPointer (VariableStoreHeader[Type]= ); > > + Variable.StartPtr =3D GetStartPointer (VariableStoreList[StoreTy= pe]); > > + Variable.EndPtr =3D GetEndPointer (VariableStoreList[StoreTy= pe]); > > Variable.CurrPtr =3D Variable.StartPtr; > > } > > > > @@ -605,11 +619,11 @@ VariableServiceGetNextVariableInternal ( > > // > > // Don't return NV variable when HOB overrides it > > // > > - if ((VariableStoreHeader[VariableStoreTypeHob] !=3D NULL) && > > (VariableStoreHeader[VariableStoreTypeNv] !=3D NULL) && > > - (Variable.StartPtr =3D=3D GetStartPointer > > (VariableStoreHeader[VariableStoreTypeNv])) > > + if ((VariableStoreList[VariableStoreTypeHob] !=3D NULL) && > > (VariableStoreList[VariableStoreTypeNv] !=3D NULL) && > > + (Variable.StartPtr =3D=3D GetStartPointer > > (VariableStoreList[VariableStoreTypeNv])) > > ) { > > - VariableInHob.StartPtr =3D GetStartPointer > > (VariableStoreHeader[VariableStoreTypeHob]); > > - VariableInHob.EndPtr =3D GetEndPointer > > (VariableStoreHeader[VariableStoreTypeHob]); > > + VariableInHob.StartPtr =3D GetStartPointer > > (VariableStoreList[VariableStoreTypeHob]); > > + VariableInHob.EndPtr =3D GetEndPointer > > (VariableStoreList[VariableStoreTypeHob]); > > Status =3D FindVariableEx ( > > GetVariableNamePtr (Variable.CurrPtr), > > GetVendorGuidPtr (Variable.CurrPtr), > > -- > > 2.16.2.windows.1 >=20