From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by mx.groups.io with SMTP id smtpd.web11.181.1573451582356634471 for ; Sun, 10 Nov 2019 21:53:02 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=FmUnmZeW; spf=pass (domain: intel.com, ip: 134.134.136.31, mailfrom: ethan.tsao@intel.com) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Nov 2019 21:53:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.68,291,1569308400"; d="scan'208";a="215581532" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by orsmga002.jf.intel.com with ESMTP; 10 Nov 2019 21:53:01 -0800 Received: from orsmsx601.amr.corp.intel.com (10.22.229.14) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 10 Nov 2019 21:53:01 -0800 Received: from orsmsx606.amr.corp.intel.com (10.22.229.19) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Sun, 10 Nov 2019 21:53:00 -0800 Received: from ORSEDG001.ED.cps.intel.com (10.7.248.4) by orsmsx606.amr.corp.intel.com (10.22.229.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Sun, 10 Nov 2019 21:53:00 -0800 Received: from NAM05-CO1-obe.outbound.protection.outlook.com (104.47.48.57) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (TLS) id 14.3.439.0; Sun, 10 Nov 2019 21:53:00 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QKkINNXmW3/XH+pwXQKYRhabHbvl9EYLsBdmFcW5L9bZXD9xt3U9+Il8Qx/s1w2lX0VthuQF3qsFcN6Nd7DoZaxJz1TUkacnjSk2IGcyNccfv12Zpfh4g5eOe5LmL6Xiam4JyxQUtpK8/mxDrTCWD8bzniMDopopmbe1viJFwKdev8KtNgWaMpR3IwF5Smt2zSCBnxzfKOoTicZRyGQ2cKVan7SeWauH1iL8nUHH29U3+9fk4s5qLVSoAH2GHl/DRPcXdBEeEcyP6tB4gnVMbWBCCIwWrlzJj6HtgInKezEUqENSWAm5sc+hg9CSRYVgaVej61QRl7o9T37WSOOqig== 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=L4Wl8TkBSKxlXsMZsEK5LLeOm+ymq+vGfgkXu/H8s1c=; b=fbuc/mh3L1fDYUtbY5sIspVz4SXq0mErqgsPP4CLGPLtpS5HBVkBV6Xg0hQ7i4hEgVlvNJeNQaLuYXU7/q/DBHUOsgusHgOrSvD8BbqzRZLSyPFzlvYLXKpylnwFA0Xi4hc2TgICnEppyUnl1Rf5zCBaNkTfeVxb+MwCBMdiTeRnJSSLWD4G1q0Z2/GBMgu+4173y17ZbNTcka+4xdtI4LY1CmXF1VCEOmIo5SJa0CifnZtu49zdJk0HpgANSz8PcgAnopVArzj59qFn3Tilb9VmiMjJiXVI5Ra9n9WTwZRAIM79+trTbARiMI1Yf5ryRicsK6X0IA3LwBWCEoZQ0A== 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=L4Wl8TkBSKxlXsMZsEK5LLeOm+ymq+vGfgkXu/H8s1c=; b=FmUnmZeW7QXQ9HsTqMf57rlfZCki917rHwjVfvwfqkE0arodtu4EvC9z3oVEwwzwszWc46/JNnT/Z06reDAPZauNXypUJM7jYaJ7k23KMygAsL5bxrrjUNgHdgWb4ZQkCrW5Zs4/ZRejTc3lDnIdxs3kK+RvWqFCAnEVeDzQS4w= Received: from MWHPR11MB1662.namprd11.prod.outlook.com (10.172.55.15) by MWHPR11MB1501.namprd11.prod.outlook.com (10.172.54.136) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2430.22; Mon, 11 Nov 2019 05:52:58 +0000 Received: from MWHPR11MB1662.namprd11.prod.outlook.com ([fe80::c3:2ae9:b8a4:e407]) by MWHPR11MB1662.namprd11.prod.outlook.com ([fe80::c3:2ae9:b8a4:e407%9]) with mapi id 15.20.2430.023; Mon, 11 Nov 2019 05:52:58 +0000 From: "Ethan Tsao" To: "Ni, Ray" , "devel@edk2.groups.io" CC: "Chaganty, Rangasai V" Subject: Re: [PATCH] IntelSiliconPkg/Library:Add BaseConfigBlockLib Library Thread-Topic: [PATCH] IntelSiliconPkg/Library:Add BaseConfigBlockLib Library Thread-Index: AQHVlRvJrFzkKZUq1EqIXhOFe7+FQKd/SHjggAATvACAAXHBIIAADxbQgAAF2ICAABbiUIAEhCrw Date: Mon, 11 Nov 2019 05:52:58 +0000 Message-ID: References: <20191107033058.180-1-ethan.tsao@intel.com> <734D49CCEBEEF84792F5B80ED585239D5C352F1D@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C354EC3@SHSMSX104.ccr.corp.intel.com> <734D49CCEBEEF84792F5B80ED585239D5C35515C@SHSMSX104.ccr.corp.intel.com> In-Reply-To: <734D49CCEBEEF84792F5B80ED585239D5C35515C@SHSMSX104.ccr.corp.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiYzQxMTJhNTQtODQ2OS00Mzk2LWE1NDItYWNiYWU1NDJlNGVkIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiVFpTMW1WQVZpakNheXkrM2l4UFVSaDNZblF0V0RSTlRtS2Z2MkhESUZZVm9abm5ON3dxcFwvNWhGeGozbVNTbWIifQ== dlp-version: 11.2.0.6 dlp-reaction: no-action x-ctpclassification: CTP_NT dlp-product: dlpe-windows authentication-results: spf=none (sender IP is ) smtp.mailfrom=ethan.tsao@intel.com; x-originating-ip: [192.55.79.116] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 28ae9395-8fb8-4bcf-96b4-08d7666b67ed x-ms-traffictypediagnostic: MWHPR11MB1501: 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:8882; x-forefront-prvs: 0218A015FA x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(136003)(366004)(346002)(39850400004)(396003)(376002)(13464003)(189003)(199004)(6436002)(8676002)(110136005)(7736002)(66446008)(316002)(229853002)(8936002)(305945005)(81166006)(14444005)(256004)(81156014)(25786009)(30864003)(5660300002)(66556008)(64756008)(9686003)(52536014)(74316002)(76176011)(102836004)(7696005)(53546011)(6506007)(486006)(476003)(186003)(11346002)(446003)(26005)(66476007)(2906002)(66066001)(3846002)(6116002)(14454004)(478600001)(66946007)(76116006)(2501003)(86362001)(107886003)(33656002)(6306002)(55016002)(99286004)(71190400001)(71200400001)(6246003)(4326008)(579004);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR11MB1501;H:MWHPR11MB1662.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: qQHxI1RRvV65YXLLxPwkxIS1SDwLYvlKBeJybQLnskXwKQsUsqgITtyR0FR+5/zDyjP25ycilPuLy0LmyqyDatlR/nHbGCpTJ5yCw6oOg5NEcOsLuMMUN2YauzXkQ5fiSlPjrZHZXoUwkSUQO0xA5VE3abTtr2VH+g7Ma6XqwQQh/UiZLA4EVsv5KwlTKKm76EXBGYCEgEUEwablX6QC+Dlce/OoJgUOkqa/Kth1/vJB/Zvdzku+SQrJyNqHy13iDIykSe6F4J7MgaOC7WA/0K9yjavF3E5qyS46tYIKryr3M/3HjTL6VDUzWRHrQQhc9i8rV673zaB8CH4hghAn4uuxhwnAuBFmm+mMaoHKW7s82VokgT0Gxe/x+msPm/mtj/RLMG6LEz6mJPHoI4z8AzbnW7/8vS1CB3Ej9u2CwfznK/+ivUQWBKX3Up04Vjed MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 28ae9395-8fb8-4bcf-96b4-08d7666b67ed X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Nov 2019 05:52:58.5223 (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: eWWceU3sgwbDV2QN2QeaG6rGOmRbmNKKhC4jrfMoxSWPTtK4LVnqJT/fArKkCJa3fCAAlUHRSYaXy00NFltBdg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1501 Return-Path: ethan.tsao@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Ray, Thanks your input. I will remove this debug message as well. Best Regards, Ethan > -----Original Message----- > From: Ni, Ray > Sent: Friday, November 8, 2019 4:59 PM > To: Tsao, Ethan ; devel@edk2.groups.io > Cc: Chaganty, Rangasai V > Subject: RE: [PATCH] IntelSiliconPkg/Library:Add BaseConfigBlockLib Libra= ry >=20 > When a API needs enough buffer prepared by caller, there are two styles o= f APIs: > 1. Status FillBuffer (VOID *Buffer, UINTN BufferSize) > BufferSize is passed by value so the API has no way to return back t= he > required size. > It's ok as long as the caller is able to calculate the proper size b= ased on > context. >=20 > 2. Status FillBuffer (VOID *Buffer, UINTN &BufferSize) > BufferSize is passed by pointer so the API can return back the requi= red size. >=20 > In this case, if API cannot return back the buffer size back to caller, b= ut caller is > able to calculate the size before calling the API, it follows the style #= 1 which is > still ok. >=20 > In general, we cannot design a API to use debug messages tell caller the = buffer > size. >=20 > Thanks, > Ray >=20 > > -----Original Message----- > > From: Tsao, Ethan > > Sent: Friday, November 8, 2019 3:40 PM > > To: Ni, Ray ; devel@edk2.groups.io > > Cc: Chaganty, Rangasai V > > Subject: RE: [PATCH] IntelSiliconPkg/Library:Add BaseConfigBlockLib > > Library > > > > Hi Ray, > > There is one debug message print available and requested Config block > > size while Config Block table is not enough to add new. > > Caller only know size is not enough by return status. With this debug > > message, Caller can know how many size need to enlarge. > > What do you think to keep this debug message? > > > > DEBUG ((DEBUG_ERROR, "Available Config Block Size: 0x%x bytes / > > Requested Config Block Size: 0x%x bytes\n", ConfigBlkTblAddrPtr- > > >AvailableSize, ConfigBlkSize)); > > > > Best Regards, > > Ethan > > > > > -----Original Message----- > > > From: Tsao, Ethan > > > Sent: Friday, November 8, 2019 3:17 PM > > > To: Ni, Ray ; devel@edk2.groups.io > > > Cc: Chaganty, Rangasai V > > > Subject: RE: [PATCH] IntelSiliconPkg/Library:Add BaseConfigBlockLib > > > Library > > > > > > Hi Ray, > > > I do agree with you. I will remove all debug message since all error > > > scenario can be cover by return status. > > > Caller can understanding through return status. > > > > > > Best Regards, > > > Ethan > > > > > > > -----Original Message----- > > > > From: Ni, Ray > > > > Sent: Friday, November 8, 2019 2:25 PM > > > > To: Tsao, Ethan ; devel@edk2.groups.io > > > > Cc: Chaganty, Rangasai V > > > > Subject: RE: [PATCH] IntelSiliconPkg/Library:Add > > > > BaseConfigBlockLib Library > > > > > > > > Ethan, > > > > What if all of the debug message are removed? > > > > Library especially very fundamental like ConfigBlock is better to b= e quite. > > > > It's the ConfigBlock API designer's responsibility to ensure the > > > > error is returned properly to caller, otherwise it's the API's bug. > > > > When the API can return correct status out, it's caller's > > > > responsibility to check the status and do proper handling of the er= rors. > > > > > > > > With the debug message added in this fundamental library, it may > > > > give callers wrong impression that the library itself can handle > > > > the error and callers don't need to check the error status. > > > > > > > > If we search code in MdePkg, quite few debug messages are printed > > > > out from library code. > > > > > > > > Thanks, > > > > Ray > > > > > > > > > -----Original Message----- > > > > > From: Tsao, Ethan > > > > > Sent: Thursday, November 7, 2019 4:14 PM > > > > > To: Ni, Ray ; devel@edk2.groups.io > > > > > Cc: Chaganty, Rangasai V > > > > > Subject: RE: [PATCH] IntelSiliconPkg/Library:Add > > > > > BaseConfigBlockLib Library > > > > > > > > > > Hi Ray, > > > > > Thanks your good input. I just review all debug message and most > > > > > print is for error report purpose, such as allocate memory failur= e,...etc. > > > > > From my opinion, this kind debug message is useful for BIOS when > > > > > unexpected error happen. In normal case, it will not be print. > > > > > > > > > > Best Regards, > > > > > Ethan > > > > > > > > > > > -----Original Message----- > > > > > > From: Ni, Ray > > > > > > Sent: Thursday, November 7, 2019 3:15 PM > > > > > > To: Tsao, Ethan ; > > > > > > edk2-devel@lists.01.org > > > > > > Cc: Chaganty, Rangasai V > > > > > > Subject: RE: [PATCH] IntelSiliconPkg/Library:Add > > > > > > BaseConfigBlockLib Library > > > > > > > > > > > > Given the patch only moves the code from one place to another, > > > > > > I am ok > > > > > with > > > > > > that. > > > > > > > > > > > > By the way, is it still valuable to have so many debug > > > > > > messages everywhere > > > > > in > > > > > > this library? > > > > > > If no, can we remove them or at least some of them? > > > > > > > > > > > > Debug messages are valuable I agree. But we also need to think > > > > > > about > > > > > producing > > > > > > helpful debug messages, not treated by platform developers as > > > > > > noise > > > > > > : ) > > > > > > > > > > > > > > > > > > > -----Original Message----- > > > > > > > From: Tsao, Ethan > > > > > > > Sent: Thursday, November 7, 2019 11:31 AM > > > > > > > To: edk2-devel@lists.01.org > > > > > > > Cc: Chaganty, Rangasai V ; > > > > > > > Ni, Ray > > > > > > > Subject: [PATCH] IntelSiliconPkg/Library:Add > > > > > > > BaseConfigBlockLib Library > > > > > > > > > > > > > > REF:https://bugzilla.tianocore.org/show_bug.cgi?id=3D2318 > > > > > > > > > > > > > > Establish one copy of Config blocks library class and > > > > > > > instance in IntelSiliconPkg and remove copies from other > > > > > > > silicon packages , like KabyLakeSiliconPkg, CoffelakeSiliconP= kg. > > > > > > > > > > > > > > Signed-off-by: Ethan Tsao > > > > > > > Cc: Sai Chaganty > > > > > > > Cc: Ray Ni > > > > > > > --- > > > > > > > > > > > > > > > > > > > Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlockLib/Ba > > > > > se > > > > > Co > > > > > nf > > > > > igBlo > > > > > > > ckLib.c | 146 --------------------------= ---------------------------- > - > > ---- > > > -- > > > > > ---- > > > > > > - > > > > > > > ------------------------------------------------------------ > > > > > > > -- > > > > > > > -- > > > > > > > -- > > > > > > > ---- > > > > > > > ---------- > > > > > > > > > > > > > > > > > > > Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlockLib/Ba > > > > > se > > > > > Co > > > > > nf > > > > > igBlo > > > > > > > ckLib.inf | 29 --------------------------= --- > > > > > > > Silicon/Intel/{KabylakeSiliconPkg =3D> > > > > > > > IntelSiliconPkg}/Library/BaseConfigBlockLib/BaseConfigBlockLi= b.c | > > 0 > > > > > > > Silicon/Intel/{KabylakeSiliconPkg =3D> > > > > > > > IntelSiliconPkg}/Library/BaseConfigBlockLib/BaseConfigBlockL > > > > > > > ib.inf > > | 0 > > > > > > > 4 files changed, 175 deletions(-) > > > > > > > > > > > > > > diff --git > > > > > > > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlock > > > > > > > Li > > > > > > > b/ > > > > > > > Ba > > > > > > > seCo > > > > > > > nfigB > > > > > > > lockLib.c > > > > > > > b/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlock > > > > > > > Li > > > > > > > b/ > > > > > > > Ba > > > > > > > seCo > > > > > > > nfig > > > > > > > BlockLib.c > > > > > > > deleted file mode 100644 > > > > > > > index 369dab97ee..0000000000 > > > > > > > --- > > > > > > > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlock > > > > > > > Li > > > > > > > b/ > > > > > > > Ba > > > > > > > seCo > > > > > > > nfigB > > > > > > > lockLib.c > > > > > > > +++ /dev/null > > > > > > > @@ -1,146 +0,0 @@ > > > > > > > -/** @file > > > > > > > - Library functions for Config Block management. > > > > > > > - > > > > > > > - Copyright (c) 2019 Intel Corporation. All rights reserved. > > > > > > >
> > > > > > > - > > > > > > > - SPDX-License-Identifier: BSD-2-Clause-Patent -**/ > > > > > > > - > > > > > > > -#include > > > > > > > -#include -#include > > > > > > > -#include > > > > > > > -#include > > > > > > > > > > > > > > - > > > > > > > -/** > > > > > > > - Create config block table > > > > > > > - > > > > > > > - @param[in] TotalSize - Max size to = be allocated for the > > > > > Config > > > > > > > Block Table > > > > > > > - @param[out] ConfigBlockTableAddress - On return, p= oints to > > a > > > > > pointer > > > > > > > to the beginning of Config Block Table Address > > > > > > > - > > > > > > > - @retval EFI_INVALID_PARAMETER - Invalid Parameter > > > > > > > - @retval EFI_OUT_OF_RESOURCES - Out of resources > > > > > > > - @retval EFI_SUCCESS - Successfully created Confi= g Block > > Table at > > > > > > > ConfigBlockTableAddress > > > > > > > -**/ > > > > > > > -EFI_STATUS > > > > > > > -EFIAPI > > > > > > > -CreateConfigBlockTable ( > > > > > > > - IN UINT16 TotalSize, > > > > > > > - OUT VOID **ConfigBlockTableAddress > > > > > > > - ) > > > > > > > -{ > > > > > > > - CONFIG_BLOCK_TABLE_HEADER *ConfigBlkTblAddrPtr; > > > > > > > - UINT32 ConfigBlkTblHdrSize; > > > > > > > - > > > > > > > - ConfigBlkTblHdrSize =3D (UINT32)(sizeof > > > > > (CONFIG_BLOCK_TABLE_HEADER)); > > > > > > > - > > > > > > > - if (TotalSize <=3D (ConfigBlkTblHdrSize + sizeof > > > > > (CONFIG_BLOCK_HEADER))) { > > > > > > > - DEBUG ((DEBUG_ERROR, "Invalid Parameter\n")); > > > > > > > - return EFI_INVALID_PARAMETER; > > > > > > > - } > > > > > > > - > > > > > > > - ConfigBlkTblAddrPtr =3D (CONFIG_BLOCK_TABLE_HEADER > > > > > *)AllocateZeroPool > > > > > > > (TotalSize); > > > > > > > - if (ConfigBlkTblAddrPtr =3D=3D NULL) { > > > > > > > - DEBUG ((DEBUG_ERROR, "Could not allocate memory.\n")); > > > > > > > - return EFI_OUT_OF_RESOURCES; > > > > > > > - } > > > > > > > - ConfigBlkTblAddrPtr->NumberOfBlocks =3D 0; > > > > > > > - ConfigBlkTblAddrPtr->Header.GuidHob.Header.HobLength =3D > > > > > > > TotalSize; > > > > > > > - ConfigBlkTblAddrPtr->AvailableSize =3D TotalSize - > > > > > > > ConfigBlkTblHdrSize; > > > > > > > - > > > > > > > - *ConfigBlockTableAddress =3D (VOID *)ConfigBlkTblAddrPtr; > > > > > > > - > > > > > > > - return EFI_SUCCESS; > > > > > > > -} > > > > > > > - > > > > > > > -/** > > > > > > > - Add config block into config block table structure > > > > > > > - > > > > > > > - @param[in] ConfigBlockTableAddress - A pointer to= the > > beginning > > > > > of > > > > > > > Config Block Table Address > > > > > > > - @param[out] ConfigBlockAddress - On return, p= oints to a > > > pointer > > > > > to > > > > > > > the beginning of Config Block Address > > > > > > > - > > > > > > > - @retval EFI_OUT_OF_RESOURCES - Config Block Table is full > > > > > > > and cannot add new Config Block or > > > > > > > - Config Block Offset Table i= s full and cannot add > > new > > > > > Config > > > > > > > Block. > > > > > > > - @retval EFI_SUCCESS - Successfully added Config B= lock > > > > > > > -**/ > > > > > > > -EFI_STATUS > > > > > > > -EFIAPI > > > > > > > -AddConfigBlock ( > > > > > > > - IN VOID *ConfigBlockTableAddress, > > > > > > > - OUT VOID **ConfigBlockAddress > > > > > > > - ) > > > > > > > -{ > > > > > > > - CONFIG_BLOCK *TempConfigBlk; > > > > > > > - CONFIG_BLOCK_TABLE_HEADER *ConfigBlkTblAddrPtr; > > > > > > > - CONFIG_BLOCK *ConfigBlkAddrPtr; > > > > > > > - UINT16 ConfigBlkSize; > > > > > > > - > > > > > > > - ConfigBlkTblAddrPtr =3D (CONFIG_BLOCK_TABLE_HEADER > > > > > > > *)ConfigBlockTableAddress; > > > > > > > - ConfigBlkAddrPtr =3D (CONFIG_BLOCK *)(*ConfigBlockAddress)= ; > > > > > > > - ConfigBlkSize =3D > > > > > > > ConfigBlkAddrPtr->Header.GuidHob.Header.HobLength; > > > > > > > - DEBUG ((DEBUG_INFO, "Config Block GUID: %g / Config Block = Size: > > > > > > > 0x%x bytes\n", &(ConfigBlkAddrPtr->Header.GuidHob.Name), > > > > > > > ConfigBlkSize)); > > > > > > > - if ((ConfigBlkSize % 4) !=3D 0) { > > > > > > > - DEBUG ((DEBUG_ERROR, "Config Block must be multiples of = 4 > > > > > bytes\n")); > > > > > > > - return EFI_INVALID_PARAMETER; > > > > > > > - } > > > > > > > - if (ConfigBlkTblAddrPtr->AvailableSize < ConfigBlkSize) { > > > > > > > - DEBUG ((DEBUG_ERROR, "Config Block Table is full and can= not > > add > > > > > new > > > > > > > Config Block.\n")); > > > > > > > - DEBUG ((DEBUG_ERROR, "Available Config Block Size: 0x%x = bytes > > / > > > > > > > Requested Config Block Size: 0x%x bytes\n", > > > > > > > ConfigBlkTblAddrPtr- > > > > > > > >AvailableSize, ConfigBlkSize)); > > > > > > > - return EFI_OUT_OF_RESOURCES; > > > > > > > - } > > > > > > > - > > > > > > > - TempConfigBlk =3D (CONFIG_BLOCK > > > > > > > *)((UINTN)ConfigBlkTblAddrPtr > > > > > > > + (UINTN)(ConfigBlkTblAddrPtr- > > >Header.GuidHob.Header.HobLength > > > > > > > - > > > > > > > ConfigBlkTblAddrPtr->AvailableSize)); > > > > > > > - CopyMem (&TempConfigBlk->Header, &ConfigBlkAddrPtr- > > >Header, > > > > > > > sizeof(CONFIG_BLOCK_HEADER)); > > > > > > > - > > > > > > > - ConfigBlkTblAddrPtr->NumberOfBlocks++; > > > > > > > - ConfigBlkTblAddrPtr->AvailableSize =3D > > > > > > > ConfigBlkTblAddrPtr->AvailableSize - ConfigBlkSize; > > > > > > > - > > > > > > > - *ConfigBlockAddress =3D (VOID *) TempConfigBlk; > > > > > > > - DEBUG ((DEBUG_INFO, "Config Block Address: 0x%x / > > > > > > > Available Config Block Size: 0x%x bytes\n", > > > > > > > (UINT32)(UINTN)*ConfigBlockAddress, > > > > > > > ConfigBlkTblAddrPtr->AvailableSize)); > > > > > > > - return EFI_SUCCESS; > > > > > > > -} > > > > > > > - > > > > > > > -/** > > > > > > > - Retrieve a specific Config Block data by GUID > > > > > > > - > > > > > > > - @param[in] ConfigBlockTableAddress - A pointer t= o the > > beginning > > > > > of > > > > > > > Config Block Table Address > > > > > > > - @param[in] ConfigBlockGuid - A pointer t= o the GUID > > uses to > > > > > > > search specific Config Block > > > > > > > - @param[out] ConfigBlockAddress - On return, = points to a > > > > > pointer to > > > > > > > the beginning of Config Block Address > > > > > > > - > > > > > > > - @retval EFI_NOT_FOUND - Could not find the Config = Block > > > > > > > - @retval EFI_SUCCESS - Config Block found and ret= urn > > > > > > > -**/ > > > > > > > -EFI_STATUS > > > > > > > -EFIAPI > > > > > > > -GetConfigBlock ( > > > > > > > - IN VOID *ConfigBlockTableAddress, > > > > > > > - IN EFI_GUID *ConfigBlockGuid, > > > > > > > - OUT VOID **ConfigBlockAddress > > > > > > > - ) > > > > > > > -{ > > > > > > > - UINT16 OffsetIndex; > > > > > > > - CONFIG_BLOCK *TempConfigBlk; > > > > > > > - CONFIG_BLOCK_TABLE_HEADER *ConfigBlkTblAddrPtr; > > > > > > > - UINT32 ConfigBlkTblHdrSize; > > > > > > > - UINT32 ConfigBlkOffset; > > > > > > > - UINT16 NumOfBlocks; > > > > > > > - > > > > > > > - ConfigBlkTblHdrSize =3D (UINT32)(sizeof > > > > > (CONFIG_BLOCK_TABLE_HEADER)); > > > > > > > - ConfigBlkTblAddrPtr =3D (CONFIG_BLOCK_TABLE_HEADER > > > > > > > *)ConfigBlockTableAddress; > > > > > > > - NumOfBlocks =3D ConfigBlkTblAddrPtr->NumberOfBlocks; > > > > > > > - > > > > > > > - ConfigBlkOffset =3D 0; > > > > > > > - for (OffsetIndex =3D 0; OffsetIndex < NumOfBlocks; > > > > > > > OffsetIndex++) > > { > > > > > > > - if ((ConfigBlkTblHdrSize + ConfigBlkOffset) > > > (ConfigBlkTblAddrPtr- > > > > > > > >Header.GuidHob.Header.HobLength)) { > > > > > > > - break; > > > > > > > - } > > > > > > > - TempConfigBlk =3D (CONFIG_BLOCK > > *)((UINTN)ConfigBlkTblAddrPtr + > > > > > > > (UINTN)ConfigBlkTblHdrSize + (UINTN)ConfigBlkOffset); > > > > > > > - if (CompareGuid (&(TempConfigBlk->Header.GuidHob.Name), > > > > > > > ConfigBlockGuid)) { > > > > > > > - *ConfigBlockAddress =3D (VOID *)TempConfigBlk; > > > > > > > - return EFI_SUCCESS; > > > > > > > - } > > > > > > > - ConfigBlkOffset =3D ConfigBlkOffset + TempConfigBlk- > > > > > > > >Header.GuidHob.Header.HobLength; > > > > > > > - } > > > > > > > - DEBUG ((DEBUG_ERROR, "Could not find the config > > > > > > > block.\n")); > > > > > > > - return EFI_NOT_FOUND; > > > > > > > -} > > > > > > > diff --git > > > > > > > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlock > > > > > > > Li > > > > > > > b/ > > > > > > > Ba > > > > > > > seCo > > > > > > > nfigB > > > > > > > lockLib.inf > > > > > > > b/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlock > > > > > > > Li > > > > > > > b/ > > > > > > > Ba > > > > > > > seCo > > > > > > > nfig > > > > > > > BlockLib.inf > > > > > > > deleted file mode 100644 > > > > > > > index a7def2481d..0000000000 > > > > > > > --- > > > > > > > a/Silicon/Intel/CoffeelakeSiliconPkg/Library/BaseConfigBlock > > > > > > > Li > > > > > > > b/ > > > > > > > Ba > > > > > > > seCo > > > > > > > nfigB > > > > > > > lockLib.inf > > > > > > > +++ /dev/null > > > > > > > @@ -1,29 +0,0 @@ > > > > > > > -## @file > > > > > > > -# Component INF file for the BaseConfigBlock library. > > > > > > > -# > > > > > > > -# Copyright (c) 2019 Intel Corporation. All rights reserved. > > > > > > >
-# -# SPDX-License-Identifier: BSD-2-Clause-Patent -# > > > > > > > -## > > > > > > > - > > > > > > > -[Defines] > > > > > > > -INF_VERSION =3D 0x00010017 > > > > > > > -BASE_NAME =3D BaseConfigBlockLib -FILE_GUID =3D > > > > > > > 1EC07EA8-7808-4e06-9D79-309AE331D2D5 > > > > > > > -VERSION_STRING =3D 1.0 > > > > > > > -MODULE_TYPE =3D BASE > > > > > > > -LIBRARY_CLASS =3D ConfigBlockLib > > > > > > > - > > > > > > > - > > > > > > > -[Packages] > > > > > > > -MdePkg/MdePkg.dec > > > > > > > -CoffeelakeSiliconPkg/SiPkg.dec > > > > > > > - > > > > > > > -[Sources] > > > > > > > -BaseConfigBlockLib.c > > > > > > > - > > > > > > > -[LibraryClasses] > > > > > > > -DebugLib > > > > > > > -BaseMemoryLib > > > > > > > -MemoryAllocationLib > > > > > > > diff --git > > > > > > > a/Silicon/Intel/KabylakeSiliconPkg/Library/BaseConfigBlockLi > > > > > > > b/ > > > > > > > Ba > > > > > > > se > > > > > > > Conf > > > > > > > igBlo > > > > > > > ckLib.c > > > > > > > b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/B > > > > > > > as > > > > > > > eC > > > > > > > on > > > > > > > figB > > > > > > > lockLi > > > > > > > b.c > > > > > > > similarity index 100% > > > > > > > rename from > > > > > > > Silicon/Intel/KabylakeSiliconPkg/Library/BaseConfigBlockLib/ > > > > > > > Ba > > > > > > > se > > > > > > > Co > > > > > > > nfig > > > > > > > Block > > > > > > > Lib.c > > > > > > > rename to > > > > > > > Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/Bas > > > > > > > eC > > > > > > > on > > > > > > > fi > > > > > > > gBlo > > > > > > > ckLib.c > > > > > > > diff --git > > > > > > > a/Silicon/Intel/KabylakeSiliconPkg/Library/BaseConfigBlockLi > > > > > > > b/ > > > > > > > Ba > > > > > > > se > > > > > > > Conf > > > > > > > igBlo > > > > > > > ckLib.inf > > > > > > > b/Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/B > > > > > > > as > > > > > > > eC > > > > > > > on > > > > > > > figB > > > > > > > lockLi > > > > > > > b.inf > > > > > > > similarity index 100% > > > > > > > rename from > > > > > > > Silicon/Intel/KabylakeSiliconPkg/Library/BaseConfigBlockLib/ > > > > > > > Ba > > > > > > > se > > > > > > > Co > > > > > > > nfig > > > > > > > Block > > > > > > > Lib.inf > > > > > > > rename to > > > > > > > Silicon/Intel/IntelSiliconPkg/Library/BaseConfigBlockLib/Bas > > > > > > > eC > > > > > > > on > > > > > > > fi > > > > > > > gBlo > > > > > > > ckLib.i > > > > > > > nf > > > > > > > -- > > > > > > > 2.16.2.windows.1 > > > > > > > > > > > > > > > > > >=20