From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id CFE5C78003C for ; Thu, 4 Apr 2024 03:02:07 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=NUvEVSeZs3949bXIz/5iwePsBUy1Mytj4SenfGu17v4=; c=relaxed/simple; d=groups.io; h=From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:msip_labels:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1712199726; v=1; b=gOc2qA+l8Za/L7bSlsq+b9ICA3LQpZgYkylgee45XZSYSJUHn/kyy8bqqYA4hwEY/kHkhWQC pC/hdjXGTw7zA1yU0k+kmvf3EWWT81+thgl+hJM5Hl5w4RZsEia/78JLOab+vqugQx46uQm8YZJ k54yNEHgzeqxgc7KeE/Q75CPmV8FFTAj4QEcgtIvwr2LIAm/T7SANw2sBOIfqeKmqz4iuJGIopy bS6jx3dAwtWTJiY7ew1YSwt2YiVKkXwpk0uYpq5eIKejmqrNN1qAFxZBnvjGtbTjKg8SJPl1Ony RchO8eHz/0jklaiL1cmoUpGD/1W0bj9/6BUqSEhdUyTPA== X-Received: by 127.0.0.2 with SMTP id xwDOYY7687511xikmPCBc4sO; Wed, 03 Apr 2024 20:02:06 -0700 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (NAM12-MW2-obe.outbound.protection.outlook.com [40.107.244.126]) by mx.groups.io with SMTP id smtpd.web10.30016.1712199725634216795 for ; Wed, 03 Apr 2024 20:02:05 -0700 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com (2603:10b6:408:200::8) by PH8PR12MB7184.namprd12.prod.outlook.com (2603:10b6:510:227::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.31; Thu, 4 Apr 2024 03:02:02 +0000 X-Received: from LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::e006:4173:de2c:aca0]) by LV8PR12MB9452.namprd12.prod.outlook.com ([fe80::e006:4173:de2c:aca0%5]) with mapi id 15.20.7409.042; Thu, 4 Apr 2024 03:02:02 +0000 From: "Chang, Abner via groups.io" To: Nickle Wang , "devel@edk2.groups.io" CC: Igor Kulchytskyy Subject: Re: [edk2-devel] [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization Thread-Topic: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config language searching optimization Thread-Index: AQHaf5B43FOsoNjhM0ygHBzoksV9xbFK4JEQgAyY2eA= Date: Thu, 4 Apr 2024 03:02:02 +0000 Message-ID: References: <20240326151503.106-1-abner.chang@amd.com> <20240326151503.106-2-abner.chang@amd.com> In-Reply-To: Accept-Language: en-US, zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ActionId=9440edd7-6e54-4960-ab6d-47d2c0266df8;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_ContentBits=0;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Enabled=true;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Method=Standard;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_Name=General;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SetDate=2024-04-04T03:00:38Z;MSIP_Label_4342314e-0df4-4b58-84bf-38bed6170a0f_SiteId=3dd8961f-e488-4e60-8e11-a82d994e183d; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: LV8PR12MB9452:EE_|PH8PR12MB7184:EE_ x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: rg9haELFkqAqZZ4hJHq3Cji0VG0k7gIlzMCMBo4rE+L0MXy7YmCGc9VtnjMLiERqg7/toaKPO6NYca1rWpHEGhF+eSxbSODefbPIYT6oUdJfmyxiMRBYHU/PEFhEcY7kJVsHsaZYPqYNVfisBM8klkgpjojOBkb8Gc5rx+LWWt9F3FMM3wyBInno6XvrA0Aw3ez+sG92m1mlKWibx15a88KFVAV8Ra2rs/rNsYdNoZ39im88CL5MCrk2FPMPXnN9Zz+4CHZsESdLJ080q4Eo38ILZ/DMYPTvOc0zNPvtlDYIYNmr5EwwQZ08eAKA4MtSi6dkuberV+USHmtX1C+GlJ7/0pvVuecoQCLNnoKPzrIcEuMoPlI833rTXk0i60BXeedW6t6ClYHswAEaE+CEOOInbwyN0LOwSIOGphw0AVFp8FEyhru/+UktqWWk4YZVQydQpqYxjOJgUUxbTMlGmOjvmq7toPuUBJ7kKsUj634nNkpfjNeuFs9OIma+0FJq0Ujl/agXVbwraJVFWvXUlNSV+vL24nFBYX5q4pxtkb4cjx38BDOL3L49ipmVdVtPAdnV1EyqwtNkIYxHzyw0CIMnPSNfSt1WBChlzLtsNRzCGap+yl4byaQMJCq9S6SufIFiaEINqg4y1C2snos5vNKxhAWa6nR6jG1lE75iWXs= x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Kyx7roAR+4Qf6g90FTjlVZdvG8aReFbb059aZg6zwtzqoWgwYVWI9WU3nKdM?= =?us-ascii?Q?VnO58u1UxpmC89Yo3KYyedpdqKt9Mqb9mJRSOcGKv35c7rxx8oZgTHANAdmi?= =?us-ascii?Q?JOkRYBjqL+7GPcj6jax4K/R5fR8zk2E8V2gV+xNv/JckaNz8uSePMEPrxLAt?= =?us-ascii?Q?SWRr2Gn+zbCp120IPZ7qNTkbev3KeDPqmyOW+jn4IIZInavwDUvi93dDBvaD?= =?us-ascii?Q?3wU/nPulZXiJHynKWLjtRX2rW4VcyGCKkJWdbeNoWVPVzIkqqoLTn5W583iJ?= =?us-ascii?Q?hcNrSuP6tXwNFHQOCMchKndUq/UfouQZtEhRvCx5brcCePSbVb4HyB9htYgh?= =?us-ascii?Q?BrQBJrJhpQOYQWgJBGWExOwkz+TKgDXMIjdBlnf57K/EP5Npl+e7ilqgEmeY?= =?us-ascii?Q?RB4v72s3HZovFz9K5yMRtPM9tgd0LdlW1S+WVtBHJEOjkLrIVEeoOgW038rw?= =?us-ascii?Q?JMbUJP1cY9Vj6B23PoLKx3nAIws5JPvfNzSV4SvCf+N6PY1BL+sa3pNSl9KV?= =?us-ascii?Q?FQzln2J0YCtHvIm81AVERCVDNvFg5L0gKJ7k2Qaq+zgxbD0j5tNjPzVXDT6m?= =?us-ascii?Q?RLp1fTJtYZ2DV7mncSgEYhyL93q52KaX/cpiuJZ7592BB39H1/FnE0B90vTs?= =?us-ascii?Q?RdW8uQAf8D2ZMAr+iBgjjNN2eNtwcRcf6Rpdh1ANg9kYJYS4M6WaGiN3x+/v?= =?us-ascii?Q?BHs47DmSALAFYmUDREOZxZ+2PdeDbz6gJCSHBbThiLHVsx9REQYHh0svLZyR?= =?us-ascii?Q?sHazbCvGZgwuy/cACJRRKQ+E0tAseDYNG7r7PFqMkY9SWzP0+LCEYTq4bXPY?= =?us-ascii?Q?Z+LCVdgCxbnnrn/LuLUx9c5+ajrikcTDfaoVjmRt0zfXuMRqO0cMhTWLiLPf?= =?us-ascii?Q?cO/fA2bGA6rkm5S23/hg9w1fDwzu8p8JXBDYYYPYcT37jcpsI7Ink74RKTnd?= =?us-ascii?Q?ASL50UlrVbel5xlX9pQ8oAlM5/lfmVq9c5CjbfnYYKcU1SK40zEQCexctMo8?= =?us-ascii?Q?n0cYi31/nvY5ZOy4p99/CQsvQgnft0Pvzo/OPtPhcrvMGNHLV9qpD+/8Wqo7?= =?us-ascii?Q?t8Qd/cSWBIcXJWNZsjxfXS5hh8mO5hTF/CzNfhGPrsvswwEReN6xz1FCJPio?= =?us-ascii?Q?h7boidZb9C2QyzpJLWpjEAvidFrRG99EMBs5pxb3TepalzWLpEq2mZJLa8zZ?= =?us-ascii?Q?xm/3yASP1YqFMeZV1u0zHPHrQ2i048pw6Qocf52DTGv6TI7DoYWC5OgrmeZT?= =?us-ascii?Q?fHPdJdkLARF6Nev8BNsaE0qxynSFqUQBImLxresUkf1a3FWe/vwA/pW4oHSP?= =?us-ascii?Q?Dh+Z2RVFQ3TOreWhRkd5UgjOmYyBLOldmewZjHUCLVa8AyZxk4QF8F2L/xde?= =?us-ascii?Q?TXfLzjt1A6tEpBULcOycWVg+3kRJsDK+NvLav3R5XZHuYEnDIxzz8WATu9Vu?= =?us-ascii?Q?MwvB8ugIbSNPUl01Mrh6xrPliwSPf4VapH79noPI/90nmcTzUhlfgBn9svFN?= =?us-ascii?Q?4RRodozTL7NBK8hw7bCA0B3V5+UOvHYb8Y8NukdSughnrFvjg4ZmCqbIhb5N?= =?us-ascii?Q?HS1ZGnDnV2M83Decjw4=3D?= MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: LV8PR12MB9452.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8cd17667-2ec9-4124-70b2-08dc54539a01 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Apr 2024 03:02:02.2211 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: QggqCvfghmCMnzvUsIRor4JCEqV/PYxer7DljCKbKYj++/4pdKaKj2yBRpQFHeq3IrLnqFyA+x6XNUb2Xc2v9w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7184 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 03 Apr 2024 20:02:05 -0700 Resent-From: abner.chang@amd.com Reply-To: devel@edk2.groups.io,abner.chang@amd.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: r3KllhRsJfHeNq5INySd5KX5x7686176AA= Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=gOc2qA+l; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io [AMD Official Use Only - General] Hi Nickle, I will rename it and send out the V3 together with Igor's commen= ts addressed. Thanks Abner > -----Original Message----- > From: Nickle Wang > Sent: Wednesday, March 27, 2024 10:40 AM > To: Chang, Abner ; devel@edk2.groups.io > Cc: Igor Kulchytskyy > Subject: RE: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config > language searching optimization > > Caution: This message originated from an External Source. Use proper caut= ion > when opening attachments, clicking links, or responding. > > > Hi Abner, > > Could we change "DescriptionStr" below to something like "XuefiString", s= o > people don't think it is a regular English string of HII statement? > > > + EFI_STRING_ID Description; // Strin= g token of this > question. > > + CHAR16 *DescriptionStr; // Strin= g of this question. > > + EFI_STRING_ID Help; // Strin= g token of help message. > > > Thanks, > Nickle > > > -----Original Message----- > > From: abner.chang@amd.com > > Sent: Tuesday, March 26, 2024 11:15 PM > > To: devel@edk2.groups.io > > Cc: Nickle Wang ; Igor Kulchytskyy > > Subject: [PATCH V2 1/6] RedfishPkg/RedfishPlatformConfigDxe: Config > language > > searching optimization > > > > External email: Use caution opening links or attachments > > > > > > From: abnchang > > > > Build up the x-uefi-redfish string database for the Redfish confg langu= age > > searching, instead of using HII String protocol. > > This can improve the time consumption lot on searching strings. > > > > Signed-off-by: Abner Chang > > Co-authored-by: Nickle Wang > > Cc: Igor Kulchytskyy > > --- > > .../RedfishPlatformConfigImpl.h | 107 ++- > > .../RedfishPlatformConfigDxe.c | 23 +- > > .../RedfishPlatformConfigImpl.c | 820 +++++++++++++++++- > > 3 files changed, 878 insertions(+), 72 deletions(-) > > > > diff --git > a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h > > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h > > index 9f4312decf5..6e6c7fdb8a9 100644 > > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h > > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.h > > @@ -2,7 +2,8 @@ > > This file defines the EDKII Redfish Platform Config Protocol private > structure. > > > > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP > > - Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights > > reserved. > > + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights > > reserved. > > + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights > > + reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -30,6 +31,10 @@ > > #define ENGLISH_LANGUAGE_CODE "en-US" > > #define X_UEFI_SCHEMA_PREFIX "x-uefi-redfish-" > > > > +#define MAX_X_UEFI_REDFISH_STRING_SIZE (128 * 2)// 128 character in > UCS. > > + > > +typedef struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE > > +REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE; > > + > > // > > // Definition of REDFISH_PLATFORM_CONFIG_PRIVATE. > > // > > @@ -46,17 +51,49 @@ typedef struct { > > CHAR8 **SchemaList; // Schema list > > } REDFISH_PLATFORM_CONFIG_SCHEMA; > > > > +// Defines the number of elements in array #define > > +X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER 1024 > > + > > +// > > +// Definition of x-uefi-redfish string element. > > +// > > +typedef struct { > > + EFI_STRING_ID StringId; > > + CHAR16 *UcsString; > > +} REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT; > > + > > +// > > +// Discrete string array buffer, each has > > X_UEFI_REDFISH_STRING_ARRAY_NUMBER element. > > +// > > +typedef struct { > > + LIST_ENTRY NextArray; > > + REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT *ArrayEntryAddress; > > +} REDFISH_X_UEFI_STRINGS_ARRAY; > > + > > +// > > +// x-uefi-redfish string database, x-uefi-redfish language based. > > +// > > +typedef struct { > > + LIST_ENTRY NextXuefiRedfishLanguage; = // Link to the > > next suppoted x-uefi-Redfish language. > > + CHAR8 *XuefiRedfishLanguage; = // x-uefi-redfish > > language. > > + UINTN StringsArrayBlocks; = // Number of the > array > > blocks that accommodate X_UEFI_REDFISH_STRING_ARRAY_NUMBER > > + = // elements in each. > > + LIST_ENTRY XuefiRedfishStringArrays; = // Link entry of > x- > > uefi-redfish string array. > > +} REDFISH_X_UEFI_STRING_DATABASE; > > + > > // > > // Definition of REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE > > // > > typedef struct { > > LIST_ENTRY Link; > > - HII_FORMSET *HiiFormSet; // Pointer to HII= formset data. > > - EFI_GUID Guid; // Formset GUID. > > - EFI_HII_HANDLE HiiHandle; // Hii Handle of = this formset. > > - LIST_ENTRY HiiFormList; // Form list that= keep form data > under > > this formset. > > - CHAR16 *DevicePathStr; // Device path of= this formset. > > - REDFISH_PLATFORM_CONFIG_SCHEMA SupportedSchema; // Schema > that is > > supported in this formset. > > + HII_FORMSET *HiiFormSet; // Poi= nter to HII formset > data. > > + EFI_GUID Guid; // For= mset GUID. > > + EFI_HII_HANDLE HiiHandle; // Hii= Handle of this formset. > > + EFI_HII_PACKAGE_LIST_HEADER *HiiPackageListHeader; // Hii > Package > > list header. > > + LIST_ENTRY HiiFormList; // For= m list that keep form > data > > under this formset. > > + CHAR16 *DevicePathStr; // Dev= ice path of this formset. > > + REDFISH_PLATFORM_CONFIG_SCHEMA SupportedSchema; // > Schema > > that is supported in this formset. > > + LIST_ENTRY XuefiRedfishStringDatabase; // x-u= efi-redfish > > string/Id data base; > > } REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE; > > > > #define REDFISH_PLATFORM_CONFIG_FORMSET_FROM_LINK(a) BASE_CR > (a, > > REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE, Link) @@ -90,19 > +127,19 > > @@ typedef struct { // // Definition of > > REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE > > // > > -typedef struct { > > +struct _REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE { > > LIST_ENTRY Link; > > REDFISH_PLATFORM_CONFIG_FORM_PRIVATE *ParentForm; > > - HII_STATEMENT *HiiStatement; // Pointer= to HII statement > > data. > > - EFI_QUESTION_ID QuestionId; // Questio= n ID of this > > statement. > > - EFI_STRING_ID Description; // String = token of this question. > > - EFI_STRING_ID Help; // String = token of help message. > > - EFI_STRING DesStringCache; // The str= ing cache for search > > function. > > - UINT8 Flags; // The sta= tement flag. > > - REDFISH_PLATFORM_CONFIG_STATEMENT_DATA StatementData; // The > > max/min for statement value. > > - BOOLEAN Suppressed; // Stateme= nt is suppressed. > > - BOOLEAN GrayedOut; // Stateme= nt is GrayedOut. > > -} REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE; > > + HII_STATEMENT *HiiStatement; // Point= er to HII statement > > data. > > + EFI_QUESTION_ID QuestionId; // Quest= ion ID of this > > statement. > > + EFI_STRING_ID Description; // Strin= g token of this > question. > > + CHAR16 *DescriptionStr; // Strin= g of this question. > > + EFI_STRING_ID Help; // Strin= g token of help message. > > + UINT8 Flags; // The s= tatement flag. > > + REDFISH_PLATFORM_CONFIG_STATEMENT_DATA StatementData; // > The > > max/min for statement value. > > + BOOLEAN Suppressed; // State= ment is suppressed. > > + BOOLEAN GrayedOut; // State= ment is GrayedOut. > > +}; > > > > #define REDFISH_PLATFORM_CONFIG_STATEMENT_FROM_LINK(a) > BASE_CR (a, > > REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE, Link) > > > > @@ -347,4 +384,38 @@ ReleaseStatementList ( > > IN REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_LIST > *StatementList > > ); > > > > +/** > > + Return the HII string length. We don't check word alignment > > + of the input string as the same as the checking in StrLen > > + function. Because the HII string in the database is compact > > + at the byte alignment. > > + > > + @param[in] String Input UCS format string. > > + > > + @retval Length of > > + > > +**/ > > +UINTN > > +EFIAPI > > +HiiStrLen ( > > + IN CONST CHAR16 *String > > + ); > > + > > +/** > > + Return the HII string size. We don't check word alignment > > + of the input string as the same as the checking in StrLen > > + function. Because the HII string in the database is compact > > + at the byte alignment. > > + > > + @param[in] String Input UCS format string. > > + > > + @retval Size of the string. > > + > > +**/ > > +UINTN > > +EFIAPI > > +HiiStrSize ( > > + IN CONST CHAR16 *String > > + ); > > + > > #endif > > diff --git > a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > > index f970e317b3f..664b48eb50e 100644 > > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigDxe.c > > @@ -2,7 +2,8 @@ > > The implementation of EDKII Redfish Platform Config Protocol. > > > > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP > > - Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights > > reserved. > > + Copyright (c) 2022-2024, NVIDIA CORPORATION & AFFILIATES. All rights > > reserved. > > + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights > > + reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -928,6 +929,10 @@ HiiStringToOneOfOptionValue ( > > Option =3D HII_QUESTION_OPTION_FROM_LINK (Link); > > > > TmpString =3D HiiGetRedfishString (Statement->ParentForm- > >ParentFormset- > > >HiiHandle, Schema, Option->Text); > > + if (TmpString =3D=3D NULL) { > > + TmpString =3D HiiGetRedfishString (Statement->ParentForm- > >ParentFormset- > > >HiiHandle, ENGLISH_LANGUAGE_CODE, Option->Text); > > + } > > + > > if (TmpString !=3D NULL) { > > if (StrCmp (TmpString, HiiString) =3D=3D 0) { > > CopyMem (Value, &Option->Value, sizeof (HII_STATEMENT_VALUE)); > @@ - > > 1227,6 +1232,10 @@ HiiStringToOrderedListOptionValue ( > > Option =3D HII_QUESTION_OPTION_FROM_LINK (Link); > > > > TmpString =3D HiiGetRedfishString (Statement->ParentForm- > >ParentFormset- > > >HiiHandle, Schema, Option->Text); > > + if (TmpString =3D=3D NULL) { > > + TmpString =3D HiiGetRedfishString (Statement->ParentForm- > >ParentFormset- > > >HiiHandle, ENGLISH_LANGUAGE_CODE, Option->Text); > > + } > > + > > if (TmpString !=3D NULL) { > > if (StrCmp (TmpString, HiiString) =3D=3D 0) { > > *Value =3D ExtendHiiValueToU64 (&Option->Value); @@ -1491,7 +1= 500,7 > @@ > > StrToAsciiStr ( > > return NULL; > > } > > > > - StringLen =3D StrLen (UnicodeString) + 1; > > + StringLen =3D HiiStrLen (UnicodeString) + 1; > > Buffer =3D AllocatePool (StringLen * sizeof (CHAR8)); > > if (Buffer =3D=3D NULL) { > > return NULL; > > @@ -2000,7 +2009,6 @@ RedfishPlatformConfigProtocolGetConfigureLang > ( > > REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_LIST StatementList; > > REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE_REF *StatementRef; > > LIST_ENTRY *NextLink; > > - EFI_STRING TmpString; > > EFI_STRING *TmpConfigureLangLis= t; > > UINTN Index; > > CHAR8 *FullSchema; > > @@ -2054,12 +2062,9 @@ > RedfishPlatformConfigProtocolGetConfigureLang ( > > > > ASSERT (StatementRef->Statement->Description !=3D 0); > > if (StatementRef->Statement->Description !=3D 0) { > > - TmpString =3D HiiGetRedfishString (StatementRef->Statement- > >ParentForm- > > >ParentFormset->HiiHandle, FullSchema, StatementRef->Statement- > > >Description); > > - ASSERT (TmpString !=3D NULL); > > - if (TmpString !=3D NULL) { > > - TmpConfigureLangList[Index] =3D TmpString; > > - ++Index; > > - } > > + ASSERT (StatementRef->Statement->DescriptionStr !=3D NULL); > > + TmpConfigureLangList[Index] =3D AllocateCopyPool (HiiStrSize > (StatementRef- > > >Statement->DescriptionStr), (VOID *)StatementRef->Statement- > > >DescriptionStr); > > + ++Index; > > } > > } > > } > > diff --git > a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c > > b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c > > index 47d35abc088..8b1ddf4360a 100644 > > --- a/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c > > +++ b/RedfishPkg/RedfishPlatformConfigDxe/RedfishPlatformConfigImpl.c > > @@ -3,6 +3,7 @@ > > > > (C) Copyright 2021-2022 Hewlett Packard Enterprise Development LP > > Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights > > reserved. > > + Copyright (C) 2024 Advanced Micro Devices, Inc. All rights > > + reserved.
> > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -143,6 +144,88 @@ DumpFormsetList ( > > return EFI_SUCCESS; > > } > > > > +/** > > + Return the HII string length. We don't check word alignment > > + of the input string as same as the checking in StrLen > > + function, because the HII string in the database is compact > > + at the byte alignment. > > + > > + @param[in] String Input UCS format string. > > + > > + @retval Length of the string. > > + > > +**/ > > +UINTN > > +EFIAPI > > +HiiStrLen ( > > + IN CONST CHAR16 *String > > + ) > > +{ > > + UINTN Length; > > + > > + ASSERT (String !=3D NULL); > > + > > + for (Length =3D 0; *String !=3D L'\0'; String++, Length++) { } > > + > > + return Length; > > +} > > + > > +/** > > + Return the HII string size. We don't check word alignment > > + of the input string as same as the checking in StrLen > > + function, because the HII string in the database is compact > > + at the byte alignment. > > + > > + @param[in] String Input UCS format string. > > + > > + @retval Size of the string. > > + > > +**/ > > +UINTN > > +EFIAPI > > +HiiStrSize ( > > + IN CONST CHAR16 *String > > + ) > > +{ > > + return (HiiStrLen (String) + 1) * sizeof (*String); } > > + > > +/** > > + Compare two HII strings. We don't check word alignment > > + of the input string as same as the checking in StrLen > > + function, because the HII string in the database is compact > > + at the byte alignment. > > + > > + @param[in] FirstString Input UCS format of string to search. > > + @param[in] SecondString Input UCS format of string to look for in > > + FirstString; > > + > > + @retval 0 The strings are identical. > > + !0 The strings are not identical. > > + > > +**/ > > +INTN > > +EFIAPI > > +HiiStrCmp ( > > + IN CONST CHAR16 *FirstString, > > + IN CONST CHAR16 *SecondString > > + ) > > +{ > > + // > > + // ASSERT both strings are less long than > > +PcdMaximumUnicodeStringLength > > + // > > + ASSERT (HiiStrSize (FirstString) !=3D 0); > > + ASSERT (HiiStrSize (SecondString) !=3D 0); > > + > > + while ((*FirstString !=3D L'\0') && (*FirstString =3D=3D *SecondStri= ng)) { > > + FirstString++; > > + SecondString++; > > + } > > + > > + return *FirstString - *SecondString; > > +} > > + > > /** > > Delete a string from HII Package List by given HiiHandle. > > > > @@ -301,28 +384,6 @@ HiiGetRedfishAsciiString ( > > return AsciiString; > > } > > > > -/** > > - Get string from HII database in English language. The returned strin= g is > allocated > > - using AllocatePool(). The caller is responsible for freeing the allo= cated > buffer > > using > > - FreePool(). > > - > > - @param[in] HiiHandle A handle that was previously registere= d in the > HII > > Database. > > - @param[in] StringId The identifier of the string to retrie= ved from the > > string > > - package associated with HiiHandle. > > - > > - @retval NULL The string specified by StringId is not present in th= e string > > package. > > - @retval Other The string was returned. > > - > > -**/ > > -EFI_STRING > > -HiiGetEnglishString ( > > - IN EFI_HII_HANDLE HiiHandle, > > - IN EFI_STRING_ID StringId > > - ) > > -{ > > - return HiiGetRedfishString (HiiHandle, ENGLISH_LANGUAGE_CODE, > StringId); -} > > - > > /** > > Get ASCII string from HII database in English language. The returned= string > is > > allocated > > using AllocatePool(). The caller is responsible for freeing the allo= cated buffer > > using @@ -562,7 +623,7 @@ GetStatementPrivateByConfigureLangRegex ( > > HiiStatementPrivate =3D > > REDFISH_PLATFORM_CONFIG_STATEMENT_FROM_LINK (HiiStatementLink); > > > > if ((HiiStatementPrivate->Description !=3D 0) && !HiiStatement= Private- > > >Suppressed) { > > - TmpString =3D HiiGetRedfishString (HiiFormsetPrivate->HiiHan= dle, > Schema, > > HiiStatementPrivate->Description); > > + TmpString =3D HiiStatementPrivate->DescriptionStr; > > if (TmpString !=3D NULL) { > > Status =3D RegularExpressionProtocol->MatchString ( > > RegularExpressionPro= tocol, @@ -592,8 +653,9 > @@ > > GetStatementPrivateByConfigureLangRegex ( > > InsertTailList (&StatementList->StatementList, &Statemen= tRef->Link); > > ++StatementList->Count; > > } > > - > > - FreePool (TmpString); > > + } else { > > + DEBUG ((DEBUG_ERROR, "%a: HiiStatementPrivate->Description= Str is > > NULL, x-uefi-string has something wrong.\n", __func__)); > > + ASSERT (FALSE); > > } > > } > > > > @@ -676,14 +738,11 @@ GetStatementPrivateByConfigureLang ( > > ); > > > > if (HiiStatementPrivate->Description !=3D 0) { > > - TmpString =3D HiiGetRedfishString (HiiFormsetPrivate->HiiHan= dle, > Schema, > > HiiStatementPrivate->Description); > > + TmpString =3D HiiStatementPrivate->DescriptionStr; > > if (TmpString !=3D NULL) { > > - if (StrCmp (TmpString, ConfigureLang) =3D=3D 0) { > > - FreePool (TmpString); > > + if (HiiStrCmp (TmpString, ConfigureLang) =3D=3D 0) { > > return HiiStatementPrivate; > > } > > - > > - FreePool (TmpString); > > } > > } > > > > @@ -741,10 +800,74 @@ GetFormsetPrivateByHiiHandle ( > > return NULL; > > } > > > > +/** > > + Release x-uefi-string related information. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set private insta= nce. > > + > > + @retval EFI_STATUS > > + > > +**/ > > +EFI_STATUS > > +ReleaseXuefiStringDatabase ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate > > + ) > > +{ > > + REDFISH_X_UEFI_STRING_DATABASE *ThisDatabase; > > + REDFISH_X_UEFI_STRING_DATABASE *PreDatabase; > > + REDFISH_X_UEFI_STRINGS_ARRAY *ThisStringArray; > > + REDFISH_X_UEFI_STRINGS_ARRAY *PreStringArray; > > + BOOLEAN EndDatabase; > > + BOOLEAN EndArray; > > + > > + if (FormsetPrivate->HiiPackageListHeader !=3D NULL) { > > + FreePool (FormsetPrivate->HiiPackageListHeader); > > + } > > + > > + // Walk through x-uefi-redfish string database. > > + if (!IsListEmpty (&FormsetPrivate->XuefiRedfishStringDatabase)) { > > + EndDatabase =3D FALSE; > > + ThisDatabase =3D (REDFISH_X_UEFI_STRING_DATABASE *)GetFirstNode > > (&FormsetPrivate->XuefiRedfishStringDatabase); > > + while (!EndDatabase) { > > + // Walk through string arrays. > > + if (!IsListEmpty (&ThisDatabase->XuefiRedfishStringArrays)) { > > + EndArray =3D FALSE; > > + ThisStringArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetFirstNo= de > > (&ThisDatabase->XuefiRedfishStringArrays); > > + while (!EndArray) { > > + // Remove this array > > + FreePool (ThisStringArray->ArrayEntryAddress); > > + EndArray =3D IsNodeAtEnd (&ThisDatabase- > >XuefiRedfishStringArrays, > > &ThisStringArray->NextArray); > > + PreStringArray =3D ThisStringArray; > > + if (!EndArray) { > > + ThisStringArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetNex= tNode > > (&ThisDatabase->XuefiRedfishStringArrays, &ThisStringArray->NextArray); > > + } > > + > > + RemoveEntryList (&PreStringArray->NextArray); > > + FreePool (PreStringArray); > > + } > > + } > > + > > + // > > + // Remove this database > > + // > > + EndDatabase =3D IsNodeAtEnd (&FormsetPrivate- > >XuefiRedfishStringDatabase, > > &ThisDatabase->NextXuefiRedfishLanguage); > > + PreDatabase =3D ThisDatabase; > > + if (!EndDatabase) { > > + ThisDatabase =3D (REDFISH_X_UEFI_STRING_DATABASE *)GetNextNode > > (&FormsetPrivate->XuefiRedfishStringDatabase, &ThisDatabase- > > >NextXuefiRedfishLanguage); > > + } > > + > > + RemoveEntryList (&PreDatabase->NextXuefiRedfishLanguage); > > + FreePool (PreDatabase); > > + } > > + } > > + > > + return EFI_SUCCESS; > > +} > > + > > /** > > Release formset and all the forms and statements that belong to this > formset. > > > > - @param[in] FormsetPrivate Pointer to HP_HII_FORM_SET_PRIVATE > > + @param[in] FormsetPrivate Pointer to HII form-set private insta= nce. > > > > @retval EFI_STATUS > > > > @@ -779,12 +902,6 @@ ReleaseFormset ( > > // > > // HiiStatementPrivate->HiiStatement will be released in > DestroyFormSet(). > > // > > - > > - if (HiiStatementPrivate->DesStringCache !=3D NULL) { > > - FreePool (HiiStatementPrivate->DesStringCache); > > - HiiStatementPrivate->DesStringCache =3D NULL; > > - } > > - > > RemoveEntryList (&HiiStatementPrivate->Link); > > FreePool (HiiStatementPrivate); > > HiiStatementLink =3D HiiNextStatementLink; @@ -821,6 +938,8 @@ > > ReleaseFormset ( > > FormsetPrivate->SupportedSchema.Count =3D 0; > > } > > > > + ReleaseXuefiStringDatabase (FormsetPrivate); > > + > > return EFI_SUCCESS; > > } > > > > @@ -846,17 +965,607 @@ NewFormsetPrivate ( > > // Initial newly created formset private data. > > // > > InitializeListHead (&NewFormsetPrivate->HiiFormList); > > + InitializeListHead (&NewFormsetPrivate->XuefiRedfishStringDatabase); > > > > return NewFormsetPrivate; > > } > > > > +/** > > + Create new x-uefi-redfish string array. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set = private > instance. > > + @param[in] XuefiRedfishStringDatabase The x-uefi-redfish strin= g > database. > > + > > + @retval EFI_OUT_OF_RESOURCES Not enough memory for creating= a > > new array. > > + EFI_SUCCESS New array is created successfu= lly. > > + > > +**/ > > +EFI_STATUS > > +NewRedfishXuefiStringArray ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate, > > + IN REDFISH_X_UEFI_STRING_DATABASE > *XuefiRedfishStringDatabase > > + ) > > +{ > > + REDFISH_X_UEFI_STRINGS_ARRAY *ArrayAddress; > > + > > + // Initial first REDFISH_X_UEFI_STRINGS_ARRAY memory. > > + ArrayAddress =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)AllocateZeroPool > > + (sizeof (REDFISH_X_UEFI_STRINGS_ARRAY)); if (ArrayAddress =3D=3D NUL= L) { > > + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate > > REDFISH_X_UEFI_STRINGS_ARRAY.\n", __func__)); > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + InitializeListHead (&ArrayAddress->NextArray); > > + > > + // Allocate memory buffer for > REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT > > elements. > > + ArrayAddress->ArrayEntryAddress =3D \ > > + (REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT *)AllocateZeroPool (sizeof > > + (REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENT) * > > + X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER); > > + if (ArrayAddress->ArrayEntryAddress =3D=3D NULL) { > > + FreePool (ArrayAddress); > > + DEBUG ((DEBUG_ERROR, "%a: Failed to allocate array for > > REDFISH_X_UEFI_STRINGS_ARRAY_ELEMENTs.\n", __func__)); > > + return EFI_OUT_OF_RESOURCES; > > + } > > + > > + XuefiRedfishStringDatabase->StringsArrayBlocks++; > > + InsertTailList > > +(&XuefiRedfishStringDatabase->XuefiRedfishStringArrays, > > +&ArrayAddress->NextArray); > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + Get the pointer of x-uefi-redfish database or create a new database. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set priv= ate > instance. > > + @param[in] HiiStringPackageHeader HII string package header. > > + > > + @retval Pointer to REDFISH_X_UEFI_STRING_DATABASE. > > + If NULL, it fails to obtain x-uefi-redfish database. > > + > > +**/ > > +REDFISH_X_UEFI_STRING_DATABASE * > > +GetExitOrCreateXuefiStringDatabase ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate, > > + IN EFI_HII_STRING_PACKAGE_HDR *HiiStringPackageHeade= r > > + ) > > +{ > > + EFI_STATUS Status; > > + BOOLEAN CreateNewOne; > > + REDFISH_X_UEFI_STRING_DATABASE *XuefiRedfishStringDatabase; > > + > > + DEBUG ((DEBUG_INFO, "%a: Entry\n", __func__)); > > + > > + CreateNewOne =3D TRUE; > > + XuefiRedfishStringDatabase =3D NULL; > > + if (!IsListEmpty (&FormsetPrivate->XuefiRedfishStringDatabase)) { > > + XuefiRedfishStringDatabase =3D (REDFISH_X_UEFI_STRING_DATABASE > > + *)GetFirstNode (&FormsetPrivate->XuefiRedfishStringDatabase); > > + > > + while (TRUE) { > > + if (AsciiStriCmp (XuefiRedfishStringDatabase->XuefiRedfishLangua= ge, > > HiiStringPackageHeader->Language) =3D=3D 0) { > > + CreateNewOne =3D FALSE; > > + break; > > + } > > + > > + if (IsNodeAtEnd (&FormsetPrivate->XuefiRedfishStringDatabase, > > &XuefiRedfishStringDatabase->NextXuefiRedfishLanguage)) { > > + break; > > + } > > + > > + XuefiRedfishStringDatabase =3D \ > > + (REDFISH_X_UEFI_STRING_DATABASE *)GetNextNode > (&FormsetPrivate- > > >XuefiRedfishStringDatabase, &XuefiRedfishStringDatabase- > > >NextXuefiRedfishLanguage); > > + } > > + } > > + > > + if (CreateNewOne) { > > + DEBUG ((REDFISH_PLATFORM_CONFIG_DEBUG, " Creating x-uefi-redfish > > (%a) string database...\n", HiiStringPackageHeader->Language)); > > + XuefiRedfishStringDatabase =3D (REDFISH_X_UEFI_STRING_DATABASE > > *)AllocateZeroPool (sizeof (REDFISH_X_UEFI_STRING_DATABASE)); > > + if (XuefiRedfishStringDatabase =3D=3D NULL) { > > + DEBUG ((DEBUG_ERROR, " Failed to allocate > > REDFISH_X_UEFI_STRING_DATABASE.\n")); > > + return NULL; > > + } > > + > > + InitializeListHead (&XuefiRedfishStringDatabase- > >NextXuefiRedfishLanguage); > > + InitializeListHead (&XuefiRedfishStringDatabase- > >XuefiRedfishStringArrays); > > + XuefiRedfishStringDatabase->StringsArrayBlocks =3D 0; > > + XuefiRedfishStringDatabase->XuefiRedfishLanguage =3D > > + HiiStringPackageHeader->Language; > > + > > + Status =3D NewRedfishXuefiStringArray (FormsetPrivate, > > XuefiRedfishStringDatabase); > > + if (EFI_ERROR (Status)) { > > + FreePool (XuefiRedfishStringDatabase); > > + return NULL; > > + } > > + > > + DEBUG (( > > + REDFISH_PLATFORM_CONFIG_DEBUG, > > + " x-uefi-redfish (%a):\n String array is added to > > XuefiRedfishStringDatabase, total %d arrays now.\n", > > + XuefiRedfishStringDatabase->XuefiRedfishLanguage, > > + XuefiRedfishStringDatabase->StringsArrayBlocks > > + )); > > + > > + // Link string database to FormsetPrivate. > > + InsertTailList (&FormsetPrivate->XuefiRedfishStringDatabase, > > + &XuefiRedfishStringDatabase->NextXuefiRedfishLanguage); > > + } > > + > > + return XuefiRedfishStringDatabase; > > +} > > + > > +/** > > + Check and allocate a new x-uefi-redfish array if it is insufficient > > +for the > > + newly added x-uefi-redfish string. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set = private > instance. > > + @param[in] XuefiRedfishStringDatabase Pointer to the x-uefi-re= dfish > > database. > > + @param[in] StringId String ID added to datab= ase. > > + > > + @retval EFI_SUCCESS The size of x-uefi-strin= g array is adjusted > or > > + is not required to be ad= justed. > > + Otherwise, refer to the error code returned from > > NewRedfishXuefiStringArray(). > > + > > +**/ > > +EFI_STATUS > > +RedfishXuefiStringAdjustArrays ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate, > > + IN REDFISH_X_UEFI_STRING_DATABASE > *XuefiRedfishStringDatabase, > > + IN EFI_STRING_ID StringId > > + ) > > +{ > > + EFI_STATUS Status; > > + > > + while (((StringId + X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER) / > > X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER) > > > (UINT16)XuefiRedfishStringDatabase->StringsArrayBlocks) { > > + Status =3D NewRedfishXuefiStringArray (FormsetPrivate, > > XuefiRedfishStringDatabase); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: Failed to adjust x-uefi-string array", > > __func__)); > > + return Status; > > + } > > + } > > + > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + Insert a x-uefi-redfish string to database. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set priv= ate > instance. > > + @param[in] HiiStringPackageHeader Pointer to HII string packag= e. > > + @param[in] StringId The HII string ID > > + @param[in] StringTextPtr Pointer to HII string text. > > + > > + @retval EFI_SUCCESS The HII string is added to d= atabase. > > + EFI_LOAD_ERROR Something wrong when insert = an HII string > > + to database. > > + > > +**/ > > +EFI_STATUS > > +RedfishXuefiStringInsertDatabase ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate, > > + IN EFI_HII_STRING_PACKAGE_HDR *HiiStringPackageHeade= r, > > + IN EFI_STRING_ID StringId, > > + IN CHAR16 *StringTextPtr > > + ) > > +{ > > + EFI_STATUS Status; > > + UINTN StringIdOffset; > > + REDFISH_X_UEFI_STRING_DATABASE *XuefiRedfishStringDatabase; > > + REDFISH_X_UEFI_STRINGS_ARRAY *ThisArray; > > + > > + XuefiRedfishStringDatabase =3D GetExitOrCreateXuefiStringDatabase > > + (FormsetPrivate, HiiStringPackageHeader); if (XuefiRedfishStringData= base > =3D=3D > > NULL) { > > + DEBUG ((DEBUG_ERROR, "%a: Failed to get > > REDFISH_X_UEFI_STRING_DATABASE of x-uefi-redfish language %a.\n", > > __func__, HiiStringPackageHeader->Language)); > > + ReleaseXuefiStringDatabase (FormsetPrivate); > > + return EFI_LOAD_ERROR; > > + } > > + > > + Status =3D RedfishXuefiStringAdjustArrays (FormsetPrivate, > > + XuefiRedfishStringDatabase, StringId); if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: Failed to adjust x-uefi-redfish string > array.\n", > > __func__)); > > + return EFI_LOAD_ERROR; > > + } > > + > > + // Insert string to x-uefi-redfish string array. > > + StringIdOffset =3D (UINTN)StringId; > > + ThisArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetFirstNode > > (&XuefiRedfishStringDatabase->XuefiRedfishStringArrays); > > + while (StringIdOffset >=3D > X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER) { > > + ThisArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetNextNode > > (&XuefiRedfishStringDatabase->XuefiRedfishStringArrays, &ThisArray- > > >NextArray); > > + StringIdOffset -=3D X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER; > > + } > > + > > + // Insert string > > + (ThisArray->ArrayEntryAddress + StringIdOffset)->StringId =3D > > + StringId; (ThisArray->ArrayEntryAddress + StringIdOffset)->UcsString > > + =3D StringTextPtr; > > + > > + DEBUG (( > > + REDFISH_PLATFORM_CONFIG_DEBUG, > > + " Insert string ID: (%d) to database\n x-uefi-string: \"%s\"\n > Language: > > %a.\n", > > + StringId, > > + StringTextPtr, > > + HiiStringPackageHeader->Language > > + )); > > + return EFI_SUCCESS; > > +} > > + > > +/** > > + Get x-uefi-redfish string and language by string ID. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set priv= ate > instance. > > + @param[in] HiiStringPackageHeader HII string package header. > > + > > + @retval TRUE x-uefi-redfish string and ID map is inserted to data= base. > > + FALSE Something is wrong when insert x-uefi-redfish string= and ID > map. > > + > > +**/ > > +BOOLEAN > > +CreateXuefiLanguageStringIdMap ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate, > > + IN EFI_HII_STRING_PACKAGE_HDR *HiiStringPackageHeade= r > > + ) > > +{ > > + EFI_STATUS Status; > > + UINT8 *BlockHdr; > > + EFI_STRING_ID CurrentStringId; > > + UINTN BlockSize; > > + UINTN Index; > > + UINT8 *StringTextPtr; > > + UINTN Offset; > > + UINT16 StringCount; > > + UINT16 SkipCount; > > + UINT8 Length8; > > + EFI_HII_SIBT_EXT2_BLOCK Ext2; > > + UINT32 Length32; > > + UINT8 *StringBlockInfo; > > + > > + // > > + // Parse the string blocks to get the string text and font. > > + // > > + StringBlockInfo =3D (UINT8 *)((UINTN)HiiStringPackageHeader + > > HiiStringPackageHeader->StringInfoOffset); > > + BlockHdr =3D StringBlockInfo; > > + BlockSize =3D 0; > > + Offset =3D 0; > > + CurrentStringId =3D 1; > > + while (*BlockHdr !=3D EFI_HII_SIBT_END) { > > + switch (*BlockHdr) { > > + case EFI_HII_SIBT_STRING_SCSU: > > + Offset =3D sizeof (EFI_HII_STRING_BLOCK); > > + StringTextPtr =3D BlockHdr + Offset; > > + BlockSize +=3D Offset + AsciiStrSize ((CHAR8 *)StringTextPt= r); > > + CurrentStringId++; > > + break; > > + > > + case EFI_HII_SIBT_STRING_SCSU_FONT: > > + Offset =3D sizeof (EFI_HII_SIBT_STRING_SCSU_FONT_BLOCK)= - sizeof > > (UINT8); > > + StringTextPtr =3D BlockHdr + Offset; > > + BlockSize +=3D Offset + AsciiStrSize ((CHAR8 *)StringTextPt= r); > > + CurrentStringId++; > > + break; > > + > > + case EFI_HII_SIBT_STRINGS_SCSU: > > + CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK= ), > sizeof > > (UINT16)); > > + StringTextPtr =3D (UINT8 *)((UINTN)BlockHdr + sizeof > > (EFI_HII_SIBT_STRINGS_SCSU_BLOCK) - sizeof (UINT8)); > > + BlockSize +=3D StringTextPtr - BlockHdr; > > + > > + for (Index =3D 0; Index < StringCount; Index++) { > > + BlockSize +=3D AsciiStrSize ((CHAR8 *)StringTextPtr); > > + StringTextPtr =3D StringTextPtr + AsciiStrSize ((CHAR8 *)Str= ingTextPtr); > > + CurrentStringId++; > > + } > > + > > + break; > > + > > + case EFI_HII_SIBT_STRINGS_SCSU_FONT: > > + CopyMem ( > > + &StringCount, > > + (UINT8 *)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + = sizeof > > (UINT8)), > > + sizeof (UINT16) > > + ); > > + StringTextPtr =3D (UINT8 *)((UINTN)BlockHdr + sizeof > > (EFI_HII_SIBT_STRINGS_SCSU_FONT_BLOCK) - sizeof (UINT8)); > > + BlockSize +=3D StringTextPtr - BlockHdr; > > + > > + for (Index =3D 0; Index < StringCount; Index++) { > > + BlockSize +=3D AsciiStrSize ((CHAR8 *)StringTextPtr); > > + StringTextPtr =3D StringTextPtr + AsciiStrSize ((CHAR8 *)Str= ingTextPtr); > > + CurrentStringId++; > > + } > > + > > + break; > > + > > + case EFI_HII_SIBT_STRING_UCS2: > > + Offset =3D sizeof (EFI_HII_STRING_BLOCK); > > + StringTextPtr =3D BlockHdr + Offset; > > + > > + // x-uefi-redfish string is always encoded as UCS and started = with '/'. > > + if (*StringTextPtr =3D=3D (UINT16)'/') { > > + Status =3D RedfishXuefiStringInsertDatabase ( > > + FormsetPrivate, > > + HiiStringPackageHeader, > > + CurrentStringId, > > + (CHAR16 *)StringTextPtr > > + ); > > + if (EFI_ERROR (Status)) { > > + DEBUG ((DEBUG_ERROR, "%a: Failed to insert x-uefi-redfish = string > > %s.\n", __func__, StringTextPtr)); > > + return FALSE; > > + } > > + } > > + > > + BlockSize +=3D (Offset + HiiStrSize ((CHAR16 *)StringTextPtr))= ; > > + CurrentStringId++; > > + break; > > + > > + case EFI_HII_SIBT_STRING_UCS2_FONT: > > + Offset =3D sizeof (EFI_HII_SIBT_STRING_UCS2_FONT_BLOCK)= - sizeof > > (CHAR16); > > + StringTextPtr =3D BlockHdr + Offset; > > + BlockSize +=3D (Offset + HiiStrSize ((CHAR16 *)StringTextPt= r)); > > + CurrentStringId++; > > + break; > > + > > + case EFI_HII_SIBT_STRINGS_UCS2: > > + Offset =3D sizeof (EFI_HII_SIBT_STRINGS_UCS2_BLOCK) - s= izeof > (CHAR16); > > + StringTextPtr =3D BlockHdr + Offset; > > + BlockSize +=3D Offset; > > + CopyMem (&StringCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK= ), > sizeof > > (UINT16)); > > + for (Index =3D 0; Index < StringCount; Index++) { > > + BlockSize +=3D HiiStrSize ((CHAR16 *)StringTextPtr); > > + StringTextPtr =3D StringTextPtr + HiiStrSize ((CHAR16 *)Stri= ngTextPtr); > > + CurrentStringId++; > > + } > > + > > + break; > > + > > + case EFI_HII_SIBT_STRINGS_UCS2_FONT: > > + Offset =3D sizeof (EFI_HII_SIBT_STRINGS_UCS2_FONT_BLOCK= ) - sizeof > > (CHAR16); > > + StringTextPtr =3D BlockHdr + Offset; > > + BlockSize +=3D Offset; > > + CopyMem ( > > + &StringCount, > > + (UINT8 *)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + = sizeof > > (UINT8)), > > + sizeof (UINT16) > > + ); > > + for (Index =3D 0; Index < StringCount; Index++) { > > + BlockSize +=3D HiiStrSize ((CHAR16 *)StringTextPtr); > > + StringTextPtr =3D StringTextPtr + HiiStrSize ((CHAR16 *)Stri= ngTextPtr); > > + CurrentStringId++; > > + } > > + > > + break; > > + > > + case EFI_HII_SIBT_DUPLICATE: > > + BlockSize +=3D sizeof (EFI_HII_SIBT_DUPLICATE_BLOCK); > > + CurrentStringId++; > > + break; > > + > > + case EFI_HII_SIBT_SKIP1: > > + SkipCount =3D (UINT16)(*(UINT8 *)((UINTN)BlockHdr + size= of > > (EFI_HII_STRING_BLOCK))); > > + CurrentStringId =3D (UINT16)(CurrentStringId + SkipCount); > > + BlockSize +=3D sizeof (EFI_HII_SIBT_SKIP1_BLOCK); > > + break; > > + > > + case EFI_HII_SIBT_SKIP2: > > + CopyMem (&SkipCount, BlockHdr + sizeof (EFI_HII_STRING_BLOCK), > sizeof > > (UINT16)); > > + CurrentStringId =3D (UINT16)(CurrentStringId + SkipCount); > > + BlockSize +=3D sizeof (EFI_HII_SIBT_SKIP2_BLOCK); > > + break; > > + > > + case EFI_HII_SIBT_EXT1: > > + CopyMem ( > > + &Length8, > > + (UINT8 *)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + = sizeof > > (UINT8)), > > + sizeof (UINT8) > > + ); > > + BlockSize +=3D Length8; > > + break; > > + > > + case EFI_HII_SIBT_EXT2: > > + CopyMem (&Ext2, BlockHdr, sizeof (EFI_HII_SIBT_EXT2_BLOCK)); > > + BlockSize +=3D Ext2.Length; > > + break; > > + > > + case EFI_HII_SIBT_EXT4: > > + CopyMem ( > > + &Length32, > > + (UINT8 *)((UINTN)BlockHdr + sizeof (EFI_HII_STRING_BLOCK) + = sizeof > > (UINT8)), > > + sizeof (UINT32) > > + ); > > + > > + BlockSize +=3D Length32; > > + break; > > + > > + default: > > + break; > > + } > > + > > + BlockHdr =3D (UINT8 *)(StringBlockInfo + BlockSize); } > > + > > + return TRUE; > > +} > > + > > +/** > > + Get x-uefi-redfish string and language by string ID. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set private= instance. > > + @param[in] StringId The HII string ID. > > + @param[out] String Optionally return USC string. > > + @param[out] Language Optionally return x-uefi-redfis= h language. > > + @param[out] XuefiStringDatabase Optionally return x-uefi-redfis= h > > database. > > + > > + @retval EFI_SUCCESS String information is returned. > > + EFI_INVALID_PARAMETER One of the given parameters to this > function is > > + invalid. > > + EFI_NOT_FOUND String is not found. > > + > > +**/ > > +EFI_STATUS > > +GetXuefiStringAndLangByStringId ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate, > > + IN EFI_STRING_ID StringId, > > + OUT CHAR16 **String OPTIONAL, > > + OUT CHAR8 **Language OPTIONAL, > > + OUT REDFISH_X_UEFI_STRING_DATABASE **XuefiStringDatabase > > OPTIONAL > > + ) > > +{ > > + REDFISH_X_UEFI_STRING_DATABASE *XuefiRedfishStringDatabase; > > + REDFISH_X_UEFI_STRINGS_ARRAY *StringArray; > > + UINT16 StringIndex; > > + > > + if ((String =3D=3D NULL) && (Language =3D=3D NULL) && (XuefiStringDa= tabase =3D=3D > NULL)) > > { > > + DEBUG ((DEBUG_ERROR, "%a: Invalid parameters for this function.\n"= , > > __func__)); > > + return EFI_INVALID_PARAMETER; > > + } > > + > > + if (IsListEmpty (&FormsetPrivate->XuefiRedfishStringDatabase)) { > > + return EFI_NOT_FOUND; > > + } > > + > > + XuefiRedfishStringDatabase =3D (REDFISH_X_UEFI_STRING_DATABASE > > + *)GetFirstNode (&FormsetPrivate->XuefiRedfishStringDatabase); > > + while (TRUE) { > > + if (Language !=3D NULL) { > > + *Language =3D XuefiRedfishStringDatabase->XuefiRedfishLanguage; > > + } > > + > > + StringArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetFirstNode > > + (&XuefiRedfishStringDatabase->XuefiRedfishStringArrays); > > + > > + // Loop to the correct string array. > > + StringIndex =3D StringId; > > + while (StringIndex >=3D > X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER) { > > + if (IsNodeAtEnd (&XuefiRedfishStringDatabase- > >XuefiRedfishStringArrays, > > &StringArray->NextArray)) { > > + goto ErrorEixt; > > + } > > + > > + StringArray =3D (REDFISH_X_UEFI_STRINGS_ARRAY *)GetNextNode > > (&XuefiRedfishStringDatabase->XuefiRedfishStringArrays, &StringArray- > > >NextArray); > > + StringIndex -=3D X_UEFI_REDFISH_STRING_ARRAY_ENTRY_NUMBER; > > + } > > + > > + // > > + // NOTE: The string ID in the formset is a unique number. > > + // If the string in the array is NULL, then the matched stri= ng ID > > + // should be in another x-uefi-redfish database. > > + // > > + if ((StringArray->ArrayEntryAddress + StringIndex)->UcsString !=3D= NULL) { > > + // > > + // String ID is belong to this x-uef-redfish language database. > > + // > > + if (String !=3D NULL) { > > + *String =3D (StringArray->ArrayEntryAddress + StringIndex)->Uc= sString; > > + } > > + > > + if (XuefiStringDatabase !=3D NULL) { > > + *XuefiStringDatabase =3D XuefiRedfishStringDatabase; > > + } > > + > > + return EFI_SUCCESS; > > + } > > + > > + if (IsNodeAtEnd (&FormsetPrivate->XuefiRedfishStringDatabase, > > &XuefiRedfishStringDatabase->NextXuefiRedfishLanguage)) { > > + return EFI_NOT_FOUND; > > + } > > + > > + XuefiRedfishStringDatabase =3D (REDFISH_X_UEFI_STRING_DATABASE > > *)GetNextNode ( > > + &= FormsetPrivate- > > >XuefiRedfishStringDatabase, > > + &= XuefiRedfishStringDatabase- > > >NextXuefiRedfishLanguage > > + )= ; > > + } > > + > > +ErrorEixt:; > > + DEBUG ((DEBUG_ERROR, "%a: String ID (%d) is not in any x-uef-redfish > > +string databases.\n", __func__, StringId)); > > + return EFI_NOT_FOUND; > > +} > > + > > +/** > > + Build a x-uefi-redfish database for the newly added x-uefi-redfish > language. > > + > > + @param[in] FormsetPrivate Pointer to HII form-set priv= ate > instance. > > + > > +**/ > > +VOID > > +BuildXUefiRedfishStringDatabase ( > > + IN REDFISH_PLATFORM_CONFIG_FORM_SET_PRIVATE *FormsetPrivate > > + ) > > +{ > > + EFI_STATUS Status; > > + UINTN BufferSize; > > + EFI_HII_PACKAGE_HEADER *PackageHeader; > > + UINTN EndingPackageAddress; > > + EFI_HII_STRING_PACKAGE_HDR *HiiStringPackageHeader; > > + UINTN SupportedSchemaLangCount; > > + CHAR8 **SupportedSchemaLang; > > + BOOLEAN StringIdMapIsBuilt; > > + > > + DEBUG ((DEBUG_INFO, "%a: Building x-uefi-redfish string database, HI= I > > + Formset GUID - %g.\n", __func__, FormsetPrivate->Guid)); > > + > > + BufferSize =3D 0; > > + Status =3D mRedfishPlatformConfigPrivate->HiiDatabase- > >ExportPackageLists ( > > + mRedfishP= latformConfigPrivate- > >HiiDatabase, > > + FormsetPr= ivate->HiiHandle, > > + &BufferSi= ze, > > + FormsetPr= ivate->HiiPackageListHeader > > + ); if > > + (Status !=3D EFI_BUFFER_TOO_SMALL) { > > + DEBUG ((DEBUG_ERROR, " Failed to export package list.\n")); > > + return; > > + } > > + > > + FormsetPrivate->HiiPackageListHeader =3D (EFI_HII_PACKAGE_LIST_HEADE= R > > + *)AllocateZeroPool (BufferSize); if (FormsetPrivate->HiiPackageListH= eader > =3D=3D > > NULL) { > > + DEBUG ((DEBUG_ERROR, " Failed to allocate memory for the exported > > package list.\n")); > > + return; > > + } > > + > > + Status =3D mRedfishPlatformConfigPrivate->HiiDatabase- > >ExportPackageLists ( > > + mRedfishPlatf= ormConfigPrivate->HiiDatabase, > > + FormsetPrivat= e->HiiHandle, > > + &BufferSize, > > + FormsetPrivat= e->HiiPackageListHeader > > + ); if > > + (EFI_ERROR (Status)) { > > + return; > > + } > > + > > + // > > + // Finding the string package. > > + // > > + EndingPackageAddress =3D (UINTN)FormsetPrivate->HiiPackageListHeader= + > > FormsetPrivate->HiiPackageListHeader->PackageLength; > > + PackageHeader =3D (EFI_HII_PACKAGE_HEADER *)(FormsetPrivate- > > >HiiPackageListHeader + 1); > > + SupportedSchemaLang =3D FormsetPrivate->SupportedSchema.SchemaList; > > + while ((UINTN)PackageHeader < EndingPackageAddress) { > > + switch (PackageHeader->Type) { > > + case EFI_HII_PACKAGE_STRINGS: > > + StringIdMapIsBuilt =3D FALSE; > > + HiiStringPackageHeader =3D (EFI_HII_STRING_PACKAGE_HDR > > + *)PackageHeader; > > + > > + // Check if this is the string package for x-uefi-redfish > > + for (SupportedSchemaLangCount =3D 0; > > + SupportedSchemaLangCount < FormsetPrivate- > > >SupportedSchema.Count; > > + SupportedSchemaLangCount++ > > + ) > > + { > > + if (AsciiStrnCmp ( > > + *(SupportedSchemaLang + SupportedSchemaLangCount), > > + HiiStringPackageHeader->Language, > > + AsciiStrLen (HiiStringPackageHeader->Language) > > + ) =3D=3D 0) > > + { > > + StringIdMapIsBuilt =3D CreateXuefiLanguageStringIdMap > (FormsetPrivate, > > HiiStringPackageHeader); > > + break; > > + } > > + } > > + > > + if (StringIdMapIsBuilt =3D=3D FALSE) { > > + if (AsciiStrStr (HiiStringPackageHeader->Language, > > X_UEFI_SCHEMA_PREFIX) =3D=3D NULL) { > > + DEBUG ((REDFISH_PLATFORM_CONFIG_DEBUG, " No need to build > x- > > uefi-redfish string ID map for HII language %a\n", HiiStringPackageHead= er- > > >Language)); > > + } else { > > + DEBUG ((DEBUG_ERROR, " Failed to build x-uefi-redfish str= ing ID map > of > > HII language %a\n", HiiStringPackageHeader->Language)); > > + } > > + } > > + > > + default: > > + PackageHeader =3D (EFI_HII_PACKAGE_HEADER > *)((UINTN)PackageHeader + > > PackageHeader->Length); > > + } > > + } > > +} > > + > > /** > > Load the HII formset from the given HII handle. > > > > @param[in] HiiHandle Target HII handle to load. > > @param[out] FormsetPrivate The formset private data. > > > > - @retval EFI_STATUS > > + @retval EFI_STATUS The formset is loaded successfully. > > + @retval EFI_UNSUPPORTED This formset doesn't have any x-uefi-red= fish > > configuration. > > > > **/ > > EFI_STATUS > > @@ -875,6 +1584,7 @@ LoadFormset ( > > REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE > *HiiStatementPrivate; > > EFI_GUID ZeroGuid; > > EXPRESS_RESULT ExpressionResult; > > + CHAR16 *String; > > > > if ((HiiHandle =3D=3D NULL) || (FormsetPrivate =3D=3D NULL)) { > > return EFI_INVALID_PARAMETER; > > @@ -882,6 +1592,7 @@ LoadFormset ( > > > > HiiFormSet =3D AllocateZeroPool (sizeof (HII_FORMSET)); > > if (HiiFormSet =3D=3D NULL) { > > + DEBUG ((DEBUG_ERROR, "%a: No memory resource for HII_FORMSET - > > + %g\n", __func__, FormsetPrivate->Guid)); > > return EFI_OUT_OF_RESOURCES; > > } > > > > @@ -891,6 +1602,7 @@ LoadFormset ( > > ZeroMem (&ZeroGuid, sizeof (ZeroGuid)); > > Status =3D CreateFormSetFromHiiHandle (HiiHandle, &ZeroGuid, HiiForm= Set); > > if (EFI_ERROR (Status) || IsListEmpty (&HiiFormSet->FormListHead)) { > > + DEBUG ((DEBUG_ERROR, "%a: Formset not found by HII handle - %g\n", > > + __func__, FormsetPrivate->Guid)); > > Status =3D EFI_NOT_FOUND; > > goto ErrorExit; > > } > > @@ -909,7 +1621,11 @@ LoadFormset ( > > FormsetPrivate->DevicePathStr =3D ConvertDevicePathToText (HiiFormSe= t- > > >DevicePath, FALSE, FALSE); > > Status =3D GetSupportedSchema (FormsetPrivate= ->HiiHandle, > > &FormsetPrivate->SupportedSchema); > > if (EFI_ERROR (Status)) { > > - DEBUG ((REDFISH_PLATFORM_CONFIG_DEBUG, "%a: No schema from > HII > > handle: 0x%x found: %r\n", __func__, FormsetPrivate->HiiHandle, Status)= ); > > + DEBUG ((REDFISH_PLATFORM_CONFIG_DEBUG, "%a: No x-uefi-redfish > > configuration found on the formset - %g\n", __func__, FormsetPrivate- > >Guid)); > > + return EFI_UNSUPPORTED; // Can't build AttributeRegistry Meni path > with > > returning EFI_UNSUPPORTED. > > + } else { > > + // Building x-uefi-redfish string database > > + BuildXUefiRedfishStringDatabase (FormsetPrivate); > > } > > > > HiiFormLink =3D GetFirstNode (&HiiFormSet->FormListHead); @@ -919,6 > +1635,7 > > @@ LoadFormset ( > > HiiFormPrivate =3D AllocateZeroPool (sizeof > > (REDFISH_PLATFORM_CONFIG_FORM_PRIVATE)); > > if (HiiFormPrivate =3D=3D NULL) { > > Status =3D EFI_OUT_OF_RESOURCES; > > + DEBUG ((DEBUG_ERROR, "%a: No memory resource for > > + REDFISH_PLATFORM_CONFIG_FORM_PRIVATE.\n", __func__)); > > goto ErrorExit; > > } > > > > @@ -944,6 +1661,7 @@ LoadFormset ( > > > > HiiStatementPrivate =3D AllocateZeroPool (sizeof > > (REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE)); > > if (HiiStatementPrivate =3D=3D NULL) { > > + DEBUG ((DEBUG_ERROR, "%a: No memory resource for > > + REDFISH_PLATFORM_CONFIG_STATEMENT_PRIVATE.\n", __func__)); > > Status =3D EFI_OUT_OF_RESOURCES; > > goto ErrorExit; > > } > > @@ -981,10 +1699,18 @@ LoadFormset ( > > } > > } > > > > - // > > - // Attach to statement list. > > - // > > - InsertTailList (&HiiFormPrivate->StatementList, &HiiStatementPri= vate- > >Link); > > + // Get x-uefi-redfish string using String ID. > > + Status =3D GetXuefiStringAndLangByStringId (FormsetPrivate, > > HiiStatementPrivate->Description, &String, NULL, NULL); > > + if (!EFI_ERROR (Status)) { > > + HiiStatementPrivate->DescriptionStr =3D String; > > + // > > + // Attach to statement list. > > + // > > + InsertTailList (&HiiFormPrivate->StatementList, &HiiStatementP= rivate- > > >Link); > > + } else { > > + FreePool (HiiStatementPrivate); > > + } > > + > > HiiStatementLink =3D GetNextNode (&HiiForm->StatementListHead, > > HiiStatementLink); > > } > > > > @@ -1052,7 +1778,7 @@ LoadFormsetList ( > > // > > Status =3D LoadFormset (HiiHandle, FormsetPrivate); > > if (EFI_ERROR (Status)) { > > - DEBUG ((DEBUG_ERROR, "%a: failed to load formset: %r\n", __func__, > > Status)); > > + DEBUG ((DEBUG_ERROR, "%a: Formset is not loaded for edk2 redfish: > > + %r\n", __func__, Status)); > > FreePool (FormsetPrivate); > > return Status; > > } > > @@ -1325,7 +2051,11 @@ ProcessPendingList ( > > > > Status =3D LoadFormsetList (Target->HiiHandle, FormsetList); > > if (EFI_ERROR (Status)) { > > - DEBUG ((DEBUG_ERROR, "%a: load formset from HII handle: 0x%x > failed: > > %r\n", __func__, Target->HiiHandle, Status)); > > + if (Status =3D=3D EFI_UNSUPPORTED) { > > + DEBUG ((DEBUG_ERROR, " The formset has no x-uefi-redfish > > configurations.\n")); > > + } else { > > + DEBUG ((DEBUG_ERROR, " load formset from HII handle: 0x%x f= ailed: > > %r\n", Target->HiiHandle, Status)); > > + } > > } > > } > > > > -- > > 2.37.1.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 (#117399): https://edk2.groups.io/g/devel/message/117399 Mute This Topic: https://groups.io/mt/105159783/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-