summaryrefslogtreecommitdiffstats
path: root/ShellPkg/Library/UefiShellLib/UefiShellLib.c
diff options
context:
space:
mode:
authorGiri Mudusuru <girim@apple.com>2023-06-06 14:02:00 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-10-17 03:04:05 +0000
commita445e1a42ccf3cb9f70537c7cd80ece689bf4d9a (patch)
treed3c2270eb74984ad025b1112be94fb11d47b6c50 /ShellPkg/Library/UefiShellLib/UefiShellLib.c
parent03d6569f70939d2a1653265367121212459a6b89 (diff)
downloadedk2-a445e1a42ccf3cb9f70537c7cd80ece689bf4d9a.tar.gz
edk2-a445e1a42ccf3cb9f70537c7cd80ece689bf4d9a.tar.bz2
edk2-a445e1a42ccf3cb9f70537c7cd80ece689bf4d9a.zip
ShellPkg: Increase PcdShellPrintBufferSize from UINT16 to UINT32
Increase max buffer size to support more than 64K. Signed-off-by: Giri Mudusuru <girim@apple.com> Cc: Ray Ni <ray.ni@intel.com> Cc: Zhichao Gao <zhichao.gao@intel.com> Cc: Andrew Fish <afish@apple.com> Reviewed-by: Zhichao Gao <zhichao.gao@intel.com>
Diffstat (limited to 'ShellPkg/Library/UefiShellLib/UefiShellLib.c')
-rw-r--r--ShellPkg/Library/UefiShellLib/UefiShellLib.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c b/ShellPkg/Library/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<BR>
Copyright 2016-2018 Dell Technologies.<BR>
Copyright (c) 2006 - 2019, Intel Corporation. All rights reserved.<BR>
- SPDX-License-Identifier: BSD-2-Clause-Patent
+ Copyright (C) 2023, Apple Inc. All rights reserved.<BR>
+ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
#include "UefiShellLib.h"
@@ -2952,8 +2953,8 @@ InternalShellPrintWorker (
CHAR16 *mPostReplaceFormat;
CHAR16 *mPostReplaceFormat2;
- mPostReplaceFormat = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
- mPostReplaceFormat2 = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
+ mPostReplaceFormat = AllocateZeroPool (PcdGet32 (PcdShellPrintBufferSize));
+ mPostReplaceFormat2 = AllocateZeroPool (PcdGet32 (PcdShellPrintBufferSize));
if ((mPostReplaceFormat == NULL) || (mPostReplaceFormat2 == NULL)) {
SHELL_FREE_NON_NULL (mPostReplaceFormat);
@@ -2967,21 +2968,21 @@ InternalShellPrintWorker (
//
// Back and forth each time fixing up 1 of our flags...
//
- Status = ShellCopySearchAndReplace (Format, mPostReplaceFormat, PcdGet16 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE);
+ Status = ShellCopySearchAndReplace (Format, mPostReplaceFormat, PcdGet32 (PcdShellPrintBufferSize), L"%N", L"%%N", FALSE, FALSE);
ASSERT_EFI_ERROR (Status);
- Status = ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE);
+ Status = ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFormat2, PcdGet32 (PcdShellPrintBufferSize), L"%E", L"%%E", FALSE, FALSE);
ASSERT_EFI_ERROR (Status);
- Status = ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceFormat, PcdGet16 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE);
+ Status = ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceFormat, PcdGet32 (PcdShellPrintBufferSize), L"%H", L"%%H", FALSE, FALSE);
ASSERT_EFI_ERROR (Status);
- Status = ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE);
+ Status = ShellCopySearchAndReplace (mPostReplaceFormat, mPostReplaceFormat2, PcdGet32 (PcdShellPrintBufferSize), L"%B", L"%%B", FALSE, FALSE);
ASSERT_EFI_ERROR (Status);
- Status = ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceFormat, PcdGet16 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE);
+ Status = ShellCopySearchAndReplace (mPostReplaceFormat2, mPostReplaceFormat, PcdGet32 (PcdShellPrintBufferSize), L"%V", L"%%V", FALSE, FALSE);
ASSERT_EFI_ERROR (Status);
//
// Use the last buffer from replacing to print from...
//
- UnicodeVSPrint (mPostReplaceFormat2, PcdGet16 (PcdShellPrintBufferSize), mPostReplaceFormat, Marker);
+ UnicodeVSPrint (mPostReplaceFormat2, PcdGet32 (PcdShellPrintBufferSize), mPostReplaceFormat, Marker);
if ((Col != -1) && (Row != -1)) {
Status = gST->ConOut->SetCursorPosition (gST->ConOut, Col, Row);