From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@apple.com header.s=20180706 header.b=X8C2KapS; spf=pass (domain: apple.com, ip: 17.179.253.24, mailfrom: girim@apple.com) 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-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.573,18.0.942 definitions=2023-05-10_04:2023-05-05,2023-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=interactive_user_notspam policy=interactive_user score=0 phishscore=0 adultscore=0 mlxlogscore=898 suspectscore=0 malwarescore=0 bulkscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2304280000 definitions=main-2305100148 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apple.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=20180706; bh=kKiEXhBIbxnYZzWLIHmEuTENgfSqw01PzbgAhbzLFYU=; b=X8C2KapSZZSphzYkFchi0LN+RC1Y/NTKtEllGAiovVp+iyTRB/y7+903Fn/Fge1uIiTd lF91Yg9qe+k+d1shsFkZr9CbT6rCm9GgQFzBOH6ZfeOr1J5CeZ1Qqd767DIXGlGjuLH0 eBQ0w0QnApEuNY3LQ2p2+ZxnE0NO7q2MuUp6a7wBNusvEX6Yf50uQt9ytge51no3/pSA i8V4j2MnW3HIEXKTfu9j03eRs8RaFWUfRSFoOjSXdbWgeQYYHuB8LTSmiqh5j7SR6svJ BKtaFjCFfOHYHyO+XGwO0EZaTdBv05gcZwcchJcoKEPCk4YLMX1o0web2VF3AgWM7j4e Qg== 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) 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-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.573,18.0.957 definitions=2023-06-06_03:2023-06-05,2023-06-06 signatures=0 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" To: devel@edk2.groups.io Cc: Giri Mudusuru , Ray Ni , Zhichao Gao , Andrew Fish Subject: [PATCH] ShellPkg: Increase PcdShellPrintBufferSize from UINT16 to UINT32 Date: Mon, 05 Jun 2023 23:02:00 -0700 Message-id: X-Mailer: git-send-email 2.39.2 (Apple Git-144) MIME-version: 1.0 Content-transfer-encoding: quoted-printable Increase max buffer size to support more than 64K. Signed-off-by: Giri Mudusuru Cc: Ray Ni Cc: Zhichao Gao Cc: Andrew Fish --- 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.
=0D (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.
=0D Copyright 2015-2018 Dell Technologies.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D + Copyright (C) 2023, Apple Inc. All rights reserved.
=0D =0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D **/=0D =0D #include "Shell.h"=0D @@ -2944,7 +2945,7 @@ RunScriptFileHandle ( ASSERT (!ShellCommandGetScriptExit ());=0D =0D PreScriptEchoState =3D ShellCommandGetEchoState ();=0D - PrintBuffSize =3D PcdGet16 (PcdShellPrintBufferSize);=0D + PrintBuffSize =3D PcdGet32 (PcdShellPrintBufferSize);=0D =0D NewScriptFile =3D (SCRIPT_FILE *)AllocateZeroPool (sizeof (SCRIPT_FILE))= ;=0D if (NewScriptFile =3D=3D NULL) {=0D 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
=0D Copyright 2016-2018 Dell Technologies.
=0D Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.
=0D - SPDX-License-Identifier: BSD-2-Clause-Patent=0D + Copyright (C) 2023, Apple Inc. All rights reserved.
=0D =0D + SPDX-License-Identifier: BSD-2-Clause-Patent=0D **/=0D =0D #include "UefiShellLib.h"=0D @@ -2952,8 +2953,8 @@ InternalShellPrintWorker ( CHAR16 *mPostReplaceFormat;=0D CHAR16 *mPostReplaceFormat2;=0D =0D - mPostReplaceFormat =3D AllocateZeroPool (PcdGet16 (PcdShellPrintBufferS= ize));=0D - mPostReplaceFormat2 =3D AllocateZeroPool (PcdGet16 (PcdShellPrintBufferS= ize));=0D + mPostReplaceFormat =3D AllocateZeroPool (PcdGet32 (PcdShellPrintBufferS= ize));=0D + mPostReplaceFormat2 =3D AllocateZeroPool (PcdGet32 (PcdShellPrintBufferS= ize));=0D =0D if ((mPostReplaceFormat =3D=3D NULL) || (mPostReplaceFormat2 =3D=3D NULL= )) {=0D SHELL_FREE_NON_NULL (mPostReplaceFormat);=0D @@ -2967,21 +2968,21 @@ InternalShellPrintWorker ( //=0D // Back and forth each time fixing up 1 of our flags...=0D //=0D - Status =3D ShellCopySearchAndReplace (Format, mPostReplaceFormat, PcdGet= 16 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE);=0D + Status =3D ShellCopySearchAndReplace (Format, mPostReplaceFormat, PcdGet= 32 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE);=0D ASSERT_EFI_ERROR (Status);=0D - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet16 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE);=0D + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet32 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE);=0D ASSERT_EFI_ERROR (Status);=0D - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet16 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE);=0D + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet32 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE);=0D ASSERT_EFI_ERROR (Status);=0D - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet16 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE);=0D + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFo= rmat2, PcdGet32 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE);=0D ASSERT_EFI_ERROR (Status);=0D - Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet16 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE);=0D + Status =3D ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceF= ormat, PcdGet32 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE);=0D ASSERT_EFI_ERROR (Status);=0D =0D //=0D // Use the last buffer from replacing to print from...=0D //=0D - UnicodeVSPrint (mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize),= mPostReplaceFormat, Marker);=0D + UnicodeVSPrint (mPostReplaceFormat2, PcdGet32 (PcdShellPrintBufferSize),= mPostReplaceFormat, Marker);=0D =0D if ((Col !=3D -1) && (Row !=3D -1)) {=0D Status =3D gST->ConOut->SetCursorPosition (gST->ConOut, Col, Row);=0D 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.
=0D # Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.
=0D # Copyright (c) 2016 - 2018, ARM Limited. All rights reserved.
=0D +# Copyright (C) 2023, Apple Inc. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D -#=0D ##=0D =0D [Defines]=0D @@ -84,7 +84,7 @@ gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|TRUE|BOOLEAN|0x0000= 0005=0D =0D ## This is the max buffer for ShellLib and internal Shell printings.=0D - gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize|16000|UINT16|0x000000= 0C=0D + gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize|16000|UINT32|0x000000= 0C=0D =0D ## This flag is used to control the commands available in the shell=0D gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel|3|UINT8|0x00000001=0D --=20 2.39.2 (Apple Git-144)