From nobody Fri May 17 06:43:41 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105757+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105757+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1686031333; cv=none; d=zohomail.com; s=zohoarc; b=VqVOhYIJyPK7G7Gx0FZ8OJC0vani4EXxFdT5WYzNs5dTRTx9vuiUasDVtD+8lpr7unwQHz6aPUqbKRGqo8lvC8WGlzaAKHSillXqTV5licx2QPZJFfgN2jcTlSokAIYUMBWwJYExv/5sV91SM91SO2x22kPtzl6OzaEHlow2uls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1686031333; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=UMv5CBDtS0tlWCrktcC4QdlSycRYJa+ga8DtEjw1zCI=; b=QJMGYb2Eijo4RTE6NFe9shVT7TS4EMHL1bdC8MSc9Qb+M49BiBmzS1w0YGWCJonzO0kNAZDVo8sNxqNZRyTcQsJqkyxA9R+R3DsOZt0MYRq/aaWYLq/R4TCXCZdwLYCwXeVw7eSQbFYQBdp/fxFcHVgK0ZL64Rdd7sSD4qBu1IA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105757+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1686031333614116.43841349836168; Mon, 5 Jun 2023 23:02:13 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id q9qUYY1788612xtx5F3hT4aA; Mon, 05 Jun 2023 23:02:13 -0700 X-Received: from rn-mailsvcp-mx-lapp03.apple.com (rn-mailsvcp-mx-lapp03.apple.com [17.179.253.24]) by mx.groups.io with SMTP id smtpd.web11.2521.1686031331976952870 for ; Mon, 05 Jun 2023 23:02:12 -0700 X-Received: from rn-mailsvcp-mta-lapp04.rno.apple.com (rn-mailsvcp-mta-lapp04.rno.apple.com [10.225.203.152]) by rn-mailsvcp-mx-lapp03.rno.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) with ESMTPS id <0RVT00406I3DX000@rn-mailsvcp-mx-lapp03.rno.apple.com> for devel@edk2.groups.io; Mon, 05 Jun 2023 23:02:11 -0700 (PDT) X-Proofpoint-ORIG-GUID: OmwUKu2xfZTkeyOxF3XVKu1lUz8TiOMZ X-Proofpoint-GUID: OmwUKu2xfZTkeyOxF3XVKu1lUz8TiOMZ X-Received: from mr41p01nt-relayp02.apple.com (mr41p01nt-relayp02.apple.com [10.180.253.69]) by rn-mailsvcp-mta-lapp04.rno.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) with ESMTPS id <0RVT0075CI3KRRC0@rn-mailsvcp-mta-lapp04.rno.apple.com>; Mon, 05 Jun 2023 23:02:08 -0700 (PDT) X-Received: from process_milters-daemon.mr41p01nt-relayp02.apple.com by mr41p01nt-relayp02.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) id <0RVT01J00I02K800@mr41p01nt-relayp02.apple.com>; Tue, 06 Jun 2023 06:02:08 +0000 (GMT) X-Va-A: X-Va-T-CD: 3a2c4b67349838e305a7a1f00570e43c X-Va-E-CD: 0a9926d9aa32f214a962208ca1f126fa X-Va-R-CD: f8c50259a4bbef8311a653f477b17585 X-Va-ID: e99bdab1-9a58-4256-98ff-efabc83a607d X-Va-CD: 0 X-V-A: X-V-T-CD: 3a2c4b67349838e305a7a1f00570e43c X-V-E-CD: 0a9926d9aa32f214a962208ca1f126fa X-V-R-CD: f8c50259a4bbef8311a653f477b17585 X-V-ID: 2e94f43b-fa23-448a-8bb0-8e86d0294d08 X-V-CD: 0 X-Received: from mr41p01nt-relayp04.apple.com (unknown [IPv6:2620:149:13c0::d0]) by mr41p01nt-relayp02.apple.com (Oracle Communications Messaging Server 8.1.0.22.20230228 64bit (built Feb 28 2023)) with ESMTP id <0RVT01J4GI3JIC20@mr41p01nt-relayp02.apple.com>; Tue, 06 Jun 2023 06:02:08 +0000 (GMT) From: "Giri Mudusuru via groups.io" To: devel@edk2.groups.io Cc: Giri Mudusuru , Ray Ni , Zhichao Gao , Andrew Fish Subject: [edk2-devel] [PATCH] ShellPkg: Increase PcdShellPrintBufferSize from UINT16 to UINT32 Date: Mon, 05 Jun 2023 23:02:00 -0700 Message-id: MIME-version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,girim@apple.com X-Gm-Message-State: yMr3i8lxVrHtyd7MY0zRe9I6x1787277AA= Content-transfer-encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1686031333; bh=jS53jU7L1XgbFyK2dedAuL5RE2DSMNcPGi/XkA8emjo=; h=Cc:Date:From:Reply-To:Subject:To; b=Z+20yJix14us3aPP5En93ErP/G98I7Ez8dfuNHw4rvXoqrL7/CB6Z5Y3acC01RC7xFo 9H02TFluIphEUBjZQ4VY0ltTCO4oi9/MoA5P+1qMFDdm0uLxl6o0+jlxqBJsihU0NxL+v As4ptzJ9Jo8QoCRY1dqAwQGFJW30+OFmj5I= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1686031334752100001 Content-Type: text/plain; charset="utf-8" Increase max buffer size to support more than 64K. Signed-off-by: Giri Mudusuru Cc: Ray Ni Cc: Zhichao Gao Cc: Andrew Fish Reviewed-by: Zhichao Gao --- ShellPkg/Application/Shell/Shell.c | 5 +++-- ShellPkg/Library/UefiShellLib/UefiShellLib.c | 19 ++++++++++--------- ShellPkg/ShellPkg.dec | 4 ++-- 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/ShellPkg/Application/Shell/Shell.c b/ShellPkg/Application/Shel= l/Shell.c index f95c799bb2..01b4e37871 100644 --- a/ShellPkg/Application/Shell/Shell.c +++ b/ShellPkg/Application/Shell/Shell.c @@ -4,8 +4,9 @@ Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.
(C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
Copyright 2015-2018 Dell Technologies.
- SPDX-License-Identifier: BSD-2-Clause-Patent + Copyright (C) 2023, Apple Inc. All rights reserved.
=20 + SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include "Shell.h" @@ -2944,7 +2945,7 @@ RunScriptFileHandle ( ASSERT (!ShellCommandGetScriptExit ()); =20 PreScriptEchoState =3D ShellCommandGetEchoState (); - PrintBuffSize =3D PcdGet16 (PcdShellPrintBufferSize); + PrintBuffSize =3D PcdGet32 (PcdShellPrintBufferSize); =20 NewScriptFile =3D (SCRIPT_FILE *)AllocateZeroPool (sizeof (SCRIPT_FILE)); if (NewScriptFile =3D=3D NULL) { diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Librar= y/UefiShellLib/UefiShellLib.c index a72767bd86..746c9ccece 100644 --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c @@ -4,8 +4,9 @@ (C) Copyright 2016 Hewlett Packard Enterprise Development LP
Copyright 2016-2018 Dell Technologies.
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
- SPDX-License-Identifier: BSD-2-Clause-Patent + Copyright (C) 2023, Apple Inc. All rights reserved.
=20 + SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 #include "UefiShellLib.h" @@ -2952,8 +2953,8 @@ InternalShellPrintWorker ( CHAR16 *mPostReplaceFormat; CHAR16 *mPostReplaceFormat2; =20 - mPostReplaceFormat =3D AllocateZeroPool (PcdGet16 (PcdShellPrintBufferS= ize)); - mPostReplaceFormat2 =3D AllocateZeroPool (PcdGet16 (PcdShellPrintBufferS= ize)); + mPostReplaceFormat =3D AllocateZeroPool (PcdGet32 (PcdShellPrintBufferS= ize)); + mPostReplaceFormat2 =3D AllocateZeroPool (PcdGet32 (PcdShellPrintBufferS= ize)); =20 if ((mPostReplaceFormat =3D=3D NULL) || (mPostReplaceFormat2 =3D=3D NULL= )) { SHELL_FREE_NON_NULL (mPostReplaceFormat); @@ -2967,21 +2968,21 @@ InternalShellPrintWorker ( // // Back and forth each time fixing up 1 of our flags... // - Status =3D ShellCopySearchAndReplace (Format, mPostReplaceFormat, PcdGet= 16 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE); + Status =3D ShellCopySearchAndReplace (Format, mPostReplaceFormat, PcdGet= 32 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE); ASSERT_EFI_ERROR (Status); - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet16 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE); + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet32 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE); ASSERT_EFI_ERROR (Status); - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet16 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE); + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet32 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE); ASSERT_EFI_ERROR (Status); - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet16 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE); + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet32 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE); ASSERT_EFI_ERROR (Status); - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet16 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE); + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet32 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE); ASSERT_EFI_ERROR (Status); =20 // // Use the last buffer from replacing to print from... // - UnicodeVSPrint (mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize),= mPostReplaceFormat, Marker); + UnicodeVSPrint (mPostReplaceFormat2, PcdGet32 (PcdShellPrintBufferSize),= mPostReplaceFormat, Marker); =20 if ((Col !=3D -1) && (Row !=3D -1)) { Status =3D gST->ConOut->SetCursorPosition (gST->ConOut, Col, Row); diff --git a/ShellPkg/ShellPkg.dec b/ShellPkg/ShellPkg.dec index 2ebea0a261..18df262106 100644 --- a/ShellPkg/ShellPkg.dec +++ b/ShellPkg/ShellPkg.dec @@ -4,9 +4,9 @@ # (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
# Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
+# Copyright (C) 2023, Apple Inc. All rights reserved.
# # SPDX-License-Identifier: BSD-2-Clause-Patent -# ## =20 [Defines] @@ -84,7 +84,7 @@ gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|TRUE|BOOLEAN|0x0000= 0005 =20 ## This is the max buffer for ShellLib and internal Shell printings. - gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize|16000|UINT16|0x000000= 0C + gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize|16000|UINT32|0x000000= 0C =20 ## This flag is used to control the commands available in the shell gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel|3|UINT8|0x00000001 --=20 2.39.2 (Apple Git-144) -=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 (#105757): https://edk2.groups.io/g/devel/message/105757 Mute This Topic: https://groups.io/mt/99358037/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-