Revision: 14534
          http://sourceforge.net/p/edk2/code/14534
Author:   jcarsey
Date:     2013-08-08 22:31:54 +0000 (Thu, 08 Aug 2013)
Log Message:
-----------
ShellPkg: increase available size for PcdShellFileOperationSize

Some storage subsystems benefit by having shell file operation sizes (affecting 
copy and type commands right now) larger than 2^16.  This patch changes the 
PcdShellFileOperationSize type to 32-bits.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eugene Cohen <[email protected]>
reviewed-by: Jaben Carsey <[email protected]>

Modified Paths:
--------------
    trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
    trunk/edk2/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c
    trunk/edk2/ShellPkg/ShellPkg.dec

Modified: trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c 2013-08-08 
08:55:02 UTC (rev 14533)
+++ trunk/edk2/ShellPkg/Library/UefiShellLevel2CommandsLib/Cp.c 2013-08-08 
22:31:54 UTC (rev 14534)
@@ -89,7 +89,7 @@
   DestVolumeInfo  = NULL;
   ShellStatus     = SHELL_SUCCESS;
 
-  ReadSize = PcdGet16(PcdShellFileOperationSize);
+  ReadSize = PcdGet32(PcdShellFileOperationSize);
   // Why bother copying a file to itself
   if (StrCmp(Source, Dest) == 0) {
     return (SHELL_SUCCESS);
@@ -233,7 +233,7 @@
         //
         Buffer = AllocateZeroPool(ReadSize);
         ASSERT(Buffer != NULL);
-        while (ReadSize == PcdGet16(PcdShellFileOperationSize) && 
!EFI_ERROR(Status)) {
+        while (ReadSize == PcdGet32(PcdShellFileOperationSize) && 
!EFI_ERROR(Status)) {
           Status = ShellReadFile(SourceHandle, &ReadSize, Buffer);
           Status = ShellWriteFile(DestHandle, &ReadSize, Buffer);
         }

Modified: trunk/edk2/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c
===================================================================
--- trunk/edk2/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c       
2013-08-08 08:55:02 UTC (rev 14533)
+++ trunk/edk2/ShellPkg/Library/UefiShellLevel3CommandsLib/Type.c       
2013-08-08 22:31:54 UTC (rev 14534)
@@ -42,7 +42,7 @@
   UINTN       LoopVar;
   CHAR16      AsciiChar;
 
-  ReadSize = PcdGet16(PcdShellFileOperationSize);
+  ReadSize = PcdGet32(PcdShellFileOperationSize);
   Buffer = AllocateZeroPool(ReadSize);
   if (Buffer == NULL) {
     return (EFI_OUT_OF_RESOURCES);
@@ -51,7 +51,7 @@
   Status = ShellSetFilePosition(Handle, 0);
   ASSERT_EFI_ERROR(Status);
 
-  while (ReadSize == ((UINTN)PcdGet16(PcdShellFileOperationSize))){
+  while (ReadSize == ((UINTN)PcdGet32(PcdShellFileOperationSize))){
     ZeroMem(Buffer, ReadSize);
     Status = ShellReadFile(Handle, &ReadSize, Buffer);
     if (EFI_ERROR(Status)){

Modified: trunk/edk2/ShellPkg/ShellPkg.dec
===================================================================
--- trunk/edk2/ShellPkg/ShellPkg.dec    2013-08-08 08:55:02 UTC (rev 14533)
+++ trunk/edk2/ShellPkg/ShellPkg.dec    2013-08-08 22:31:54 UTC (rev 14534)
@@ -103,7 +103,7 @@
   gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength|50|UINT8|0x00000009
 
   ## This determins how many bytes are read out of files at a time for file 
operations (type, copy, etc...)
-  gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|1000|UINT16|0x0000000A
+  gEfiShellPkgTokenSpaceGuid.PcdShellFileOperationSize|1000|UINT32|0x0000000A
 
 [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx]
   ## This flag is used to control the protocols produced by the shell

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Get 100% visibility into Java/.NET code with AppDynamics Lite!
It's a free troubleshooting tool designed for production.
Get down to code-level detail for bottlenecks, with <2% overhead. 
Download for free and get started troubleshooting in minutes. 
http://pubads.g.doubleclick.net/gampad/clk?id=48897031&iu=/4140/ostg.clktrk
_______________________________________________
edk2-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/edk2-commits

Reply via email to