Re: [edk2] [EDK2] [PATCH] ShellPkg: Ensure UEFI apps open the correct StdOut

2016-03-01 Thread Carsey, Jaben
Jim,

Given that the email says " Dell - Internal Use - Confidential", I feel odd 
applying it to the open source.  Can you remove that line?


-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim_dai...@dell.com
> Sent: Tuesday, March 01, 2016 12:48 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [EDK2] [PATCH] ShellPkg: Ensure UEFI apps open the correct
> StdOut
> Importance: High
> 
> Dell - Internal Use - Confidential
> 
> ShellPkg: Ensure UEFI apps open the correct StdOut
> 
> When an app opens StdOut for writing, ensure it opens the correct StdOut
> (whatever was set up for the app in the NewShellParametersProtocol).
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey 
> ---
>  ShellPkg/Application/Shell/ShellProtocol.c | 7 ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellProtocol.c
> b/ShellPkg/Application/Shell/ShellProtocol.c
> index 22d3987..20a3423 100644
> --- a/ShellPkg/Application/Shell/ShellProtocol.c
> +++ b/ShellPkg/Application/Shell/ShellProtocol.c
> @@ -2,6 +2,7 @@
>Member functions of EFI_SHELL_PROTOCOL and functions for creation,
>manipulation, and initialization of EFI_SHELL_PROTOCOL.
> 
> +  Copyright 2016 Dell Inc.
>(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
>Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
>This program and the accompanying materials @@ -1268,12 +1269,12 @@
> EfiShellOpenFileByName(
>//
>if (StrCmp(FileName, L">o") == 0) {
>  //
> -// make sure not writing to StdIn
> +// make sure not reading from StdOut
>  //
>  if ((OpenMode & EFI_FILE_MODE_READ) != 0) {
>return (EFI_INVALID_PARAMETER);
>  }
> -*FileHandle = &FileInterfaceStdOut;
> +*FileHandle = ShellInfoObject.NewShellParametersProtocol->StdOut;
>  return (EFI_SUCCESS);
>}
> 
> @@ -1290,7 +1291,7 @@ EfiShellOpenFileByName(
>//
>if (StrCmp(FileName, L">e") == 0) {
>  //
> -// make sure not writing to StdIn
> +// make sure not reading from StdErr
>  //
>  if ((OpenMode & EFI_FILE_MODE_READ) != 0) {
>return (EFI_INVALID_PARAMETER);
> --
> 2.7.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Force shell device mapping

2016-03-01 Thread Carsey, Jaben
You could use map to delete the standard map names for sure, then remap them 
how you like.  I think the problem would be parsing the HD node in a script 
file though.

-Jaben

> -Original Message-
> From: Foster, Matthew I
> Sent: Tuesday, March 01, 2016 9:00 AM
> To: Carsey, Jaben ; Laszlo Ersek
> 
> Cc: edk2-devel@lists.01.org 
> Subject: RE: [edk2] Force shell device mapping
> Importance: High
> 
> Thanks, even if I can re-map FS0 and FS1 in the startup.nsh script that would
> work for me. Is that possible using the map command?
> 
> -Original Message-
> From: Carsey, Jaben
> Sent: Tuesday, March 1, 2016 9:14 AM
> To: Laszlo Ersek 
> Cc: Foster, Matthew I ; edk2-devel@lists.01.org
> 
> Subject: Re: [edk2] Force shell device mapping
> 
> Matthew,
> 
> I don't know how to do that quickly given the current code.  When you
> change the HD node of the device path, the whole thing changes.
> 
> The consistent name is designed to accommodate adding or removing devices
> and not l losing the names of the other devices in the system.  This is not 
> really
> designed to handle moving all the devices at one time.
> 
> I have a vague memory that we use the sortlib to sort the device paths.
> Maybe the compare device path function should be optimized to do more
> detailed analysis of the actual nodes?
> 
> I wonder if we use alphabetical sorting, but that should catch the numbers and
> sort the same in both your cases...
> 
> -Jaben
> 
> Sent from my iPad.
> 
> > On Mar 1, 2016, at 8:11 AM, Laszlo Ersek  wrote:
> >
> >> On 03/01/16 16:55, Foster, Matthew I wrote:
> >> Is there an easy to way to force the shell to map certain partitions to 
> >> FS0:
> and FS1: respectively? For example, I have an EMMC device that has 2 EFI
> partitions(GPT). When I setup the device with these 2 EFI partitions using
> partition number 2 and 9, they map how I need it, in order of partition
> numbering. Partition 2 maps to FS0: and Partition 9 maps to FS1: as seen
> below:
> >>
> >>  FS0: Alias(s):HD31c:;BLK8:
> >>  PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(2,GPT,148C6307-DAEC-
> 4037-B963-62098BF01CB1,0x200,0x4800)
> >>  FS1: Alias(s):HD31j:;BLK14:
> >>
> >> PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(9,GPT,A753B509-D2CF-49D0-
> BCC9
> >> -59045E9E9338,0x34D00,0x4800)
> >>
> >> But if I change the partitions numbers to 4 and 10 respectively, they now
> appear as seen below, 4 mapped to FS1: and 10 mapped to FS0:
> >>
> >>  FS1: Alias(s):HD31e:;BLK9:
> >>  PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(4,GPT,EE7E022C-082E-
> 4B95-87EC-482ABFEE6EDE,0x200,0x4800)
> >>  FS0: Alias(s):HD31k:;BLK1:
> >>
> >> PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(10,GPT,EA0E4904-BC5D-4583-
> 921
> >> 9-5021E5F6207C,0x34B00,0x4800)
> >>
> >> Wondering if there is a way to force this mapping a certain way, (in my
> case, lower number partition mapped to FS0 and the higher partition number
> mapped to FS1:)  without changing the shell code.
> >
> > See the MAP command in the UEFI shell spec.
> >
> > It supports "consistent mapping", but in the above you are changing
> > hardware configuration, so I think it won't apply.
> >
> > You can still use "map -sfo", parse the output, and locate the mapped
> > name based on the textually formatted device path (third column).
> >
> > Thanks
> > Laszlo
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Force shell device mapping

2016-03-01 Thread Carsey, Jaben
Matthew, 

I don't know how to do that quickly given the current code.  When you change 
the HD node of the device path, the whole thing changes.  

The consistent name is designed to accommodate adding or removing devices and 
not l losing the names of the other devices in the system.  This is not really 
designed to handle moving all the devices at one time.

I have a vague memory that we use the sortlib to sort the device paths.  Maybe 
the compare device path function should be optimized to do more detailed 
analysis of the actual nodes?

I wonder if we use alphabetical sorting, but that should catch the numbers and 
sort the same in both your cases...

-Jaben

Sent from my iPad.

> On Mar 1, 2016, at 8:11 AM, Laszlo Ersek  wrote:
> 
>> On 03/01/16 16:55, Foster, Matthew I wrote:
>> Is there an easy to way to force the shell to map certain partitions to FS0: 
>> and FS1: respectively? For example, I have an EMMC device that has 2 EFI 
>> partitions(GPT). When I setup the device with these 2 EFI partitions using 
>> partition number 2 and 9, they map how I need it, in order of partition 
>> numbering. Partition 2 maps to FS0: and Partition 9 maps to FS1: as seen 
>> below:
>> 
>>  FS0: Alias(s):HD31c:;BLK8:
>>  
>> PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(2,GPT,148C6307-DAEC-4037-B963-62098BF01CB1,0x200,0x4800)
>>  FS1: Alias(s):HD31j:;BLK14:
>>  
>> PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(9,GPT,A753B509-D2CF-49D0-BCC9-59045E9E9338,0x34D00,0x4800)
>> 
>> But if I change the partitions numbers to 4 and 10 respectively, they now 
>> appear as seen below, 4 mapped to FS1: and 10 mapped to FS0:
>> 
>>  FS1: Alias(s):HD31e:;BLK9:
>>  
>> PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(4,GPT,EE7E022C-082E-4B95-87EC-482ABFEE6EDE,0x200,0x4800)
>>  FS0: Alias(s):HD31k:;BLK1:
>>  
>> PciRoot(0x0)/Pci(0x10,0x0)/Ctrl(0x0)/HD(10,GPT,EA0E4904-BC5D-4583-9219-5021E5F6207C,0x34B00,0x4800)
>> 
>> Wondering if there is a way to force this mapping a certain way, (in my 
>> case, lower number partition mapped to FS0 and the higher partition number 
>> mapped to FS1:)  without changing the shell code.
> 
> See the MAP command in the UEFI shell spec.
> 
> It supports "consistent mapping", but in the above you are changing
> hardware configuration, so I think it won't apply.
> 
> You can still use "map -sfo", parse the output, and locate the mapped
> name based on the textually formatted device path (third column).
> 
> Thanks
> Laszlo
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Add FileSize member to shell memory file structure.

2016-02-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel-boun...@lists.01.org [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of jim_dai...@dell.com
> Sent: Thursday, February 18, 2016 6:41 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [PATCH] ShellPkg: Add FileSize member to shell memory file
> structure.
> 
> ShellPkg: Add FileSize member to shell memory file structure.
> 
> The shell uses the memory file structure to manage temporary files in
> memory that support piping of output from one command into the the
> input of another command.  The BufferSize member is the size of the
> internal buffer, not the size of the data that was written to the
> file. So, it was possible to read beyond the EOF of these files as
> reads used BufferSize. Now FileSize tracks the actual size of these
> files (the number of bytes written, not the number of bytes available
> in the buffer), and the reads use this member.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey 
> ---
>  ShellPkg/Application/Shell/FileHandleWrappers.c | 9 ++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> index ecad500..a9117be 100644
> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> @@ -1325,6 +1325,7 @@ typedef struct {
>UINT64Position;
>UINT64BufferSize;
>BOOLEAN   Unicode;
> +  UINT64FileSize;
>  } EFI_FILE_PROTOCOL_MEM;
> 
>  /**
> @@ -1343,7 +1344,7 @@ FileInterfaceMemSetPosition(
>OUT UINT64 Position
>)
>  {
> -  if (Position <= ((EFI_FILE_PROTOCOL_MEM*)This)->BufferSize) {
> +  if (Position <= ((EFI_FILE_PROTOCOL_MEM*)This)->FileSize) {
>  ((EFI_FILE_PROTOCOL_MEM*)This)->Position = Position;
>  return (EFI_SUCCESS);
>} else {
> @@ -1402,6 +1403,7 @@ FileInterfaceMemWrite(
>  }
>  CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, Buffer,
> *BufferSize);
>  MemFile->Position += (*BufferSize);
> +MemFile->FileSize = MemFile->Position;
>  return (EFI_SUCCESS);
>} else {
>  //
> @@ -1418,6 +1420,7 @@ FileInterfaceMemWrite(
>  }
>  CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, AsciiBuffer,
> AsciiStrSize(AsciiBuffer));
>  MemFile->Position += (*BufferSize / sizeof(CHAR16));
> +MemFile->FileSize = MemFile->Position;
>  FreePool(AsciiBuffer);
>  return (EFI_SUCCESS);
>}
> @@ -1443,8 +1446,8 @@ FileInterfaceMemRead(
>EFI_FILE_PROTOCOL_MEM  *MemFile;
> 
>MemFile = (EFI_FILE_PROTOCOL_MEM *) This;
> -  if (*BufferSize > (UINTN)((MemFile->BufferSize) - (UINTN)(MemFile-
> >Position))) {
> -(*BufferSize) = (UINTN)((MemFile->BufferSize) - (UINTN)(MemFile-
> >Position));
> +  if (*BufferSize > (UINTN)((MemFile->FileSize) - 
> (UINTN)(MemFile->Position)))
> {
> +(*BufferSize) = (UINTN)((MemFile->FileSize) - 
> (UINTN)(MemFile->Position));
>}
>CopyMem(Buffer, ((UINT8*)MemFile->Buffer) + MemFile->Position,
> (*BufferSize));
>MemFile->Position = MemFile->Position + (*BufferSize);
> --
> 2.7.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] RESEND: [PATCH] ShellPkg: Do not write the UNICODE BOM on ConOut

2016-02-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel-boun...@lists.01.org [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of jim_dai...@dell.com
> Sent: Thursday, February 18, 2016 6:47 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] RESEND: [PATCH] ShellPkg: Do not write the UNICODE BOM on
> ConOut
> 
> ShellPkg: Do not write the UNICODE BOM on ConOut.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey 
> ---
>  ShellPkg/Application/Shell/FileHandleWrappers.c | 6 --
>  1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> index f8306e2..ecad500 100644
> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> @@ -160,9 +160,11 @@ FileInterfaceStdOutWrite(
>  {
>if (ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoConsoleOut) {
>  return (EFI_UNSUPPORTED);
> -  } else {
> -return (gST->ConOut->OutputString(gST->ConOut, Buffer));
>}
> +  if (*((CHAR16 *)Buffer) == gUnicodeFileTag) {
> +return (gST->ConOut->OutputString(gST->ConOut, (CHAR16 *)Buffer + 1));
> +  }
> +  return (gST->ConOut->OutputString(gST->ConOut, Buffer));
>  }
> 
>  /**
> --
> 2.7.1.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Increase reallocation size for temp memory files

2016-02-29 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel-boun...@lists.01.org [mailto:edk2-devel-
> boun...@lists.01.org] On Behalf Of jim_dai...@dell.com
> Sent: Thursday, February 18, 2016 7:52 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [PATCH] ShellPkg: Increase reallocation size for temp memory
> files
> 
> ShellPkg: Increase reallocation size for temp memory files
> 
> If data of any real size were to be piped from one command to another, an
> inordinate amount of time could be taken up by reallocating memory that is
> only 10 bytes bigger than what is currently needed. Also, this could cause
> unwelcome memory fragmentation.
> 
> Added a define to control how much memory is reallocated beyond that
> which is currently needed. Set it to 1K vs. the original 10 bytes.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey
> ---
> ShellPkg/Application/Shell/FileHandleWrappers.c | 10 ++
> 1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> index a9117be..1a61521 100644
> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> @@ -18,6 +18,8 @@
> #include "Shell.h"
> #include "FileHandleInternal.h"
> 
> +#define MEM_WRITE_REALLOC_SIZE 1024
> +
> /**
> File style interface for console (Open).
> 
> @@ -1398,8 +1400,8 @@ FileInterfaceMemWrite(
> // Unicode
> //
> if ((UINTN)(MemFile->Position + (*BufferSize)) > (UINTN)(MemFile-
> >BufferSize)) {
> - MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + (*BufferSize) + 10, MemFile->Buffer);
> - MemFile->BufferSize += (*BufferSize) + 10;
> + MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + (*BufferSize) + MEM_WRITE_REALLOC_SIZE,
> MemFile->Buffer);
> + MemFile->BufferSize += (*BufferSize) + MEM_WRITE_REALLOC_SIZE;
> }
> CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, Buffer,
> *BufferSize);
> MemFile->Position += (*BufferSize); @@ -1415,8 +1417,8 @@
> FileInterfaceMemWrite(
> }
> AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer);
> if ((UINTN)(MemFile->Position + AsciiStrSize(AsciiBuffer)) > (UINTN)(MemFile-
> >BufferSize)) {
> - MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) + 10, MemFile-
> >Buffer);
> - MemFile->BufferSize += AsciiStrSize(AsciiBuffer) + 10;
> + MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) +
> MEM_WRITE_REALLOC_SIZE, MemFile->Buffer);
> + MemFile->BufferSize += AsciiStrSize(AsciiBuffer) +
> + MEM_WRITE_REALLOC_SIZE;
> }
> CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, AsciiBuffer,
> AsciiStrSize(AsciiBuffer));
> MemFile->Position += (*BufferSize / sizeof(CHAR16));
> --
> 2.7.1.windows.1
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Fix unexpected behavior of mouse cursor in Editor.

2016-02-26 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Thursday, February 25, 2016 10:54 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> ; Ni, Ruiyu 
> Subject: [PATCH] ShellPkg: Fix unexpected behavior of mouse cursor in
> Editor.
> Importance: High
> 
> USB mouse cursor cannot move unless the left button is down. The patch
> refresh the FileBuffer of Editor every time when the 'MainEditorRefresh'
> is called to fix this bug.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c | 7
> ---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> index f972c37..4eb7d9e 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/MainTextEditor.c
> @@ -1,7 +1,7 @@
>  /** @file
>Implements editor interface functions.
> 
> -  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved. 
> +  Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved. 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -1617,8 +1617,8 @@ MainEditorRefresh (
> 
>  MainTitleBarRefresh (MainEditor.FileBuffer->FileName,
> MainEditor.FileBuffer->FileType, MainEditor.FileBuffer->ReadOnly,
> MainEditor.FileBuffer->FileModified, MainEditor.ScreenSize.Column,
> MainEditor.ScreenSize.Row, 0, 0);
>  FileBufferRestorePosition ();
> -FileBufferRefresh ();
>}
> +
>if (EditorFirst
>  || FileBufferBackupVar.FilePosition.Row != FileBuffer.FilePosition.Row
>  || FileBufferBackupVar.FilePosition.Column !=
> FileBuffer.FilePosition.Column
> @@ -1627,13 +1627,14 @@ MainEditorRefresh (
> 
>  StatusBarRefresh (EditorFirst, MainEditor.ScreenSize.Row,
> MainEditor.ScreenSize.Column, MainEditor.FileBuffer->FilePosition.Row,
> MainEditor.FileBuffer->FilePosition.Column, MainEditor.FileBuffer-
> >ModeInsert);
>  FileBufferRestorePosition ();
> -FileBufferRefresh ();
>}
> 
>if (EditorFirst) {
>  FileBufferRestorePosition ();
>}
> 
> +  FileBufferRefresh ();
> +
>//
>// EditorFirst is now set to FALSE
>//
> --
> 2.7.1.windows.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v4 0/2] Enhance Shell to support finding help message embeded in resource section.

2016-02-23 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
> Shumin
> Sent: Monday, February 22, 2016 11:01 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH v4 0/2] Enhance Shell to support finding help message
> embeded in resource section.
> Importance: High
> 
> 1. Enhance Shell to support finding help message in resource section of an
> application image if .MAN file is missing.
> 2. Enhance an sample application, HelloWorld, to add sample help message
> text.
> 
> Difference with previous version:
> 1.Not public ShellManHiiGuid since it's just uesed in the module.
> 2.Refine the comments of Helloworld application.
> 
> Qiu Shumin (2):
>   ShellPkg: Support finding help message embedded in resource section.
>   MdeModulePkg: Add sample help information for HelloWorld application.
> 
>  MdeModulePkg/Application/HelloWorld/HelloWorld.c   |  11 +-
>  MdeModulePkg/Application/HelloWorld/HelloWorld.inf |   8 +-
>  .../Application/HelloWorld/HelloWorldStr.uni   |  27 +++
>  ShellPkg/Application/Shell/Shell.h |  14 +-
>  ShellPkg/Application/Shell/Shell.inf   |   4 +-
>  ShellPkg/Application/Shell/ShellManParser.c| 258
> +++--
>  6 files changed, 303 insertions(+), 19 deletions(-)
>  create mode 100644
> MdeModulePkg/Application/HelloWorld/HelloWorldStr.uni
> 
> --
> 2.7.1.windows.2
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Do NULL pointer check before the pointer is used.

2016-02-21 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

-Jaben

Sent from my iPad.

> On Feb 21, 2016, at 6:49 PM, Qiu, Shumin  wrote:
> 
> Do NULL pointer check before the pointer is used to avoid dereferenced.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
> ShellPkg/Library/UefiShellLib/UefiShellLib.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c 
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> index 70852a9..cf89a4a 100644
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> @@ -4071,7 +4071,7 @@ ShellFileHandleReturnLine(
> Status = ShellFileHandleReadLine(Handle, RetVal, &Size, FALSE, Ascii);
> 
>   }
> -  if (Status == EFI_END_OF_FILE && *RetVal != CHAR_NULL) {
> +  if (Status == EFI_END_OF_FILE && RetVal != NULL && *RetVal != CHAR_NULL) {
> Status = EFI_SUCCESS;
>   }
>   if (EFI_ERROR(Status) && (RetVal != NULL)) {
> -- 
> 2.7.1.windows.2
> 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Increase reallocation size for temp memory files

2016-02-18 Thread Carsey, Jaben
That sounds good to me.

> -Original Message-
> From: jim_dai...@dell.com [mailto:jim_dai...@dell.com]
> Sent: Thursday, February 18, 2016 8:26 AM
> To: Carsey, Jaben 
> Cc: Qiu, Shumin ; edk2-devel@lists.01.org
> Subject: RE: [edk2] [PATCH] ShellPkg: Increase reallocation size for temp
> memory files
> Importance: High
> 
> Dell - Internal Use - Confidential
> 
> >> +#define MEM_WRITE_REALLOC_SIZE 1024
> >
> > Could this name change to something more clear? This is not the
> > allocate size, this is more like the reallocated overhead that is
> > allocated extra in case we have a sequence of reallocates...
> 
> I have no problem with whatever name you think is better. Maybe something
> along the lines of MEM_WRITE_REALLOC_OVERHEAD?

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Increase reallocation size for temp memory files

2016-02-18 Thread Carsey, Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim_dai...@dell.com
> Sent: Thursday, February 18, 2016 7:52 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [PATCH] ShellPkg: Increase reallocation size for temp memory
> files
> Importance: High
> 
> ShellPkg: Increase reallocation size for temp memory files
> 
> If data of any real size were to be piped from one command to another, an
> inordinate amount of time could be taken up by reallocating memory that is
> only 10 bytes bigger than what is currently needed. Also, this could cause
> unwelcome memory fragmentation.
> 
> Added a define to control how much memory is reallocated beyond that
> which is currently needed. Set it to 1K vs. the original 10 bytes.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey
> ---
> ShellPkg/Application/Shell/FileHandleWrappers.c | 10 ++
> 1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> index a9117be..1a61521 100644
> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> @@ -18,6 +18,8 @@
> #include "Shell.h"
> #include "FileHandleInternal.h"
> 
> +#define MEM_WRITE_REALLOC_SIZE 1024

Could this name change to something more clear?  This is not the allocate size, 
this is more like the reallocated overhead that is allocated extra in case we 
have a sequence of reallocates...


> +
> /**
> File style interface for console (Open).
> 
> @@ -1398,8 +1400,8 @@ FileInterfaceMemWrite(
> // Unicode
> //
> if ((UINTN)(MemFile->Position + (*BufferSize)) > (UINTN)(MemFile-
> >BufferSize)) {
> - MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + (*BufferSize) + 10, MemFile->Buffer);
> - MemFile->BufferSize += (*BufferSize) + 10;
> + MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + (*BufferSize) + MEM_WRITE_REALLOC_SIZE,
> MemFile->Buffer);
> + MemFile->BufferSize += (*BufferSize) + MEM_WRITE_REALLOC_SIZE;
> }
> CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, Buffer,
> *BufferSize);
> MemFile->Position += (*BufferSize); @@ -1415,8 +1417,8 @@
> FileInterfaceMemWrite(
> }
> AsciiSPrint(AsciiBuffer, *BufferSize, "%S", Buffer);
> if ((UINTN)(MemFile->Position + AsciiStrSize(AsciiBuffer)) > (UINTN)(MemFile-
> >BufferSize)) {
> - MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) + 10, MemFile-
> >Buffer);
> - MemFile->BufferSize += AsciiStrSize(AsciiBuffer) + 10;
> + MemFile->Buffer = ReallocatePool((UINTN)(MemFile->BufferSize),
> (UINTN)(MemFile->BufferSize) + AsciiStrSize(AsciiBuffer) +
> MEM_WRITE_REALLOC_SIZE, MemFile->Buffer);
> + MemFile->BufferSize += AsciiStrSize(AsciiBuffer) +
> + MEM_WRITE_REALLOC_SIZE;
> }
> CopyMem(((UINT8*)MemFile->Buffer) + MemFile->Position, AsciiBuffer,
> AsciiStrSize(AsciiBuffer));
> MemFile->Position += (*BufferSize / sizeof(CHAR16));
> --
> 2.7.1.windows.1
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v1 1/1] StdLib/BsdSocketLib: Fix minor memory leak.

2016-02-17 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Daryl McDaniel
> Sent: Tuesday, February 16, 2016 12:09 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Colin King
> 
> Subject: [edk2] [PATCH v1 1/1] StdLib/BsdSocketLib: Fix minor memory leak.
> Importance: High
> 
> Fixes a minor memory leak in function res_mkupdrec() by
> freeing rrecp on error return.
> 
> The error return is triggered by one of two conditions:
>   1.  rrecp is NULL (calloc failed)
>   2.  strdup(dname) returns NULL
> 
> Previously, the function just returned NULL.  This patch adds a call to
> free rrecp before returning NULL.  Since the free() function will properly
> do nothing when called with a NULL parameter, it is not necessary to
> separate the two tests into separate if clauses.
> 
> Reported-by: Colin King 
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> ---
>  StdLib/BsdSocketLib/res_mkupdate.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/StdLib/BsdSocketLib/res_mkupdate.c
> b/StdLib/BsdSocketLib/res_mkupdate.c
> index d81d7d6f1518..db8540ab4b85 100644
> --- a/StdLib/BsdSocketLib/res_mkupdate.c
> +++ b/StdLib/BsdSocketLib/res_mkupdate.c
> @@ -438,8 +438,10 @@ res_mkupdrec(int section, const char *dname,
>   u_int class, u_int type, u_long ttl) {
>  ns_updrec *rrecp = (ns_updrec *)calloc(1, sizeof(ns_updrec));
> 
> -if (!rrecp || !(rrecp->r_dname = strdup(dname)))
> +if (!rrecp || !(rrecp->r_dname = strdup(dname))) {
> +free(rrecp);
>  return (NULL);
> +}
>  rrecp->r_class = (u_int16_t)class;
>  rrecp->r_type = (u_int16_t)type;
>  rrecp->r_ttl = (u_int32_t)ttl;
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Do NULL pointer check before the pointer is used.

2016-02-17 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
> Shumin
> Sent: Monday, February 15, 2016 6:07 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [PATCH] ShellPkg: Do NULL pointer check before the pointer
> is used.
> Importance: High
> 
> The pointer 'FileInterface->Buffer' returned from 'AllocateZeroPool' in
> function
> 'CreateFileInterfaceMem' may be NULL and will be dereferenced at the
> following code.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Application/Shell/FileHandleWrappers.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Application/Shell/FileHandleWrappers.c
> b/ShellPkg/Application/Shell/FileHandleWrappers.c
> index 168b78b..f8306e2 100644
> --- a/ShellPkg/Application/Shell/FileHandleWrappers.c
> +++ b/ShellPkg/Application/Shell/FileHandleWrappers.c
> @@ -3,7 +3,7 @@
>StdIn, StdOut, StdErr, etc...).
> 
>Copyright 2016 Dell Inc.
> -  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
>(C) Copyright 2013 Hewlett-Packard Development Company, L.P.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
> @@ -1516,6 +1516,10 @@ CreateFileInterfaceMem(
> 
>if (Unicode) {
>  FileInterface->Buffer = AllocateZeroPool(sizeof(gUnicodeFileTag));
> +if (FileInterface->Buffer == NULL) {
> +  FreePool (FileInterface);
> +  return NULL;
> +}
>  *((CHAR16 *) (FileInterface->Buffer)) = EFI_UNICODE_BYTE_ORDER_MARK;
>  FileInterface->BufferSize = 2;
>  FileInterface->Position = 2;
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: ShellFileHandleReadLine must return UCS2 lines

2016-02-10 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ryan Harkin [mailto:ryan.har...@linaro.org]
> Sent: Wednesday, February 10, 2016 6:16 AM
> To: jim_dai...@dell.com
> Cc: edk2-devel@lists.01.org; Carsey, Jaben ; Qiu,
> Shumin 
> Subject: Re: [edk2] [PATCH] ShellPkg: ShellFileHandleReadLine must return
> UCS2 lines
> Importance: High
> 
> Hi Jim,
> 
> Thanks for the quick fix!  It works for me on ARM Juno R0, R1 and R2
> and Versatile Express TC2.
> 
> On 10 February 2016 at 13:45,   wrote:
> > ShellPkg: ShellFileHandleReadLine must return UCS2 lines.
> >
> > An earlier change had this function returning the type of lines that were in
> the file being read (ASCII or UCS2).  The way it is used, UCS2 output is
> expected, even when the file being read is ASCII. This change restores that
> behavior and documents it.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Jim Dailey
> ^^ your email address is missing from your sign-off, I think it's
> mandatory, but don't hold me to that.
> 
> I haven't had chance to read and understand the code, but I can at
> least provide:
> 
> Tested-by: Ryan Harkin 
> 
> Thanks,
> Ryan.
> 
> > ---
> > diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> > index 4b53c70..abff0d3 100644
> > --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> > +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.c
> > @@ -4084,9 +4084,20 @@ ShellFileHandleReturnLine(
> >If the position upon start is 0, then the Ascii Boolean will be set.  
> > This
> should be
> >maintained and not changed for all operations with the same file.
> >
> > +  NOTE: LINES THAT ARE RETURNED BY THIS FUNCTION ARE UCS2, EVEN IF
> THE FILE BEING READ
> > +IS IN ASCII FORMAT.
> > +
> >@param[in]   HandleSHELL_FILE_HANDLE to read from.
> > -  @param[in, out]  BufferThe pointer to buffer to read into.
> > -  @param[in, out]  Size  The pointer to number of bytes in Buffer.
> > +  @param[in, out]  BufferThe pointer to buffer to read into. If 
> > this
> function
> > + returns EFI_SUCCESS, then on output 
> > Buffer will
> > + contain a UCS2 string, even if the file 
> > being
> > + read is ASCII.
> > +  @param[in, out]  Size  On input, pointer to number of bytes in 
> > Buffer.
> > + On output, unchanged unless Buffer is too 
> > small
> > + to contain the next line of the file. In 
> > that
> > + case Size is set to the number of bytes 
> > needed
> > + to hold the next line of the file (as a 
> > UCS2
> > + string, even if it is an ASCII file).
> >@param[in]   Truncate  If the buffer is large enough, this has 
> > no effect.
> >   If the buffer is is too small and 
> > Truncate is TRUE,
> >   the line will be truncated.
> > @@ -4165,43 +4176,27 @@ ShellFileHandleReadLine(
> >  //
> >  // if we have space save it...
> >  //
> > -if ((CountSoFar + 1) * CharSize < *Size){
> > +if ((CountSoFar+1)*sizeof(CHAR16) < *Size){
> >ASSERT(Buffer != NULL);
> > -  if (*Ascii) {
> > -((CHAR8*)Buffer)[CountSoFar] = (CHAR8) CharBuffer;
> > -((CHAR8*)Buffer)[CountSoFar+1] = '\0';
> > -  }
> > -  else {
> > -((CHAR16*)Buffer)[CountSoFar] = CharBuffer;
> > -((CHAR16*)Buffer)[CountSoFar+1] = CHAR_NULL;
> > -  }
> > +  ((CHAR16*)Buffer)[CountSoFar] = CharBuffer;
> > +  ((CHAR16*)Buffer)[CountSoFar+1] = CHAR_NULL;
> >  }
> >}
> >
> >//
> >// if we ran out of space tell when...
> >//
> > -  if (Status != EFI_END_OF_FILE){
> > -if ((CountSoFar + 1) * CharSize > *Size){
> > -  *Size = (CountSoFar + 1) * CharSize;
> > -  if (!Truncate) {
> > -gEfiShellProtocol->SetFilePosition(Handle, OriginalFilePosition);
> > -  } else {
> > -DEBUG((DEBUG_WARN, "The line was truncated in
> ShellFileHandleReadLine"));
> > -  }
> > -  return (EFI_BUFFER_TOO_SMALL);
> > -}
> > -
> > -if (*Ascii) {
> > - 

Re: [edk2] [PATCH] Maintainers.txt: Update maintainers for ShellBinPkg

2016-02-09 Thread Carsey, Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif
> Lindholm
> Sent: Tuesday, February 09, 2016 10:13 AM
> To: Carsey, Jaben 
> Cc: edk2-devel@lists.01.org; Qiu, Shumin ; Ard
> Biesheuvel 
> Subject: Re: [edk2] [PATCH] Maintainers.txt: Update maintainers for
> ShellBinPkg
> Importance: High
> 
> On Tue, Feb 09, 2016 at 06:03:45PM +, Carsey, Jaben wrote:
> >
> >
> > > -Original Message-
> > > From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> > > Sent: Tuesday, February 09, 2016 9:19 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Carsey, Jaben ; Qiu, Shumin
> > > ; Ard Biesheuvel 
> > > Subject: [PATCH] Maintainers.txt: Update maintainers for ShellBinPkg
> > > Importance: High
> > >
> > > Separate ShellPkg and ShellBinPkg into separate entities.
> > > Add Leif Lindholm and Ard Biesheuvel as ShellBinPkg maintainers
> > > for ARM/AArch64 only.
> > > Add indicaton that Jaben Carsey and Shumin Qiu are maintainers for
> > > Ia32/X64 specifically.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Leif Lindholm 
> > > ---
> > >  Maintainers.txt | 9 -
> > >  1 file changed, 8 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt
> > > index 1e2e875..03979a1 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -186,7 +186,14 @@ SecurityPkg
> > >  W: https://github.com/tianocore/tianocore.github.io/wiki/SecurityPkg
> > >  M: Chao Zhang 
> > >
> > > -ShellPkg, ShellBinPkg
> > > +ShellBinPkg
> > > +W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg
> >
> >  [Jaben] The path above is wrong I think.  Should be ShellBinPkg.
> 
> No such page, and the ShellPkg one describes both of them.
> Does it make sense to have them separate?
> 
> Regards,

Never mind. I completely missed that that link was directed at the wiki.  

> 
> Leif
> 
> > If you change that,
> > Reviewed-by: Jaben Carsey 
> >
> > > +M: Jaben Carsey   (Ia32/X64)
> > > +M: Shumin Qiu   (Ia32/X64)
> > > +M: Leif Lindholm(ARM/AArch64)
> > > +M: Ard Biesheuvel  (ARM/AArch64)
> > > +
> > > +ShellPkg
> > >  W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg
> > >  M: Jaben Carsey 
> > >  M: Shumin Qiu 
> > > --
> > > 2.1.4
> >
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes

2016-02-09 Thread Carsey, Jaben
Thanks for the ---author info.  The email case is completely arbitrary to me... 
I honestly don't care (or maybe I should say I don't understand if I should 
care).

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ryan Harkin
> Sent: Tuesday, February 09, 2016 10:15 AM
> To: Carsey, Jaben 
> Cc: jim_dai...@dell.com; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes
> Importance: High
> 
> Hi Jaben,
> 
> On 8 February 2016 at 19:35, Carsey, Jaben 
> wrote:
> > I think that the changes look fine.
> >
> 
> Unfortunately, this patch crashes my board when Shell runs startup.nsh.
> 
> I have yet to track down what part of the patch is causing the
> problem, but I see this:
> 
> Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
> Shell> eh of??pa??8
> ASSERT [BootMonFs]
> /working/platforms/uefi/edk2/MdePkg/Library/BaseLib/String.c(1066):
> *Source < 0x100
> 
> 
> Or, on another board:
> 
> FS5:\> type startup.nsh
> echo -off
> echo Juno startup.nsh from NOR flash
> echo Example command to start the kernel:
> echo norkern dtb=board.dtb initrd=ramdisk.img console=ttyAMA0,115200n8
> root=/dev/sda2 rw rootwait earlyprintk=pl011,0x7ff8 debug
> user_debug=31 androidboot.hardware=juno loglevel=9
> sky2.mac_address=0xAA,0xBB,0xCC,0xDD,0xEE,0xFF
> 
> 
> FS5:\> startup.nsh
> FS5:\> eh of??pa??8
> ASSERT [BootMonFs]
> /working/platforms/uefi/edk2/MdePkg/Library/BaseLib/String.c(1066):
> *Source < 0x100
> 
> 
> 
> > Note that we have switched to GIT for our source control.  This would be
> must better as a series of 3 or 4 changes.  I had to manually edit all of the 
> 3
> diff files (modified ones attached) to get them to be merged in.  There was
> "too much path" as you did the file path from above the root of the revision
> controlled system.
> >
> 
> Jaben, the changes have been committed with you as the author.  I can
> see why that happened, saying as you committed them from diffs.
> 
> For future reference, when you do a git commit, you can specify
> "--author "First Last " and the author will be set
> accordingly.
> 
> It also looks like your GIT setup could do with a tweak also:  your
> name is in lower case now, where it was mixed case previously.  No big
> deal, but I'm guessing you don't want that.
> 
> 
> > There are additional changes required before this is committed. You need
> to update the INF files for the library and the shell itself and change the
> revision minor by +1.
> >
> 
> I see you made the +1 mod yourself before pushing out.
> 
> Cheers,
> Ryan.
> 
> 
> > -Jaben
> >
> >
> > From: jim_dai...@dell.com [mailto:jim_dai...@dell.com]
> > Sent: Monday, February 08, 2016 11:03 AM
> > To: Carsey, Jaben 
> > Cc: Qiu, Shumin 
> > Subject: RE: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes
> > Importance: High
> >
> > Strange. I didn't see them on the mailing list posting, but I assumed the 
> > list
> had stripped
> > them. They are attached to the message that is in my outbox.  I'll just 
> > blame
> Outlook and
> > say that for no particular reason, it decided to cause trouble. :)
> >
> > I have attached them here too.  Hopefully you'll get them this time.
> >
> > Regards,
> > Jim
> >
> > -Original Message-
> > From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> > Sent: Monday, February 08, 2016 12:50 PM
> > To: Dailey, Jim
> > Cc: Carsey, Jaben
> > Subject: RE: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes
> >
> > I don't see any attachments...
> >
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >> jim_dai...@dell.com<mailto:jim_dai...@dell.com>
> >> Sent: Monday, February 08, 2016 9:45 AM
> >> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> >> Cc: Carsey, Jaben ; Qiu, Shumin
> >>
> >> Subject: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes
> >> Importance: High
> >>
> >> ShellPkg: Fix ASCII and UNICODE file pipes.
> >>
> >> Fix various errors when piping a UNICODE or ASCII file to a simple
> >> shell application that reads standard input and writes it to standard 
> >> output.
> >>
> >> 1) When the memory file is created by CreateFileInferfaceMem() to
> >>

Re: [edk2] [PATCH] Maintainers.txt: Update maintainers for ShellBinPkg

2016-02-09 Thread Carsey, Jaben
Disregard my earlier comment.  I didn’t realize that was a link to the wiki at 
first.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Tuesday, February 09, 2016 11:46 AM
> To: Leif Lindholm 
> Cc: edk2-devel@lists.01.org; Carsey, Jaben ; Qiu,
> Shumin 
> Subject: Re: [PATCH] Maintainers.txt: Update maintainers for ShellBinPkg
> Importance: High
> 
> On 9 February 2016 at 18:18, Leif Lindholm 
> wrote:
> > Separate ShellPkg and ShellBinPkg into separate entities.
> > Add Leif Lindholm and Ard Biesheuvel as ShellBinPkg maintainers
> > for ARM/AArch64 only.
> > Add indicaton that Jaben Carsey and Shumin Qiu are maintainers for
> > Ia32/X64 specifically.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leif Lindholm 
> 
> Reviewed-by: Ard Biesheuvel 
> 
> > ---
> >  Maintainers.txt | 9 -
> >  1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > diff --git a/Maintainers.txt b/Maintainers.txt
> > index 1e2e875..03979a1 100644
> > --- a/Maintainers.txt
> > +++ b/Maintainers.txt
> > @@ -186,7 +186,14 @@ SecurityPkg
> >  W: https://github.com/tianocore/tianocore.github.io/wiki/SecurityPkg
> >  M: Chao Zhang 
> >
> > -ShellPkg, ShellBinPkg
> > +ShellBinPkg
> > +W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg
> > +M: Jaben Carsey   (Ia32/X64)
> > +M: Shumin Qiu   (Ia32/X64)
> > +M: Leif Lindholm(ARM/AArch64)
> > +M: Ard Biesheuvel  (ARM/AArch64)
> > +
> > +ShellPkg
> >  W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg
> >  M: Jaben Carsey 
> >  M: Shumin Qiu 
> > --
> > 2.1.4
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Maintainers.txt: Update maintainers for ShellBinPkg

2016-02-09 Thread Carsey, Jaben


> -Original Message-
> From: Leif Lindholm [mailto:leif.lindh...@linaro.org]
> Sent: Tuesday, February 09, 2016 9:19 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> ; Ard Biesheuvel 
> Subject: [PATCH] Maintainers.txt: Update maintainers for ShellBinPkg
> Importance: High
> 
> Separate ShellPkg and ShellBinPkg into separate entities.
> Add Leif Lindholm and Ard Biesheuvel as ShellBinPkg maintainers
> for ARM/AArch64 only.
> Add indicaton that Jaben Carsey and Shumin Qiu are maintainers for
> Ia32/X64 specifically.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm 
> ---
>  Maintainers.txt | 9 -
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index 1e2e875..03979a1 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -186,7 +186,14 @@ SecurityPkg
>  W: https://github.com/tianocore/tianocore.github.io/wiki/SecurityPkg
>  M: Chao Zhang 
> 
> -ShellPkg, ShellBinPkg
> +ShellBinPkg
> +W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg

 [Jaben] The path above is wrong I think.  Should be ShellBinPkg.

If you change that, 
Reviewed-by: Jaben Carsey 

> +M: Jaben Carsey   (Ia32/X64)
> +M: Shumin Qiu   (Ia32/X64)
> +M: Leif Lindholm(ARM/AArch64)
> +M: Ard Biesheuvel  (ARM/AArch64)
> +
> +ShellPkg
>  W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg
>  M: Jaben Carsey 
>  M: Shumin Qiu 
> --
> 2.1.4

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2016-02-09 Thread Carsey, Jaben
I would actually say mark Shumin and myself as "(Ia32/X64)" similar to marking 
you and Ard as ARM/AArch64.  I am not really involved in ARM binaries at all.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif
> Lindholm
> Sent: Tuesday, February 09, 2016 8:54 AM
> To: Carsey, Jaben 
> Cc: edk2-devel@lists.01.org; Laszlo Ersek ; Qiu, Shumin
> ; Ard Biesheuvel 
> Subject: Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.
> Importance: High
> 
> Thanks!
> 
> (Argh, forgot to add your reviewed-by before I pushed!)
> 
> So, could I do something like splitting ShellPkg/ShellBinPkg and then:
> 
> ShellBinPkg
> W: https://github.com/tianocore/tianocore.github.io/wiki/ShellPkg
> M: Jaben Carsey 
> M: Shumin Qiu 
> M: Leif Lindholm (ARM/AArch64)
> M: Ard Biesheuvel   (ARM/AArch64)
> 
> (but getting the alignment right when I have a fixed-width font)
> 
> /
> Leif
> 
> On 9 February 2016 at 16:42, Carsey, Jaben 
> wrote:
> > Reviewed-by: Jaben Carsey 
> >
> > And yes I agree that you both should be added as maintainers of the
> ShellBinPkg.
> >
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Leif
> >> Lindholm
> >> Sent: Tuesday, February 09, 2016 8:41 AM
> >> To: edk2-devel@lists.01.org
> >> Cc: Carsey, Jaben ; Qiu, Shumin
> >> ; Laszlo Ersek ; Ard
> Biesheuvel
> >> 
> >> Subject: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.
> >> Importance: High
> >>
> >> The binaries of ShellBinPkg are generated with ShellPkg from
> >> 9a8f6fb40712 ("ArmPlatformPkg: remove unused Sec library").
> >>
> >> This reintroduces the non-standard tftp commands that were
> >> unintentionally dropped with svn r18243.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.0
> >> Signed-off-by: Leif Lindholm 
> >> ---
> >>
> >> Binary diff not included in email, can be found at:
> >>
> https://git.linaro.org/people/leif.lindholm/edk2.git/shortlog/refs/heads/shellb
> >> inupdate
> >>
> >> As a side note - could we add myself and Ard as maintainers on
> >> ShellBinPkg, specifically for ARM/AArch64?
> >>
> >>  ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 382304 -> 392416
> bytes
> >>  ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 330336 -> 338592 bytes
> >>  ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 873664 -> 893696 bytes
> >>  ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 769088 -> 786592 bytes
> >>  4 files changed, 0 insertions(+), 0 deletions(-)
> >>
> >> diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> >> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> >> index 9faeaff..53724a6 100755
> >> Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and
> >> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ
> >> diff --git a/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> >> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> >> index 695f72a..251e0ca 100755
> >> Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and
> >> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ
> >> diff --git a/ShellBinPkg/UefiShell/AArch64/Shell.efi
> >> b/ShellBinPkg/UefiShell/AArch64/Shell.efi
> >> index 76b0a03..fdfd518 100755
> >> Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and
> >> b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ
> >> diff --git a/ShellBinPkg/UefiShell/Arm/Shell.efi
> >> b/ShellBinPkg/UefiShell/Arm/Shell.efi
> >> index 4d95e08..f7a8cca 100755
> >> Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and
> >> b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
> >> --
> >> 2.1.4
> >>
> >> ___
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2016-02-09 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

And yes I agree that you both should be added as maintainers of the ShellBinPkg.

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Leif
> Lindholm
> Sent: Tuesday, February 09, 2016 8:41 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> ; Laszlo Ersek ; Ard Biesheuvel
> 
> Subject: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.
> Importance: High
> 
> The binaries of ShellBinPkg are generated with ShellPkg from
> 9a8f6fb40712 ("ArmPlatformPkg: remove unused Sec library").
> 
> This reintroduces the non-standard tftp commands that were
> unintentionally dropped with svn r18243.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Leif Lindholm 
> ---
> 
> Binary diff not included in email, can be found at:
> https://git.linaro.org/people/leif.lindholm/edk2.git/shortlog/refs/heads/shellb
> inupdate
> 
> As a side note - could we add myself and Ard as maintainers on
> ShellBinPkg, specifically for ARM/AArch64?
> 
>  ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 382304 -> 392416 bytes
>  ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 330336 -> 338592 bytes
>  ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 873664 -> 893696 bytes
>  ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 769088 -> 786592 bytes
>  4 files changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> index 9faeaff..53724a6 100755
> Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and
> b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ
> diff --git a/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> index 695f72a..251e0ca 100755
> Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and
> b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ
> diff --git a/ShellBinPkg/UefiShell/AArch64/Shell.efi
> b/ShellBinPkg/UefiShell/AArch64/Shell.efi
> index 76b0a03..fdfd518 100755
> Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and
> b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ
> diff --git a/ShellBinPkg/UefiShell/Arm/Shell.efi
> b/ShellBinPkg/UefiShell/Arm/Shell.efi
> index 4d95e08..f7a8cca 100755
> Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and
> b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
> --
> 2.1.4
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Update Shell Library INF file version

2016-02-08 Thread Carsey, Jaben
Committed and done.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim_dai...@dell.com
> Sent: Monday, February 08, 2016 1:53 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: [edk2] [PATCH] Update Shell Library INF file version
> Importance: High
> 
> ShellPkg: Update Shell Library version in INF since a newly documented
> return value was added to one of the functions.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey 
> ---
> 
> diff --git a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> --- a/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> +++ b/ShellPkg/Library/UefiShellLib/UefiShellLib.inf
> @@ -18,7 +18,7 @@
>BASE_NAME  = UefiShellLib
>FILE_GUID  = 449D0F00-2148-4a43-9836-F10B3980ECF5
>MODULE_TYPE= UEFI_DRIVER
> -  VERSION_STRING = 1.0
> +  VERSION_STRING = 1.1
>LIBRARY_CLASS  = ShellLib|UEFI_APPLICATION UEFI_DRIVER
> DXE_RUNTIME_DRIVER DXE_DRIVER
>CONSTRUCTOR= ShellLibConstructor
>DESTRUCTOR = ShellLibDestructor
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes

2016-02-08 Thread Carsey, Jaben
I think that the changes look fine.

Note that we have switched to GIT for our source control.  This would be must 
better as a series of 3 or 4 changes.  I had to manually edit all of the 3 diff 
files (modified ones attached) to get them to be merged in.  There was "too 
much path" as you did the file path from above the root of the revision 
controlled system.

There are additional changes required before this is committed. You need to 
update the INF files for the library and the shell itself and change the 
revision minor by +1.

-Jaben


From: jim_dai...@dell.com [mailto:jim_dai...@dell.com]
Sent: Monday, February 08, 2016 11:03 AM
To: Carsey, Jaben 
Cc: Qiu, Shumin 
Subject: RE: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes
Importance: High

Strange. I didn't see them on the mailing list posting, but I assumed the list 
had stripped
them. They are attached to the message that is in my outbox.  I'll just blame 
Outlook and
say that for no particular reason, it decided to cause trouble. :)

I have attached them here too.  Hopefully you'll get them this time.

Regards,
Jim

-Original Message-
From: Carsey, Jaben [mailto:jaben.car...@intel.com]
Sent: Monday, February 08, 2016 12:50 PM
To: Dailey, Jim
Cc: Carsey, Jaben
Subject: RE: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes

I don't see any attachments...

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim_dai...@dell.com<mailto:jim_dai...@dell.com>
> Sent: Monday, February 08, 2016 9:45 AM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Cc: Carsey, Jaben ; Qiu, Shumin
>
> Subject: [edk2] [PATCH] ShellPkg Fix ASCII and UNICODE file pipes
> Importance: High
>
> ShellPkg: Fix ASCII and UNICODE file pipes.
>
> Fix various errors when piping a UNICODE or ASCII file to a simple
> shell application that reads standard input and writes it to standard output.
>
> 1) When the memory file is created by CreateFileInferfaceMem() to
> capture the pipe output, no UNICODE BOM is written to the memory file.
> Later, when the memory file is read by the application using
> ShellFileHandleReadLine(), the function indicates that the file is ASCII 
> because there is no BOM.
>
> 2) If the file is piped as ASCII, the ASCII memory image is not
> correctly created by FileInterfaceMemWrite() as each ASCII character
> is followed by '\0' in the image (when the ASCII data is written to
> the memory image, the file position should only be incremented by half the 
> buffer size).
>
> 3) ShellFileHandleReadLine() does not read ASCII files correctly
> (writes to Buffer need to be cast as CHAR8*).
>
> 4) FileInterfaceMemRead() and FileInterfaceMemWrite() as somewhat hard
> to read and difficult to debug with certain tools due to the typecasting of 
> This.
> Added a local variable (MemFile) of the correct type to these
> functions and used it instead of This.
>
> Enhancement: ShellFileHandleReadLine() now returns EFI_END_OF_FILE
> when appropriate.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey
>
> (diff files attached)
>
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg/UefiDpLib: Refine the code of locating all handles in DpTrace.c.

2016-02-08 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Cinnamon Shia
> Sent: Monday, February 08, 2016 9:39 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] ShellPkg/UefiDpLib: Refine the code of locating all
> handles in DpTrace.c.
> Importance: High
> 
> Replace gBS->LocateHandle with gBS->LocateHandleBuffer
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cinnamon Shia 
> ---
>  ShellPkg/Library/UefiDpLib/DpTrace.c | 40 
> 
>  1 file changed, 9 insertions(+), 31 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiDpLib/DpTrace.c
> b/ShellPkg/Library/UefiDpLib/DpTrace.c
> index d17d514..22b83d0 100644
> --- a/ShellPkg/Library/UefiDpLib/DpTrace.c
> +++ b/ShellPkg/Library/UefiDpLib/DpTrace.c
> @@ -2,7 +2,7 @@
>Trace reporting for the Dp utility.
> 
>Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
> -  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> +  (C) Copyright 2015-2016 Hewlett Packard Enterprise Development LP
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -153,8 +153,7 @@ DumpAllTrace(
>UINTN TIndex;
> 
>EFI_HANDLE*HandleBuffer;
> -  UINTN Size;
> -  EFI_HANDLETempHandle;
> +  UINTN HandleCount;
>EFI_STATUSStatus;
>EFI_STRINGStringPtrUnknown;
> 
> @@ -166,17 +165,7 @@ DumpAllTrace(
> 
>// Get Handle information
>//
> -  Size = 0;
> -  HandleBuffer = &TempHandle;
> -  Status  = gBS->LocateHandle (AllHandles, NULL, NULL, &Size, &TempHandle);
> -  if (Status == EFI_BUFFER_TOO_SMALL) {
> -HandleBuffer = AllocatePool (Size);
> -ASSERT (HandleBuffer != NULL);
> -if (HandleBuffer == NULL) {
> -  return;
> -}
> -Status  = gBS->LocateHandle (AllHandles, NULL, NULL, &Size,
> HandleBuffer);
> -  }
> +  Status  = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, &HandleCount,
> &HandleBuffer);
>if (EFI_ERROR (Status)) {
>  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_HANDLES_ERROR),
> gDpHiiHandle, Status);
>}
> @@ -232,7 +221,7 @@ DumpAllTrace(
>AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
>if (Measurement.Handle != NULL) {
>  // See if the Handle is in the HandleBuffer
> -for (TIndex = 0; TIndex < (Size / sizeof(HandleBuffer[0])); 
> TIndex++) {
> +for (TIndex = 0; TIndex < HandleCount; TIndex++) {
>if (Measurement.Handle == HandleBuffer[TIndex]) {
>  DpGetNameFromHandle (HandleBuffer[TIndex]);
>  break;
> @@ -270,7 +259,7 @@ DumpAllTrace(
>}
>  }
>}
> -  if (HandleBuffer != &TempHandle) {
> +  if (HandleBuffer != NULL) {
>  FreePool (HandleBuffer);
>}
>SHELL_FREE_NON_NULL (IncFlag);
> @@ -536,8 +525,7 @@ ProcessHandles(
>UINTN Index;
>UINTN LogEntryKey;
>UINTN Count;
> -  UINTN Size;
> -  EFI_HANDLETempHandle;
> +  UINTN HandleCount;
>EFI_STATUSStatus;
>EFI_STRINGStringPtrUnknown;
> 
> @@ -548,17 +536,7 @@ ProcessHandles(
>FreePool (StringPtr);
>FreePool (StringPtrUnknown);
> 
> -  Size = 0;
> -  HandleBuffer = &TempHandle;
> -  Status  = gBS->LocateHandle (AllHandles, NULL, NULL, &Size, &TempHandle);
> -  if (Status == EFI_BUFFER_TOO_SMALL) {
> -HandleBuffer = AllocatePool (Size);
> -ASSERT (HandleBuffer != NULL);
> -if (HandleBuffer == NULL) {
> -  return Status;
> -}
> -Status  = gBS->LocateHandle (AllHandles, NULL, NULL, &Size,
> HandleBuffer);
> -  }
> +  Status = gBS->LocateHandleBuffer (AllHandles, NULL, NULL, &HandleCount,
> &HandleBuffer);
>if (EFI_ERROR (Status)) {
>  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_DP_HANDLES_ERROR),
> gDpHiiHandle, Status);
>}
> @@ -598,7 +576,7 @@ ProcessHandles(
>mGaugeString[0] = 0;// Empty driver name by default
>AsciiStrToUnicodeStr (Measurement.Token, mUnicodeToken);
>// See if the Handle is in the HandleBuffer
> -  for (Index = 0; Index < (Size / sizeof(HandleBuffer[0])); Index++

Re: [edk2] manually booting efi file

2016-02-05 Thread Carsey, Jaben
Since you asked here is a little more info:

The file's EFI_FILE_PROTOCOL is insufficient information to find it as it just 
contains the path in file system for the file.  That's the equivalent to saying 
"I want to open file directory/foo.txt".  you need to give more context for 
success.

To load into memory, it needs a EFI_DEVICE_PATH_PROTOCOL, this is a path to the 
device the file resides on, followed by the path in the file system for the 
file.  In the UEFI Shell there is a "drive name" that is something like "fs0" 
which the shell decodes to get the first portion of the 
EFI_DEVICE_PATH_PROTOCOL for your file.  You can look in ShellProtocol.c for 2 
functions involved: EfiShellGetDevicePathFromFilePath, and 
EfiShellGetFilePathFromDevicePath (one for each direction of conversion).

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Andrew Fish
> Sent: Friday, February 05, 2016 6:56 AM
> To: Michael Zimmermann 
> Cc: edk2-devel@lists.01.org ; Laszlo Ersek
> 
> Subject: Re: [edk2] manually booting efi file
> 
> 
> > On Feb 5, 2016, at 6:44 AM, Michael Zimmermann
>  wrote:
> >
> > Lazlo,
> >
> > using 'FileDevicePath' works perfectly, thx :)
> > sth. else I stumbled on is this typedef:
> > typedef EFI_DEVICE_PATH_PROTOCOL  EFI_DEVICE_PATH;
> >
> > I tried to find a way to convert from EFI_DEVICE_PATH_PROTOCOL to
> > EFI_DEVICE_PATH until I saw that it's just an alias :P
> >
> 
> Also EFI boots from removable media via spec defined file names.
> So if you search for BOOTX64.EFI you find:
>  #define EFI_REMOVABLE_MEDIA_FILE_NAME_X64
> L"\\EFI\\BOOT\\BOOTX64.EFI"
> That leads you to:
> #define EFI_REMOVABLE_MEDIA_FILE_NAME
> EFI_REMOVABLE_MEDIA_FILE_NAME_X64
> And that will point you to the BDS code that loads files from removable media:
> 
> ~/work/src/edk2(master)>git grep EFI_REMOVABLE_MEDIA_FILE_NAME -- *.c
> IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c:2081:
> FullDevicePath = FileDevicePath (Handle,
> EFI_REMOVABLE_MEDIA_FILE_NAME);
> IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c:2376:
> FilePath = FileDevicePath (Handle, EFI_REMOVABLE_MEDIA_FILE_NAME);
> IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c:3336:
> EFI_REMOVABLE_MEDIA_FILE_NAME,
> IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c:3720:
> EFI_REMOVABLE_MEDIA_FILE_NAME,
> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c:1398:  by appending
> EFI_REMOVABLE_MEDIA_FILE_NAME.
> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c:1434:
> TempDevicePath = FileDevicePath (Handle,
> EFI_REMOVABLE_MEDIA_FILE_NAME);
> MdeModulePkg/Library/UefiBootManagerLib/BmBoot.c:1496:
> TempDevicePath = FileDevicePath (SimpleFileSystemHandles[Index],
> EFI_REMOVABLE_MEDIA_FILE_NAME);
> MdeModulePkg/Universal/BdsDxe/BdsEntry.c:724:  FilePath = FileDevicePath
> (NULL, EFI_REMOVABLE_MEDIA_FILE_NAME);
> Vlv2TbltDevicePkg/Library/PlatformBdsLib/BdsPlatform.c:1308:
> EFI_REMOVABLE_MEDIA_FILE_NAME,
> Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsL
> ib/BdsBoot.c:2083:FullDevicePath = FileDevicePath (Handle,
> EFI_REMOVABLE_MEDIA_FILE_NAME);
> Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsL
> ib/BdsBoot.c:2387:FilePath = FileDevicePath (Handle,
> EFI_REMOVABLE_MEDIA_FILE_NAME);
> Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsL
> ib/BdsBoot.c:3351:   EFI_REMOVABLE_MEDIA_FILE_NAME,
> Vlv2TbltDevicePkg/Override/IntelFrameworkModulePkg/Library/GenericBdsL
> ib/BdsBoot.c:3837: EFI_REMOVABLE_MEDIA_FILE_NAME,
> 
> Thanks,
> 
> Andrew Fish
> 
> 
> > Thanks for everyone's help :)
> >
> > Michael
> >
> > On Fri, Feb 5, 2016 at 3:01 PM, Laszlo Ersek  wrote:
> >
> >> On 02/05/16 14:26, Michael Zimmermann wrote:
> >>> The problem is that there is no GUID for 'EFI_FILE_PROTOCOL' there's
> >>> only 'EFI_SIMPLE_FILE_SYSTEM_PROTOCOL' which I already have.
> >>
> >> Ah, sorry, I completely forgot about this. I've only ever worked with
> >> EFI_SIMPLE_FILE_SYSTEM_PROTOCOL and EFI_FILE_PROTOCOL once, in git
> >> commit 23d04b58e27b.
> >>
> >>> I don't even understand the concept of a devicepath attached to a file
> >>> since a file is not a device.
> >>
> >> Okay, so I'm fuzzy on this, but the LoadImage() specification explains
> >> it more or less. The idea is (/me hand-waving) that all but the last
> >> device path nodes are used to locate the simple file s

Re: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM Platform DSC / FDF / ArmPlatformLib template"

2016-02-04 Thread Carsey, Jaben
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Thursday, February 04, 2016 12:23 PM
> To: Ryan Harkin 
> Cc: Ard Biesheuvel ; Justen, Jordan L
> ; edk2-de...@ml01.01.org; Leif Lindholm
> ; linaro-u...@lists.linaro.org; Carsey, Jaben
> 
> Subject: Re: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM
> Platform DSC / FDF / ArmPlatformLib template"
> Importance: High
> 
> On 02/04/16 12:53, Ryan Harkin wrote:
> > On 3 February 2016 at 17:38, Leif Lindholm 
> wrote:
> >> On Wed, Feb 03, 2016 at 05:29:58PM +, Carsey, Jaben wrote:
> >>>> -Original Message-
> >>>> From: Ryan Harkin [mailto:ryan.har...@linaro.org]
> >>>> Sent: Wednesday, February 03, 2016 9:25 AM
> >>>> To: Carsey, Jaben 
> >>>> Cc: edk2-de...@ml01.01.org; linaro-u...@lists.linaro.org; Leif Lindholm
> >>>> ; Justen, Jordan L
> ; Ard
> >>>> Biesheuvel 
> >>>> Subject: Re: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an
> ARM
> >>>> Platform DSC / FDF / ArmPlatformLib template"
> >>>> Importance: High
> >>>>
> >>>> On 3 February 2016 at 17:20, Carsey, Jaben 
> >>>> wrote:
> >>>>> Change looks good.
> >>>>>
> >>>>> Question - Is there a way to optimize the patch/email for this type of
> change
> >>>> so that we do not see the "diff" for a file that is deleted?  It seems
> redundant
> >>>> to show a whole file of "-" lines...
> >>>>>
> >>>>
> >>>> That's a good question.  I remember Ard discussing this previously.
> >>>> I'll see if I can find the discussion...
> >>>
> >>> Thanks!  That would be good.
> >>>
> >
> > I can't find Ard's original message.  But I've worked out that if I do
> >
> >   $ git format-patch -D -1 
> >
> > It will not show all the deleted lines.  I could then "git send-email"
> > the patch file, rather than the using the SHA.
> >
> > However, the patch will not be able to be applied because it's missing
> > the delete of the contents.  So it's only useful for review,
> > unfortunately.  I vaguely remember Ard mentioning that in his original
> > email - that I can't find!
> 
> I don't think that -D is a good idea. The patch should be applicable
> from the mailing list for testing & local review.
> 
> I do use a number of tweaks that procude more readable patches:
> 
> (1) I enable rename and copy detection. See "diff.renames" in git-config(1).
> 
> (2) When appropriate, I even force copy detection for patches where the
> original files (being copied from) are not touched in the same patch.
> See "--find-copies-harder" in git-diff(1).
> 
> (3) Earlier we discussed how section headers of dec, dsc, inf etc. files
> can be captured in diff hunk header. Most recently: please see the end
> of the message at
> 
> http://thread.gmane.org/gmane.comp.bios.edk2.devel/7156/focus=7183
> 
> (4) I use the "patience" diff algorithm. See "diff.algorithm" in
> git-config(1), and git-diff(1). A good explanation can be found in the
> QEMU wiki, under
> 
>   Make code motion patches easy to review
> 
> http://wiki.qemu.org/Contribute/SubmitAPatch#Make_code_motion_patches
> _easy_to_review
> 
> (5) I order the files in my diffs so that the descriptive files go first
> (dec, dsc, fdf, inf), the C language header files, and HII forms,
> second, and the C source code last. In my experience, seeing the header
> changes before the C code changes makes a huge difference.
> 
> For this, create a text file like:
> 
> --
> *.dec
> *.dsc.inc
> *.dsc
> *.fdf
> *.inf
> *.h
> *.vfr
> *.c
> --
> 
> and pass the pathname of this text file to git-format-patch with the
> "-O" option (no space between option and option argument).
> 
> (6) Occasionally I increase the context from 3 lines to 5 or so (with
> "-U5").
> 
> 
> None of these solve the exact request formulated by Jaben, but they all
> keep the patch applicable from the mailing list.
> 

You're right that these don't fix the issue that I brought up.  My impression 
is that there is no direct solution so far.

But these are all excellent ideas and methods to improve the usability of the 
repo.  I think that as much of Laszlo's idea

Re: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM Platform DSC / FDF / ArmPlatformLib template"

2016-02-03 Thread Carsey, Jaben


> -Original Message-
> From: Ryan Harkin [mailto:ryan.har...@linaro.org]
> Sent: Wednesday, February 03, 2016 9:25 AM
> To: Carsey, Jaben 
> Cc: edk2-de...@ml01.01.org; linaro-u...@lists.linaro.org; Leif Lindholm
> ; Justen, Jordan L ; Ard
> Biesheuvel 
> Subject: Re: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM
> Platform DSC / FDF / ArmPlatformLib template"
> Importance: High
> 
> On 3 February 2016 at 17:20, Carsey, Jaben 
> wrote:
> > Change looks good.
> >
> > Question - Is there a way to optimize the patch/email for this type of 
> > change
> so that we do not see the "diff" for a file that is deleted?  It seems 
> redundant
> to show a whole file of "-" lines...
> >
> 
> That's a good question.  I remember Ard discussing this previously.
> I'll see if I can find the discussion...

Thanks!  That would be good.  

The worst example is the patch with a delete and then some code change 
(probably should be a series).

-Jaben

> 
> 
> > -Jaben
> >
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >> Ryan Harkin
> >> Sent: Wednesday, February 03, 2016 9:10 AM
> >> To: edk2-de...@ml01.01.org; linaro-u...@lists.linaro.org; Leif Lindholm
> >> 
> >> Cc: Ryan Harkin ; Ard Biesheuvel
> >> 
> >> Subject: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM
> >> Platform DSC / FDF / ArmPlatformLib template"
> >> Importance: High
> >>
> >> This reverts commit 12fcdcb83d8e91cb730db9252189269467b9ed73
> >>
> >> The files added by the commit have never been used.  In the intervening
> >> years since they've been added, ~30 patches have been submitted to
> >> update them.
> >>
> >> Remove them as part of a general cleanup of ArmPlatformPkg.
> >>
> >> Signed-off-by: Ryan Harkin 
> >> ---
> >>  ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc | 382 
> >> --
> >>  ArmPlatformPkg/ArmPlatformPkg-2ndstage.fdf | 263 
> >>  ArmPlatformPkg/ArmPlatformPkg.dsc  | 445 
> >> -
> >>  ArmPlatformPkg/ArmPlatformPkg.fdf  | 320 ---
> >>  .../ArmPlatformLibNull/ArmPlatformLibNull.c| 162 
> >>  .../ArmPlatformLibNull/ArmPlatformLibNull.inf  |  51 ---
> >>  .../ArmPlatformLibNull/ArmPlatformLibNullMem.c |  34 --
> >>  .../ArmPlatformLibNull/ArmPlatformLibNullSec.inf   |  47 ---
> >>  8 files changed, 1704 deletions(-)
> >>
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM Platform DSC / FDF / ArmPlatformLib template"

2016-02-03 Thread Carsey, Jaben
Change looks good.

Question - Is there a way to optimize the patch/email for this type of change 
so that we do not see the "diff" for a file that is deleted?  It seems 
redundant to show a whole file of "-" lines...

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ryan Harkin
> Sent: Wednesday, February 03, 2016 9:10 AM
> To: edk2-de...@ml01.01.org; linaro-u...@lists.linaro.org; Leif Lindholm
> 
> Cc: Ryan Harkin ; Ard Biesheuvel
> 
> Subject: [edk2] [PATCH v2 6/6] Revert "ArmPlatformPkg: Create an ARM
> Platform DSC / FDF / ArmPlatformLib template"
> Importance: High
> 
> This reverts commit 12fcdcb83d8e91cb730db9252189269467b9ed73
> 
> The files added by the commit have never been used.  In the intervening
> years since they've been added, ~30 patches have been submitted to
> update them.
> 
> Remove them as part of a general cleanup of ArmPlatformPkg.
> 
> Signed-off-by: Ryan Harkin 
> ---
>  ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc | 382 --
>  ArmPlatformPkg/ArmPlatformPkg-2ndstage.fdf | 263 
>  ArmPlatformPkg/ArmPlatformPkg.dsc  | 445 
> -
>  ArmPlatformPkg/ArmPlatformPkg.fdf  | 320 ---
>  .../ArmPlatformLibNull/ArmPlatformLibNull.c| 162 
>  .../ArmPlatformLibNull/ArmPlatformLibNull.inf  |  51 ---
>  .../ArmPlatformLibNull/ArmPlatformLibNullMem.c |  34 --
>  .../ArmPlatformLibNull/ArmPlatformLibNullSec.inf   |  47 ---
>  8 files changed, 1704 deletions(-)
> 
> diff --git a/ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc
> b/ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc
> deleted file mode 100644
> index 45d7427..000
> --- a/ArmPlatformPkg/ArmPlatformPkg-2ndstage.dsc
> +++ /dev/null
> @@ -1,382 +0,0 @@
> -#
> -#  Copyright (c) 2011-2015, ARM Limited. All rights reserved.
> -#
> -#  This program and the accompanying materials
> -#  are licensed and made available under the terms and conditions of the BSD
> License
> -#  which accompanies this distribution.  The full text of the license may be
> found at
> -#  http://opensource.org/licenses/bsd-license.php
> -#
> -#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> BASIS,
> -#  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> EXPRESS OR IMPLIED.
> -#
> -#
> -
> 
> 
> -#
> -# Defines Section - statements that will be processed to create a Makefile.
> -#
> -
> 
> 
> -[Defines]
> -  PLATFORM_NAME  = ArmPlatform
> -  PLATFORM_GUID  = 4fe82b83-9315-4ff3-8cc0-ab77ca93cb7f
> -  PLATFORM_VERSION   = 0.1
> -  DSC_SPECIFICATION  = 0x00010005
> -  OUTPUT_DIRECTORY   = Build/$(PLATFORM_NAME)
> -  SUPPORTED_ARCHITECTURES= ARM|AARCH64
> -  BUILD_TARGETS  = DEBUG|RELEASE
> -  SKUID_IDENTIFIER   = DEFAULT
> -  FLASH_DEFINITION   = ArmPlatformPkg/ArmPlatformPkg-2ndstage.fdf
> -
> -[LibraryClasses.common]
> -
> ArmPlatformLib|ArmPlatformPkg/Library/ArmPlatformLibNull/ArmPlatformLi
> bNull.inf
> -
> -!if $(TARGET) == RELEASE
> -  DebugLib|MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf
> -
> UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocation
> Lib/UncachedMemoryAllocationLib.inf
> -!else
> -
> DebugLib|MdePkg/Library/BaseDebugLibSerialPort/BaseDebugLibSerialPort.i
> nf
> -
> UncachedMemoryAllocationLib|ArmPkg/Library/UncachedMemoryAllocation
> Lib/UncachedMemoryAllocationLib.inf
> -#
> UncachedMemoryAllocationLib|ArmPkg/Library/DebugUncachedMemoryAll
> ocationLib/DebugUncachedMemoryAllocationLib.inf
> -!endif
> -
> DebugPrintErrorLevelLib|MdePkg/Library/BaseDebugPrintErrorLevelLib/Base
> DebugPrintErrorLevelLib.inf
> -
> -  BaseLib|MdePkg/Library/BaseLib/BaseLib.inf
> -
> SynchronizationLib|MdePkg/Library/BaseSynchronizationLib/BaseSynchroniz
> ationLib.inf
> -
> PerformanceLib|MdePkg/Library/BasePerformanceLibNull/BasePerformance
> LibNull.inf
> -  PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
> -
> PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePe
> CoffGetEntryPointLib.inf
> -  PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
> -  IoLib|MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
> -
> UefiDecompressLib|MdePkg/Library/BaseUefiDecompressLib/BaseUefiDeco
> mpressLib.inf
> -  CpuLib|MdePkg/Library/BaseCpuLib/BaseCpu

Re: [edk2] [PATCH] Maintainers.txt: Update source repository urls

2016-02-02 Thread Carsey, Jaben
I like that a lot.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Justen, Jordan L
> Sent: Tuesday, February 02, 2016 9:35 AM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: RE: [edk2] [PATCH] Maintainers.txt: Update source repository urls
> Importance: High
> 
> On 2016-02-02 09:07:24, Carsey, Jaben wrote:
> > Looks like good info. Should we clarify that SVN is read only also?
> >
> 
> Good point. Also, maybe 'mirror' would be better than 'backup'?
> 
> T: git (mirror) - https://bitbucket.org/tianocore/edk2.git
> T: git (mirror) - http://git.code.sf.net/p/tianocore/edk2
> T: svn (read-only, deprecated) -
> https://svn.code.sf.net/p/edk2/code/trunk/edk2
> 
> -Jordan
> 
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > > Jordan Justen
> > > Sent: Tuesday, February 02, 2016 9:03 AM
> > > To: edk2-devel@lists.01.org
> > > Cc: Justen, Jordan L 
> > > Subject: [edk2] [PATCH] Maintainers.txt: Update source repository urls
> > >
> > > Add 'backup' to backup git repositories, and mark svn as 'deprecated'.
> > >
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Jordan Justen 
> > > ---
> > >
> > >  Note: This should be the first patch that we push to git first,
> > >  rather than svn.
> > >
> > >  Maintainers.txt | 6 +++---
> > >  1 file changed, 3 insertions(+), 3 deletions(-)
> > >
> > > diff --git a/Maintainers.txt b/Maintainers.txt
> > > index c0102f4..335a7af 100644
> > > --- a/Maintainers.txt
> > > +++ b/Maintainers.txt
> > > @@ -30,9 +30,9 @@ EDK II
> > >  W: http://www.tianocore.org/edk2/
> > >  L: https://lists.sourceforge.net/lists/listinfo/edk2-devel
> > >  T: git - https://github.com/tianocore/edk2.git
> > > -T: git - https://bitbucket.org/tianocore/edk2.git
> > > -T: git - http://git.code.sf.net/p/tianocore/edk2
> > > -T: svn - https://svn.code.sf.net/p/edk2/code/trunk/edk2
> > > +T: git (backup) - https://bitbucket.org/tianocore/edk2.git
> > > +T: git (backup) - http://git.code.sf.net/p/tianocore/edk2
> > > +T: svn (deprecated) - https://svn.code.sf.net/p/edk2/code/trunk/edk2
> > >
> > >  Responsible Disclosure, Reporting Security Issues
> > >  -
> > > --
> > > 2.6.2
> > >
> > > ___
> > > edk2-devel mailing list
> > > edk2-devel@lists.01.org
> > > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] Maintainers.txt: Update source repository urls

2016-02-02 Thread Carsey, Jaben
Looks like good info. Should we clarify that SVN is read only also?

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jordan Justen
> Sent: Tuesday, February 02, 2016 9:03 AM
> To: edk2-devel@lists.01.org
> Cc: Justen, Jordan L 
> Subject: [edk2] [PATCH] Maintainers.txt: Update source repository urls
> 
> Add 'backup' to backup git repositories, and mark svn as 'deprecated'.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jordan Justen 
> ---
> 
>  Note: This should be the first patch that we push to git first,
>  rather than svn.
> 
>  Maintainers.txt | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Maintainers.txt b/Maintainers.txt
> index c0102f4..335a7af 100644
> --- a/Maintainers.txt
> +++ b/Maintainers.txt
> @@ -30,9 +30,9 @@ EDK II
>  W: http://www.tianocore.org/edk2/
>  L: https://lists.sourceforge.net/lists/listinfo/edk2-devel
>  T: git - https://github.com/tianocore/edk2.git
> -T: git - https://bitbucket.org/tianocore/edk2.git
> -T: git - http://git.code.sf.net/p/tianocore/edk2
> -T: svn - https://svn.code.sf.net/p/edk2/code/trunk/edk2
> +T: git (backup) - https://bitbucket.org/tianocore/edk2.git
> +T: git (backup) - http://git.code.sf.net/p/tianocore/edk2
> +T: svn (deprecated) - https://svn.code.sf.net/p/edk2/code/trunk/edk2
> 
>  Responsible Disclosure, Reporting Security Issues
>  -
> --
> 2.6.2
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Refine the code to avoid use a constant number as offset.

2016-01-25 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Monday, January 25, 2016 12:01 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> 
> Subject: [PATCH] ShellPkg: Refine the code to avoid use a constant number as
> offset.
> Importance: High
> 
> Refine the code to use 'sizeof(EFI_LOAD_OPTION)' as offset in buffer to get
> 'description' instead of using a constant number.
> This change makes the code more readable.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 2
> +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> index 6a078d8..b407608 100644
> --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> +++
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> @@ -,7 +,7 @@ BcfgDisplayDump(
>  }
> 
>  LoadOption  = (EFI_LOAD_OPTION *)Buffer;
> -Description = (CHAR16 *)(&LoadOption->FilePathListLength + 1);
> +Description = (CHAR16*)(Buffer + sizeof (EFI_LOAD_OPTION));
>  DescriptionSize = StrSize (Description);
> 
>  if (LoadOption->FilePathListLength != 0) {
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 00/14] ShellPkg: BCFG dump improvements

2016-01-21 Thread Carsey, Jaben
For series. Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, January 21, 2016 9:07 AM
> To: edk2-devel-01 
> Cc: Carsey, Jaben ; Ryan Harkin
> 
> Subject: [PATCH v2 00/14] ShellPkg: BCFG dump improvements
> Importance: High
> 
> Version 2 of <http://thread.gmane.org/gmane.comp.bios.edk2.devel/6759>.
> 
> Changes relative to v1:
> 
> - Bump the minor version numbers in the INF files of
>   UefiShellBcfgCommandLib, UefiShellCommandLib,
>   UefiShellDebug1CommandsLib [Jaben].
> 
>   For the first of these, a final patch has been added.
> 
>   For the last two, because they are affected together by a single code
>   movement patch, that patch has been extended with the INF changes.
> 
> - Replace "UefiShellBcfgCommandLib" with "BcfgDisplayDump()" in most of
>   the subject lines, so that it's clear a given patch affects only the
>   "bcfg dump" subcommand, not the entirety of "bcfg" [Laszlo]
> 
> - The above are also marked on each patch, as notes.
> 
> - No functional changes.
> 
> Public branch:
> <https://github.com/lersek/edk2/commits/bcfg_improvements_v2>.
> 
> Cc: Jaben Carsey 
> Cc: Ryan Harkin 
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (14):
>   ShellPkg: BcfgDisplayDump(): update whitespace & layout
>   ShellPkg: UefiShellBcfgCommandLib: drop unused string tokens
>   ShellPkg: BcfgDisplayDump(): hoist NULL-init of DevPath[String]
>   ShellPkg: BcfgDisplayDump(): accumulate errors
>   ShellPkg: BcfgDisplayDump(): enforce minimum size for Boot and co.
>   ShellPkg: BcfgDisplayDump(): address FilePathListLength by name
>   ShellPkg: BcfgDisplayDump(): call Description[Size] by name
>   ShellPkg: BcfgDisplayDump(): eliminate FilePathList duplication
>   ShellPkg: BcfgDisplayDump(): calculate OptionalDataOffset explicitly
>   ShellPkg: BcfgDisplayDump(): fix reporting of OptionalData
>   ShellPkg: BcfgDisplayDump(): fix ShellPrintEx() call site
>   ShellPkg: elevate DumpHex() from Debug1-internal to generic-internal
>   ShellPkg: BcfgDisplayDump(): print optional data with DumpHex()
>   ShellPkg: UefiShellBcfgCommandLib: bump VERSION_STRING
> 
>  ShellPkg/Include/Library/ShellCommandLib.h | 
>  16 +++
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> | 103 
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
> |   2 +-
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> |   4 +-
>  ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c |
> 69 +
>  ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf   | 
>   2
> +-
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi
> b.c   |  70 -
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi
> b.h   |  16 ---
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLi
> b.inf |   2 +-
>  9 files changed, 150 insertions(+), 134 deletions(-)
> 
> --
> 1.8.3.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 01/14] ShellPkg: BcfgDisplayDump(): update whitespace & layout

2016-01-21 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, January 21, 2016 9:07 AM
> To: edk2-devel-01 
> Cc: Carsey, Jaben ; Ryan Harkin
> 
> Subject: [PATCH v2 01/14] ShellPkg: BcfgDisplayDump(): update whitespace &
> layout
> Importance: High
> 
> This patch incurs no functional changes, it just modifies some whitespace,
> so we can separate these non-functional changes from the functional
> changes in the next patches.
> 
> Cc: Jaben Carsey 
> Cc: Ryan Harkin 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Laszlo Ersek 
> ---
> 
> Notes:
> v2:
> - clarify in the subject that the patch affects only the "bcfg dump"
>   subcommand, not all of "bcfg"
> 
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 20
> ++--
>  1 file changed, 10 insertions(+), 10 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> index 142504a..f6f4ab3 100644
> --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> +++
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> @@ -1043,14 +1043,14 @@ BcfgDisplayDump(
>IN CONST BOOLEAN  VerboseOutput
>)
>  {
> -  EFI_STATUS  Status;
> -  UINT8   *Buffer;
> -  UINTN   BufferSize;
> -  CHAR16  VariableName[12];
> -  UINTN   LoopVar;
> -  UINTN   LoopVar2;
> -  CHAR16  *DevPathString;
> -  VOID*DevPath;
> +  EFI_STATUS  Status;
> +  UINT8   *Buffer;
> +  UINTN   BufferSize;
> +  CHAR16  VariableName[12];
> +  UINTN   LoopVar;
> +  UINTN   LoopVar2;
> +  CHAR16  *DevPathString;
> +  VOID*DevPath;
> 
>if (OrderCount == 0) {
>  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN(STR_BCFG_NONE),
> gShellBcfgHiiHandle, L"bcfg");
> @@ -1058,8 +1058,8 @@ BcfgDisplayDump(
>}
> 
>for (LoopVar = 0 ; LoopVar < OrderCount ; LoopVar++) {
> -Buffer  = NULL;
> -BufferSize  = 0;
> +Buffer= NULL;
> +BufferSize= 0;
>  UnicodeSPrint(VariableName, sizeof(VariableName), L"%s%04x", Op,
> CurrentOrder[LoopVar]);
> 
>  Status = gRT->GetVariable(
> --
> 1.8.3.1
> 

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] [ShellPkg] fix operator

2016-01-21 Thread Carsey, Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Thursday, January 21, 2016 8:13 AM
> To: Carsey, Jaben ; Ryan Harkin
> 
> Cc: edk2-devel@lists.01.org 
> Subject: Re: [edk2] [PATCH] [ShellPkg] fix operator
> Importance: High
> 
> On 01/21/16 16:50, Carsey, Jaben wrote:
> >
> >
> >> -Original Message-
> >> From: Ryan Harkin [mailto:ryan.har...@linaro.org]
> >> Sent: Thursday, January 21, 2016 12:47 AM
> >> To: Laszlo Ersek 
> >> Cc: Carsey, Jaben ; edk2-devel@lists.01.org
>  >> de...@ml01.01.org>
> >> Subject: Re: [PATCH] [ShellPkg] fix operator
> >> Importance: High
> >>
> >> On 21 January 2016 at 01:01, Laszlo Ersek  wrote:
> >>> On 01/20/16 23:18, Ryan Harkin wrote:
> >>>>
> >>>> On 20 Jan 2016 21:23, "Carsey, Jaben"  >>>> <mailto:jaben.car...@intel.com>> wrote:
> >>>>>
> >>>>> I will wait.
> >>>>>
> >>>>> -Jaben
> >>>>>
> >>>>>> -Original Message-
> >>>>>> From: Laszlo Ersek [mailto:ler...@redhat.com
> >> <mailto:ler...@redhat.com>]
> >>>>>> Sent: Wednesday, January 20, 2016 1:21 PM
> >>>>>> To: Carsey, Jaben  >>>> <mailto:jaben.car...@intel.com>>; edk2-de...@ml01.01.org
> >>>> <mailto:edk2-de...@ml01.01.org>
> >>>>>> Cc: ryan.har...@linaro.org <mailto:ryan.har...@linaro.org>
> >>>>>> Subject: Re: [PATCH] [ShellPkg] fix operator
> >>>>>> Importance: High
> >>>>>>
> >>>>>> On 01/20/16 22:09, jaben carsey wrote:
> >>>>>>> Contributed-under: TianoCore Contribution Agreement 1.0
> >>>>>>> Signed-off-by: jaben carsey  >>>> <mailto:jaben.car...@intel.com>>
> >>>>>>> ---
> >>>>>>>
> >>>> ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> |
> >> 4
> >>>>>> ++--
> >>>>>>>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>>>>>>
> >>>>>>> diff --git
> >>>>>>
> >> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>>>>>
> >> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>>>>>> index 142504a..77e2374 100644
> >>>>>>> ---
> >>>>>>
> >> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>>>>>> +++
> >>>>>>
> >> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>>>>>> @@ -2,7 +2,7 @@
> >>>>>>>Main file for BCFG command.
> >>>>>>>
> >>>>>>>(C) Copyright 2014-2015 Hewlett-Packard Development Company,
> >>>>>> L.P.
> >>>>>>> -  Copyright (c) 2010 - 2015, Intel Corporation. All rights
> >>>> reserved.
> >>>>>>> +  Copyright (c) 2010 - 2016, Intel Corporation. All rights
> >>>> reserved.
> >>>>>>>This program and the accompanying materials
> >>>>>>>are licensed and made available under the terms and conditions
> >>>> of the
> >>>>>> BSD License
> >>>>>>>which accompanies this distribution.  The full text of the
> >>>> license may be
> >>>>>> found at
> >>>>>>> @@ -1105,7 +1105,7 @@ BcfgDisplayDump(
> >>>>>>>VariableName,
> >>>>>>>(CHAR16*)(Buffer+6),
> >>>>>>>DevPathString,
> >>>>>>> -  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <=
> >>>>>> BufferSize?L'N':L'Y');
> >>>>>>> +  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) >=
> >>>>>> BufferSize?L'N':L'Y');
> >>>>>>>  if (VerboseOutput) {
> >>>>>>>for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) +
> >>>> *(UINT16*)(Buffer+4)
> >>>>>> + 6);LoopVar2 >>>>>>>   

Re: [edk2] [PATCH] [ShellPkg] fix operator

2016-01-21 Thread Carsey, Jaben


> -Original Message-
> From: Ryan Harkin [mailto:ryan.har...@linaro.org]
> Sent: Thursday, January 21, 2016 12:47 AM
> To: Laszlo Ersek 
> Cc: Carsey, Jaben ; edk2-devel@lists.01.org  de...@ml01.01.org>
> Subject: Re: [PATCH] [ShellPkg] fix operator
> Importance: High
> 
> On 21 January 2016 at 01:01, Laszlo Ersek  wrote:
> > On 01/20/16 23:18, Ryan Harkin wrote:
> >>
> >> On 20 Jan 2016 21:23, "Carsey, Jaben"  >> <mailto:jaben.car...@intel.com>> wrote:
> >>>
> >>> I will wait.
> >>>
> >>> -Jaben
> >>>
> >>> > -Original Message-
> >>> > From: Laszlo Ersek [mailto:ler...@redhat.com
> <mailto:ler...@redhat.com>]
> >>> > Sent: Wednesday, January 20, 2016 1:21 PM
> >>> > To: Carsey, Jaben  >> <mailto:jaben.car...@intel.com>>; edk2-de...@ml01.01.org
> >> <mailto:edk2-de...@ml01.01.org>
> >>> > Cc: ryan.har...@linaro.org <mailto:ryan.har...@linaro.org>
> >>> > Subject: Re: [PATCH] [ShellPkg] fix operator
> >>> > Importance: High
> >>> >
> >>> > On 01/20/16 22:09, jaben carsey wrote:
> >>> > > Contributed-under: TianoCore Contribution Agreement 1.0
> >>> > > Signed-off-by: jaben carsey  >> <mailto:jaben.car...@intel.com>>
> >>> > > ---
> >>> > >
> >> ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c |
> 4
> >>> > ++--
> >>> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> >>> > >
> >>> > > diff --git
> >>> >
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>> >
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>> > > index 142504a..77e2374 100644
> >>> > > ---
> >>> >
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>> > > +++
> >>> >
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> >>> > > @@ -2,7 +2,7 @@
> >>> > >Main file for BCFG command.
> >>> > >
> >>> > >(C) Copyright 2014-2015 Hewlett-Packard Development Company,
> >>> > L.P.
> >>> > > -  Copyright (c) 2010 - 2015, Intel Corporation. All rights
> >> reserved.
> >>> > > +  Copyright (c) 2010 - 2016, Intel Corporation. All rights
> >> reserved.
> >>> > >This program and the accompanying materials
> >>> > >are licensed and made available under the terms and conditions
> >> of the
> >>> > BSD License
> >>> > >which accompanies this distribution.  The full text of the
> >> license may be
> >>> > found at
> >>> > > @@ -1105,7 +1105,7 @@ BcfgDisplayDump(
> >>> > >VariableName,
> >>> > >    (CHAR16*)(Buffer+6),
> >>> > >DevPathString,
> >>> > > -  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <=
> >>> > BufferSize?L'N':L'Y');
> >>> > > +  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) >=
> >>> > BufferSize?L'N':L'Y');
> >>> > >  if (VerboseOutput) {
> >>> > >for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) +
> >> *(UINT16*)(Buffer+4)
> >>> > + 6);LoopVar2 >>> > >  ShellPrintEx(
> >>> > >
> >>> >
> >>> > This patch is good, but I'd like to send a bit more comprehensive
> >>> > cleanup soon, if you are okay with that.
> >>> >
> >>
> >> Indeed, so far we've only discussed the bug when dumping the optional
> >> data, although it looks like Laszlo has worked that out pretty well.
> >>
> >> But we haven't discussed the problems I'm having with setting the
> >> optional data with the same command.  I'll look tomorrow.
> >
> > As Jaben indicated meanwhile, beside the genuine issues with the BCFG
> > implementation (patch series coming up soon), your command line was
> > incorrect. According to the UEFI Shell specification, the -opt flag
> > takes the following form:
> >
> >> [-opt # [[filename]|[”data”]]
> >
> > That is, the first argument 

Re: [edk2] [PATCH 00/13] ShellPkg: BCFG dump improvements

2016-01-20 Thread Carsey, Jaben
All 3 modified libraries need their version information modified.  I think that 
the minor version of all 3 libraries debug, BCFG, and ShellCommandLib need to 
be incremented.

Otherwise I think this looks good.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo
> Ersek
> Sent: Wednesday, January 20, 2016 5:12 PM
> To: edk2-de...@ml01.01.org
> Cc: Carsey, Jaben ; Ryan Harkin
> 
> Subject: [edk2] [PATCH 00/13] ShellPkg: BCFG dump improvements
> Importance: High
> 
> This series cleans up the "bcfg dump" command, fixes two bugs in it, and
> improves the hexdump of the optional data.
> 
> Public branch:
> <https://github.com/lersek/edk2/commits/bcfg_improvements>.
> 
> Don't be alarmed by the seemingly large number of patches, I advanced in
> microscopic steps.
> 
> Cc: Jaben Carsey 
> Cc: Ryan Harkin 
> 
> Thanks
> Laszlo
> 
> Laszlo Ersek (13):
>   ShellPkg: UefiShellBcfgCommandLib: update whitespace & layout
>   ShellPkg: UefiShellBcfgCommandLib: drop unused string tokens
>   ShellPkg: UefiShellBcfgCommandLib: hoist NULL-init of DevPath[String]
>   ShellPkg: UefiShellBcfgCommandLib: accumulate errors
>   ShellPkg: UefiShellBcfgCommandLib: enforce minimum size for Boot
> and co.
>   ShellPkg: UefiShellBcfgCommandLib: address FilePathListLength by name
>   ShellPkg: UefiShellBcfgCommandLib: call Description[Size] by name
>   ShellPkg: UefiShellBcfgCommandLib: eliminate FilePathList duplication
>   ShellPkg: UefiShellBcfgCommandLib: calculate OptionalDataOffset
> explicitly
>   ShellPkg: UefiShellBcfgCommandLib: fix reporting of OptionalData
>   ShellPkg: UefiShellBcfgCommandLib: fix ShellPrintEx() call site
>   ShellPkg: elevate DumpHex() from Debug1-internal to generic-internal
>   ShellPkg: UefiShellBcfgCommandLib: print optional data with DumpHex()
> 
>  ShellPkg/Include/Library/ShellCommandLib.h   |  
> 16 +++
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.
> h |  16 ---
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c   |
> 103 
>  ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.c   |  
> 69
> +
> 
> ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.
> c |  70 -
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni |
> 4 +-
>  6 files changed, 147 insertions(+), 131 deletions(-)
> 
> --
> 1.8.3.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] [ShellPkg] fix operator

2016-01-20 Thread Carsey, Jaben
Note that when you specify your 1 2 3 it’s interpreted as a keystroke code.  If 
you want a string you should use “1 2 3”…

From: Ryan Harkin [mailto:ryan.har...@linaro.org]
Sent: Wednesday, January 20, 2016 2:18 PM
To: Carsey, Jaben 
Cc: edk2-devel@lists.01.org ; Laszlo Ersek 

Subject: RE: [PATCH] [ShellPkg] fix operator
Importance: High


On 20 Jan 2016 21:23, "Carsey, Jaben" 
mailto:jaben.car...@intel.com>> wrote:
>
> I will wait.
>
> -Jaben
>
> > -Original Message-
> > From: Laszlo Ersek [mailto:ler...@redhat.com<mailto:ler...@redhat.com>]
> > Sent: Wednesday, January 20, 2016 1:21 PM
> > To: Carsey, Jaben mailto:jaben.car...@intel.com>>; 
> > edk2-de...@ml01.01.org<mailto:edk2-de...@ml01.01.org>
> > Cc: ryan.har...@linaro.org<mailto:ryan.har...@linaro.org>
> > Subject: Re: [PATCH] [ShellPkg] fix operator
> > Importance: High
> >
> > On 01/20/16 22:09, jaben carsey wrote:
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: jaben carsey 
> > > mailto:jaben.car...@intel.com>>
> > > ---
> > >  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 4
> > ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git
> > a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > > index 142504a..77e2374 100644
> > > ---
> > a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > > +++
> > b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > > @@ -2,7 +2,7 @@
> > >Main file for BCFG command.
> > >
> > >(C) Copyright 2014-2015 Hewlett-Packard Development Company,
> > L.P.
> > > -  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
> > > +  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> > >This program and the accompanying materials
> > >are licensed and made available under the terms and conditions of the
> > BSD License
> > >which accompanies this distribution.  The full text of the license may 
> > > be
> > found at
> > > @@ -1105,7 +1105,7 @@ BcfgDisplayDump(
> > >VariableName,
> > >(CHAR16*)(Buffer+6),
> > >DevPathString,
> > > -  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <=
> > BufferSize?L'N':L'Y');
> > > +  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) >=
> > BufferSize?L'N':L'Y');
> > >  if (VerboseOutput) {
> > >for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) + 
> > > *(UINT16*)(Buffer+4)
> > + 6);LoopVar2 > >  ShellPrintEx(
> > >
> >
> > This patch is good, but I'd like to send a bit more comprehensive
> > cleanup soon, if you are okay with that.
> >

Indeed, so far we've only discussed the bug when dumping the optional data, 
although it looks like Laszlo has worked that out pretty well.

But we haven't discussed the problems I'm having with setting the optional data 
with the same command.  I'll look tomorrow.

Thanks for the great work so far, chaps!

> > Thanks!
> > Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Shell BCFG command - adding option data

2016-01-20 Thread Carsey, Jaben
Laszlo,

I was thinking that we could add something like this up front in the file and 
then we could remove lots of the pointer math from the main code part to make 
the logical part of the code easier to understand.

#define BCFG_VAR_BUFFER_ATTS (x) (((EFI_LOAD_OPTION)(x))->Attributes)
#define BCFG_VAR_BUFFER_LEN  (x) (((EFI_LOAD_OPTION)(x))->FilePathListLength)
#define BCFG_VAR_BUFFER_DESC (x) 
((CHAR16*)(((UINT8)(x))+sizeof(UINT32)+sizeof(UINT16))
#define BCFG_VAR_BUFFER_DPATH(x) 
(((UINT8)(x))+sizeof(UINT32)+sizeof(UINT16)+StrSize(BCFG_VAR_BUFFER_DESC(x)))
#define BCFG_VAR_BUFFER_OPT  (x) 
(BCFG_VAR_BUFFER_DPATH(x)+BCFG_VAR_BUFFER_LEN(x))

-Jaben

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, January 20, 2016 1:26 PM
> To: Ryan Harkin ; Carsey, Jaben
> 
> Cc: edk2-devel@lists.01.org ; Linaro UEFI
> Mailman List 
> Subject: Re: [edk2] Shell BCFG command - adding option data
> Importance: High
> 
> On 01/20/16 21:20, Ryan Harkin wrote:
> > On 20 January 2016 at 19:52, Carsey, Jaben 
> wrote:
> >> Short help to long answer to long question.
> >>
> >> First you must enable verbose (use -v) output to see the optional data.
> >
> > I already tried using -v but I've never seen the optional data
> 
> Indeed.
> 
> That's a separate bug, in the following call:
> 
> ShellPrintEx(
>   -1,
>   -1,
>   NULL,
>   L"%02x",
>   Buffer[LoopVar2]);
> 
> This function call has a copy & paste error. It must have been copied
> from the function call just above, still visible here:
> 
> >> Second - I agree something is wrong with that N saying there isn't any.
> >>
> >> The question is why that math thinks that there is no more data in the
> buffer.
> >>
> >> The output you're looking for is this one:
> >> ShellPrintHiiEx(
> >>   -1,
> >>   -1,
> >>   NULL,
> >>   STRING_TOKEN(STR_BCFG_LOAD_OPTIONS),
> >>   gShellBcfgHiiHandle,
> >>   LoopVar,
> >>   VariableName,
> >>   (CHAR16*)(Buffer+6),
> >>   DevPathString,
> >>   (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <=
> BufferSize?L'N':L'Y');
> 
> The ShellPrintHiiEx() function has the following prototype:
> 
> EFI_STATUS
> EFIAPI
> ShellPrintHiiEx(
>   IN INT32Col OPTIONAL,
>   IN INT32Row OPTIONAL,
>   IN CONST CHAR8  *Language OPTIONAL,
>   IN CONST EFI_STRING_ID  HiiFormatStringId,
>   IN CONST EFI_HANDLE HiiFormatHandle,
>   ...
>   );
> 
> but the ShellPrintEx() function not only drops "HiiFormatStringId" and
> "HiiFormatHandle", it *also* drops the "Language" parameter:
> 
> EFI_STATUS
> EFIAPI
> ShellPrintEx(
>   IN INT32Col OPTIONAL,
>   IN INT32Row OPTIONAL,
>   IN CONST CHAR16 *Format,
>   ...
>   )
> 
> Therefore, the NULL parameter must be removed from the call, like this:
> 
> ShellPrintEx(
>   -1,
>   -1,
>   L"%02x",
>   Buffer[LoopVar2]);
>   }
> 
> Otherwise NULL gets passed as Format, and the string intended as format
> string, and the arguments for that intended format string, are both
> ignored by ShellPrintEx().
> 
> Thanks
> Laszlo
> 
> >>
> >
> > Thanks for confirming.
> >
> >
> >>
> >> -Jaben
> >>
> >>
> >>> -Original Message-
> >>> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >>> Laszlo Ersek
> >>> Sent: Wednesday, January 20, 2016 11:48 AM
> >>> To: Ryan Harkin ; edk2-devel@lists.01.org
>  >>> de...@ml01.01.org>
> >>> Cc: Linaro UEFI Mailman List 
> >>> Subject: Re: [edk2] Shell BCFG command - adding option data
> >>> Importance: High
> >>>
> >>> Long answer to long question ahead :)
> >>>
> >>> On 01/20/16 19:54, Ryan Harkin wrote:
> >>>> Hello all,
> >>>>
> >>>> I'm using Shell.efi, a magic binary that is included in my aarch64 FVP
> binary.
> >>>
> >>> Not a magic binary, except if your platform DSC relies on the prebuilt
> >>> binary that is (for some unfathomable reason) checked into the source
> tree.
> >>>
> >>> OvmfPkg and ArmVirtPkg both build the UEFI shell from source. Ple

Re: [edk2] [PATCH] [ShellPkg] fix operator

2016-01-20 Thread Carsey, Jaben
I will wait.

-Jaben

> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Wednesday, January 20, 2016 1:21 PM
> To: Carsey, Jaben ; edk2-de...@ml01.01.org
> Cc: ryan.har...@linaro.org
> Subject: Re: [PATCH] [ShellPkg] fix operator
> Importance: High
> 
> On 01/20/16 22:09, jaben carsey wrote:
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: jaben carsey 
> > ---
> >  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 4
> ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > index 142504a..77e2374 100644
> > ---
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > +++
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> > @@ -2,7 +2,7 @@
> >Main file for BCFG command.
> >
> >(C) Copyright 2014-2015 Hewlett-Packard Development Company,
> L.P.
> > -  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
> > +  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
> >This program and the accompanying materials
> >are licensed and made available under the terms and conditions of the
> BSD License
> >which accompanies this distribution.  The full text of the license may be
> found at
> > @@ -1105,7 +1105,7 @@ BcfgDisplayDump(
> >VariableName,
> >(CHAR16*)(Buffer+6),
> >DevPathString,
> > -  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <=
> BufferSize?L'N':L'Y');
> > +  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) >=
> BufferSize?L'N':L'Y');
> >  if (VerboseOutput) {
> >for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4)
> + 6);LoopVar2 >  ShellPrintEx(
> >
> 
> This patch is good, but I'd like to send a bit more comprehensive
> cleanup soon, if you are okay with that.
> 
> Thanks!
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


[edk2] [PATCH] [ShellPkg] fix operator

2016-01-20 Thread jaben carsey
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: jaben carsey 
---
 ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c 
b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
index 142504a..77e2374 100644
--- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
+++ b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
@@ -2,7 +2,7 @@
   Main file for BCFG command.
 
   (C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
-  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
+  Copyright (c) 2010 - 2016, Intel Corporation. All rights reserved.
   This program and the accompanying materials
   are licensed and made available under the terms and conditions of the BSD 
License
   which accompanies this distribution.  The full text of the license may be 
found at
@@ -1105,7 +1105,7 @@ BcfgDisplayDump(
   VariableName,
   (CHAR16*)(Buffer+6),
   DevPathString,
-  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <= 
BufferSize?L'N':L'Y');
+  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) >= 
BufferSize?L'N':L'Y');
 if (VerboseOutput) {
   for (LoopVar2 = (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 
6);LoopVar2https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Shell BCFG command - adding option data

2016-01-20 Thread Carsey, Jaben
Short help to long answer to long question.

First you must enable verbose (use -v) output to see the optional data.
Second - I agree something is wrong with that N saying there isn't any.

The question is why that math thinks that there is no more data in the buffer.

The output you're looking for is this one:
ShellPrintHiiEx(
  -1,
  -1,
  NULL,
  STRING_TOKEN(STR_BCFG_LOAD_OPTIONS),
  gShellBcfgHiiHandle,
  LoopVar,
  VariableName,
  (CHAR16*)(Buffer+6),
  DevPathString,
  (StrSize((CHAR16*)(Buffer+6)) + *(UINT16*)(Buffer+4) + 6) <= 
BufferSize?L'N':L'Y');


-Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Wednesday, January 20, 2016 11:48 AM
> To: Ryan Harkin ; edk2-devel@lists.01.org  de...@ml01.01.org>
> Cc: Linaro UEFI Mailman List 
> Subject: Re: [edk2] Shell BCFG command - adding option data
> Importance: High
> 
> Long answer to long question ahead :)
> 
> On 01/20/16 19:54, Ryan Harkin wrote:
> > Hello all,
> >
> > I'm using Shell.efi, a magic binary that is included in my aarch64 FVP 
> > binary.
> 
> Not a magic binary, except if your platform DSC relies on the prebuilt
> binary that is (for some unfathomable reason) checked into the source tree.
> 
> OvmfPkg and ArmVirtPkg both build the UEFI shell from source. Please
> grep their respective DSC files for "Shell.inf".
> 
> This is exactly so that we can immediately see changes to the shell.
> (Plus it isn't really open source if you just embed the shell binary,
> despite the shell source residing in the exact same tree.)
> 
> Around those parts you will find the pathname that leads to the shell's
> source.
> 
> > I'm trying to manipulate boot options using the BCFG command.  And
> > I've failed to work out how to set optional data.
> >
> > Before I clone ShellPkg and trawl through the code, I thought I'd post
> > here and see if someone can tell me what's going wrong.
> >
> > First step, I created a boot option to run Shell.efi using the Intel
> > BDS menu system.  Thanks to Lazlo fixing cursor key support ;-)
> 
> You're welcome, but only if next time you'll spell my name right! ;)
> 
> It's L-a-s-z-l-o, and apparently it is the bane of native English
> speakers. Sorry about that. (In reality, it's László, but let's not go
> there. :)) You are not the first and not the last to misspell it, so I'm
> not even annoyed; just mildly amused. :)
> 
> > I
> > added some simple optional data, "1 2 3 4".
> >
> > Next, I deleted all the other boot entries that were created by
> > default, leaving only my new boot option.
> >
> > I created the option again, without optional data, giving it the
> > description "" instead of "Shell.efi" (they're the same
> > length) and here's what I see:
> >
> > Then I started the first new Shell.efi option.  It gives an error that
> > is hardly unexpected:
> >
> > '2' is not recognized as an internal or external command, operable
> > program, or script file.
> >
> > So I ask bcfg to list my boot options and it says:
> >
> > Shell> bcfg boot dump
> > Option: 00. Variable: Boot0006
> >   Desc- Shell.efi
> >   DevPath - Fv(87940482-FC81-41C3-87E6-399CF85AC8A0)/\Shell.efi
> >   Optional- N
> > Option: 01. Variable: Boot
> >   Desc- x
> >   DevPath - Fv(87940482-FC81-41C3-87E6-399CF85AC8A0)/\Shell.efi
> >   Optional- N
> >
> > It claims there is no optional data.
> 
> Yup, that's a bug.
> 
> In such cases we usually hunt down the format string, and go from there.
> Therefore one would grep for "Optional-".
> 
> Now, until a few months ago, this would have been made more tricky by
> the fact such format strings were stored in separate .UNI files
> (resource strings, practically, to be used together with HII). Because,
> those were encoded in UCS-2, hence for grepping them you needed a handy
> little script like
> 
> #!/bin/bash
> set -u -C
> 
> for F in $(git ls-files '*.uni'); do
>   iconv -f UTF-16LE -t UTF-8 -- "$F" \
>   | grep -H --label="$F" --color=auto "$@"
> done
> 
> But, Jordan recently converted all (or most?) such UNI files to UTF-8,
> which helps us non-Windows-users keep our sanity, and helps git post
> plaintext (non-binary) patches for UNI files.
> 
> Now, the "Optional-" string can be found in the file
> 
&g

Re: [edk2] [PATCH] CryptoPkg: Fix function qsort for non 32-bit machines

2016-01-19 Thread Carsey, Jaben
Shouldn't we also update the MdeModulePkg header and implementation where that 
is copied from if we are changing the way it works?  

Sidenote: why does CryptoPkg carry a separate quick sort implementation?  Is it 
worth just using the MdeModulePkg BaseSortLib?  That library used to be in 
ShellPkg so that may have been the reason...

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Burigo, Arthur Crippa
> Sent: Tuesday, January 19, 2016 10:11 AM
> To: Long, Qin ; Laszlo Ersek ;
> edk2-de...@ml01.01.org
> Subject: Re: [edk2] [PATCH] CryptoPkg: Fix function qsort for non 32-bit
> machines
> 
> Hello!
> 
> Unless it is guaranteed an "int" will always have exactly 32-bits, using 
> "INT32"
> instead of "int" does not guarantee the algorithm will work for machines
> where an "int" is not a 32-bit integer.
> 
> Thanks for your attention!
> 
> Kind regards,
> Arthur.
> 
> -Original Message-
> From: Long, Qin [mailto:qin.l...@intel.com]
> Sent: terça-feira, 19 de janeiro de 2016 15:38
> To: Laszlo Ersek; Burigo, Arthur Crippa; edk2-de...@ml01.01.org
> Subject: RE: [edk2] [PATCH] CryptoPkg: Fix function qsort for non 32-bit
> machines
> 
> Thanks for the detailed analysis. The fix makes sense to me.
> And yes, I also prefer to use INT32 as Laszlo's comment (since we don't
> consider ILP64 data model), to keep the consistent style in this function
> declaration.
> 
> 
> Best Regards & Thanks,
> LONG, Qin
> 
> > -Original Message-
> > From: Laszlo Ersek [mailto:ler...@redhat.com]
> > Sent: Wednesday, January 20, 2016 1:10 AM
> > To: Burigo, Arthur Crippa; edk2-de...@ml01.01.org
> > Cc: Long, Qin
> > Subject: Re: [edk2] [PATCH] CryptoPkg: Fix function qsort for non
> > 32-bit machines
> >
> > On 01/19/16 16:13, Burigo, Arthur Crippa wrote:
> > > Although the function qsort receives as an argument a "compare"
> > > function which returns an "int", QuickSortWorker (the function used
> > > internally by qsort to do its job) receives as an argument a
> > > "CompareFunction" which returns an "INTN". In a 32-bit machine,
> > > "INTN" is defined as "INT32", which is defined as "int" and
> > > everything works well. However, when qsort is compiled for a 64-bit
> > > machine, "INTN" is defined as "INT64" and the return values of the
> > > compare functions become incompatible ("int" for qsort and "INT64" for
> QuickSortWorker), causing malfunction.
> > >
> > > For example, let's assume qsort is being compiled for a 64-bit machine.
> > > As stated before, the "compare" function will be returning an "int",
> > > and "CompareFunction" will be returning an "INT64". When, for
> > > example, the "compare" function (which was passed as an argument to
> > > qsort and, then, re-passed as an argument to QuickSortWorker)
> > > returns -1 (or 0x, in a 32-bit integer, its original return
> > > type) from inside a call to QuickSortWorker, its return value is 
> > > interpreted
> as being an "INT64"
> > > value - which turns out to be 4294967295 (or 0x, in
> > > a 64-bit integer) -, making the function QuickSortWorker to behave
> > > unexpectedly.
> > >
> > > Note that this unexpected (or incorrect) conversion does not happen
> > > when casting an "INT32" to an "INT64" directly, but does happen when
> > > casting function types.
> > >
> > > The issue is fixed by changing the return type of SORT_COMPARE (the
> > > type of "CompareFunction", used by QuickSortWorker) from "INTN" to
> "int".
> > > This way, both qsort and QuickSortWorker use compatible definitions
> > > for their compare functions.
> > >
> > > Cc: Qin Long 
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Acked-by: Paulo Alcantara Cavalcanti 
> > > Signed-off-by: Karyne Mayer 
> > > Signed-off-by: Rodrigo Dias Correa 
> > > Signed-off-by: Arthur Crippa Burigo 
> > > ---
> > >  CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
> > > b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
> > > index fb446b6..f2c8987 100644
> > > --- a/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
> > > +++ b/CryptoPkg/Library/BaseCryptLib/SysCall/CrtWrapper.c
> > > @@ -22,7 +22,7 @@ FILE  *stdin  = NULL;  FILE  *stdout = NULL;
> > >
> > >  typedef
> > > -INTN
> > > +int
> > >  (*SORT_COMPARE)(
> > >IN  VOID  *Buffer1,
> > >IN  VOID  *Buffer2
> > >
> >
> > INT32 is more idiomatic for edk2, I think.
> >
> > Thanks
> > Laszlo
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 2/2] ShellPkg UefiDpLib: Use Image->FilePath to get name for SMM drivers

2016-01-19 Thread Carsey, Jaben
for the series.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zeng, Star
> Sent: Sunday, January 17, 2016 10:02 PM
> To: edk2-devel@lists.01.org
> Cc: Gao, Liming ; Carsey, Jaben
> ; Qiu, Shumin 
> Subject: [PATCH 2/2] ShellPkg UefiDpLib: Use Image->FilePath to get name for
> SMM drivers
> Importance: High
> 
> This enhancement is to use the FilePath field in the loaded image
> protocol to find the name of an image as a fallback for when the
> loaded image device path protocol is not installed on the image handle.
> This is necessary because the SMM core does not install the loaded
> image device path protocol, so DP was displaying "Unknown Driver Name"
> for every SMM driver.
> 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> Cc: Shumin Qiu 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Star Zeng 
> ---
>  ShellPkg/Library/UefiDpLib/DpUtilities.c | 14 +++---
>  1 file changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c
> b/ShellPkg/Library/UefiDpLib/DpUtilities.c
> index e9d8fb3..032e7b4 100644
> --- a/ShellPkg/Library/UefiDpLib/DpUtilities.c
> +++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c
> @@ -1,7 +1,7 @@
>  /** @file
>Utility functions used by the Dp application.
> 
> -  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
>(C) Copyright 2015 Hewlett Packard Enterprise Development LP
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
> @@ -206,6 +206,10 @@ DpGetNameFromHandle (
>CHAR8   *PlatformLanguage;
>EFI_COMPONENT_NAME2_PROTOCOL  *ComponentName2;
> 
> +  Image = NULL;
> +  LoadedImageDevicePath = NULL;
> +  DevicePath = NULL;
> +
>//
>// Method 1: Get the name string from image PDB
>//
> @@ -275,9 +279,13 @@ DpGetNameFromHandle (
>);
>if (!EFI_ERROR (Status) && (LoadedImageDevicePath != NULL)) {
>  DevicePath = LoadedImageDevicePath;
> +  } else if (Image != NULL) {
> +DevicePath = Image->FilePath;
> +  }
> 
> +  if (DevicePath != NULL) {
>  //
> -// Try to get image GUID from LoadedImageDevicePath protocol
> +// Try to get image GUID from image DevicePath
>  //
>  NameGuid = NULL;
>  while (!IsDevicePathEndType (DevicePath)) {
> @@ -320,7 +328,7 @@ DpGetNameFromHandle (
>//
>// Method 5: Get the name string from image DevicePath
>//
> -  NameString = ConvertDevicePathToText (LoadedImageDevicePath, TRUE,
> FALSE);
> +  NameString = ConvertDevicePathToText (DevicePath, TRUE, FALSE);
>if (NameString != NULL) {
>  StrnCpyS (mGaugeString, DP_GAUGE_STRING_LENGTH + 1, NameString,
> DP_GAUGE_STRING_LENGTH);
>  mGaugeString[DP_GAUGE_STRING_LENGTH] = 0;
> --
> 2.7.0.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] MdeModulePkg/SerialDxe: fix porting error from EmbeddedPkg

2016-01-15 Thread Carsey, Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Laszlo Ersek
> Sent: Friday, January 15, 2016 9:22 AM
> To: Ryan Harkin ; Ard Biesheuvel
> 
> Cc: edk2-de...@ml01.01.org; Zeng, Star ; Leif
> Lindholm 
> Subject: Re: [edk2] [PATCH] MdeModulePkg/SerialDxe: fix porting error from
> EmbeddedPkg
> 
> On 01/15/16 17:07, Ryan Harkin wrote:
> > On 15 January 2016 at 15:42, Ard Biesheuvel 
> wrote:
> >> SerialDxe was migrated to MdeModulePkg from EmbeddedPkg, and all
> >> users of the latter were moved to the former. However, the new
> >> version is not quite identical to the original, in ways that break
> >> ARM platforms that use the PL011 driver.
> >>
> >
> > The original patch should never have passed review.
> 
> I agree it's unfortunate that the patch silently changed behavior in the
> course of the conversion. Stuff like that is very hard to catch in
> review; in my analysis that I posted a few minutes ago, I actually tried
> to diff the two drivers against each other, and gave up. I had to review
> both files in separate windows at the same time.
> 
> Ard is right -- extreme discipline is required when converting things.
> If the programmer notices a bug or non-conformance in the course of the
> conversion, he should make a note somewhere, for later, but the
> conversion *must* preserve the original bugs! Bugfixing is a separate
> step. It can occur after conversion, as a separate patch. It can even
> occur *before* the conversion (and then the corrected code will be
> converted.)
> 
Agree.

Isn't there a SVN->Move operation (and a GIT version) that should have been 
used and would inherently have maintained any and all behaviors?  Then if there 
are name changes required for PCDs or the like they can be changed after the 
move in the patch series?

We researched better move methods than "add then delete" after the move of 
libraries from ShellPkg to MdeModulePkg. Another major benefit was continuity 
of file history...

-Jaben

> >
> >
> >> In SerialReset(), the serial port is reset to its default values,
> >> but the defaults used by the new version for ReceiveFifoDepth and
> >> Timeout deviate from the original values. So put them back.
> >>
> >> Contributed-under: TianoCore Contribution Agreement 1.0
> >> Signed-off-by: Ard Biesheuvel 
> > Tested-by: Ryan Harkin 
> 
> Can you please test my proposal as well?
> 
> Thanks
> Laszlo
> 
> 
> >
> >> ---
> >>  MdeModulePkg/Universal/SerialDxe/SerialIo.c | 4 ++--
> >>  1 file changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/MdeModulePkg/Universal/SerialDxe/SerialIo.c
> b/MdeModulePkg/Universal/SerialDxe/SerialIo.c
> >> index de928d1719e9..9e9db28ce5cc 100644
> >> --- a/MdeModulePkg/Universal/SerialDxe/SerialIo.c
> >> +++ b/MdeModulePkg/Universal/SerialDxe/SerialIo.c
> >> @@ -233,8 +233,8 @@ SerialReset (
> >>//
> >>// Set the Serial I/O mode
> >>//
> >> -  This->Mode->ReceiveFifoDepth  = 1;
> >> -  This->Mode->Timeout   = 0;
> >> +  This->Mode->ReceiveFifoDepth  = 0;
> >> +  This->Mode->Timeout   = 100;
> >>This->Mode->BaudRate  = PcdGet64 (PcdUartDefaultBaudRate);
> >>This->Mode->DataBits  = (UINT32) PcdGet8 
> >> (PcdUartDefaultDataBits);
> >>This->Mode->Parity= (UINT32) PcdGet8 (PcdUartDefaultParity);
> >> --
> >> 2.5.0
> >>
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
> >
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Update 'dh' command to reflect correct driver handle information

2016-01-15 Thread Carsey, Jaben
Thanks for the Contributed-under line update.  

Done 19648.

> -Original Message-
> From: Tapan Shah [mailto:tapands...@hpe.com]
> Sent: Friday, January 15, 2016 9:04 AM
> To: edk2-devel@lists.01.org; Carsey, Jaben 
> Cc: samer.el-haj-mahm...@hpe.com; tapands...@hpe.com
> Subject: [PATCH] ShellPkg: Update 'dh' command to reflect correct driver
> handle information
> Importance: High
> 
> 'dh' command shows Supported EFI Specification Version value as
> DriverVersion. Changing it to 'SupportedEfiSpecVersion' to provide more
> accurate information.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Tapan Shah 
> ---
>  ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> index 3dd8896..7e827f0 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> @@ -2,7 +2,7 @@
>  //
>  // Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. 
>  // (C) Copyright 2013-2015 Hewlett-Packard Development Company,
> L.P.
> -// (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> +// (C) Copyright 2015-2016 Hewlett Packard Enterprise Development
> LP
>  // This program and the accompanying materials
>  // are licensed and made available under the terms and conditions of the BSD
> License
>  // which accompanies this distribution. The full text of the license may be
> found at
> @@ -50,7 +50,7 @@
>  #string STR_DRIVER_CN #language en-US "ComponentName"
>  #string STR_DRIVER_CN2#language en-US "ComponentName2"
>  #string STR_PLAT_DRV_CFG  #language en-US
> "PlatformtoDriverConfiguration"
> -#string STR_DRIVER_VERSION#language en-US "DriverVersion"
> +#string STR_DRIVER_VERSION#language en-US
> "SupportedEfiSpecVersion"
> 
>  // Console
>  #string STR_TXT_IN#language en-US "SimpleTextIn"
> --
> 2.6.2.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Clean-up 'map' command error message handling

2016-01-07 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Tapan Shah [mailto:tapands...@hpe.com]
> Sent: Thursday, January 07, 2016 9:43 AM
> To: edk2-devel@lists.01.org; Carsey, Jaben 
> Cc: samer.el-haj-mahm...@hpe.com; tapands...@hpe.com
> Subject: [PATCH] ShellPkg: Clean-up 'map' command error message handling
> Importance: High
> 
> Refactor 'map' command error handling code and add standard error
> message
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Tapan Shah 
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c | 81 +++-
> ---
>  1 file changed, 40 insertions(+), 41 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
> index a41a5f1..035aff1 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Map.c
> @@ -1,8 +1,10 @@
>  /** @file
>Main file for map shell level 2 command.
> 
> -  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
>Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
> +  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> +  (C) Copyright 2016 Hewlett Packard Enterprise Development LP
> +
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -1196,51 +1198,48 @@ ShellCommandRunMap (
>  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV),
> gShellLevel2HiiHandle, L"map", Mapping);
>  ShellStatus = SHELL_INVALID_PARAMETER;
>} else {
> -if (MapAsHandle != NULL) {
> -  TempStringLength = StrLen(SName);
> -  if (!IsNumberLetterOnly(SName, TempStringLength-
> (SName[TempStringLength-1]==L':'?1:0))) {
> -ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> (STR_GEN_PARAM_INV),
> gShellLevel2HiiHandle, L"map", SName);
> -ShellStatus = SHELL_INVALID_PARAMETER;
> -  } else {
> +TempStringLength = StrLen(SName);
> +if (!IsNumberLetterOnly(SName, TempStringLength-
> (SName[TempStringLength-1]==L':'?1:0))) {
> +  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV),
> gShellLevel2HiiHandle, L"map", SName);
> +  ShellStatus = SHELL_INVALID_PARAMETER;
> +}
> +
> +if (ShellStatus == SHELL_SUCCESS) {
> +  if (MapAsHandle != NULL) {
>  ShellStatus = AddMappingFromHandle(MapAsHandle, SName);
> -  }
> -} else {
> -  TempStringLength = StrLen(SName);
> -  if (!IsNumberLetterOnly(SName, TempStringLength-
> (SName[TempStringLength-1]==L':'?1:0))) {
> -ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> (STR_GEN_PARAM_INV),
> gShellLevel2HiiHandle, L"map", SName);
> -ShellStatus = SHELL_INVALID_PARAMETER;
>} else {
>  ShellStatus = AddMappingFromMapping(Mapping, SName);
>}
> +
> +  if (ShellStatus != SHELL_SUCCESS) {
> +switch (ShellStatus) {
> +  case SHELL_ACCESS_DENIED:
> +ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> (STR_GEN_ERR_AD),
> gShellLevel2HiiHandle, L"map");
> +break;
> +  case SHELL_INVALID_PARAMETER:
> +ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_GEN_PARAM_INV), gShellLevel2HiiHandle, L"map", Mapping);
> +break;
> +  case SHELL_DEVICE_ERROR:
> +ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_MAP_NOF),
> gShellLevel2HiiHandle, L"map", Mapping);
> +break;
> +  default:
> +ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN 
> (STR_GEN_ERR_UK),
> gShellLevel2HiiHandle, L"map", ShellStatus|MAX_BIT);
> +}
> +  } else {
> +//
> +// now do the display...
> +//
> +ShellStatus = PerformMappingDisplay(
> +  FALSE,
> +  FALSE,
> +  FALSE,
> +  NULL,
> +  SfoMode,
> +  SName,
> +  TRUE
> + );
> +  } // we were su

Re: [edk2] [PATCH v2] ShellPkg : Add UEFI_APPLICATION module type to UefiShellInstall1CommandsLib.inf

2016-01-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of El-
> Haj-Mahmoud, Samer
> Sent: Tuesday, January 05, 2016 10:55 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: Re: [edk2] [PATCH v2] ShellPkg : Add UEFI_APPLICATION module
> type to UefiShellInstall1CommandsLib.inf
> Importance: High
> 
> Jaben,
> 
> Can you please review?
> 
> Thanks,
> --Samer
> 
> 
> -Original Message-
> From: El-Haj-Mahmoud, Samer
> Sent: Thursday, December 24, 2015 9:10 AM
> To: edk2-devel@lists.01.org
> Cc: Jaben Carsey ; Shumin Qiu
> ; El-Haj-Mahmoud, Samer  mahm...@hpe.com>; El-Haj-Mahmoud, Samer  mahm...@hpe.com>
> Subject: [PATCH v2] ShellPkg : Add UEFI_APPLICATION module type to
> UefiShellInstall1CommandsLib.inf
> 
> Using UEFI_APPLICATION for all Shell app and libraries allows the use of
> different compiler flags for the Shell application itself and for other
> applications that are built separately that use Shell libraries.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Samer El-Haj-Mahmoud 
> ---
>  .../UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf  | 3 
> ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsL
> ib.inf
> b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Commands
> Lib.inf
> index dc1b622..7ea306d 100644
> ---
> a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsL
> ib.inf
> +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Com
> +++ mandsLib.inf
> @@ -2,6 +2,7 @@
>  #  Provides shell install1 functions
>  #
>  #  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. 
> +#  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>  #
>  #  This program and the accompanying materials  #  are licensed and made
> available under the terms and conditions of the BSD License @@ -16,7 +17,7
> @@
>INF_VERSION= 0x00010006
>BASE_NAME  = UefiShellInstall1CommandsLib
>FILE_GUID  = D250E364-51C6-49ed-AEBF-6D83F5130F74
> -  MODULE_TYPE= UEFI_DRIVER
> +  MODULE_TYPE= UEFI_DRIVER UEFI_APPLICATION
>VERSION_STRING = 1.0
>LIBRARY_CLASS  = NULL|UEFI_APPLICATION UEFI_DRIVER
>CONSTRUCTOR= ShellInstall1CommandsLibConstructor
> --
> 2.6.3.windows.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Make 'alias' can display a single alias name.

2016-01-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Tuesday, January 5, 2016 12:33 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> 
> Subject: [PATCH] ShellPkg: Make 'alias' can display a single alias name.
> Importance: High
> 
> When we run command "alias cat" Shell print out "alias: Too few arguments".
> This patch makes value of single alias name can be displayed.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c | 19 -
> --
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
> b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
> index 1161746..bcd14c8 100644
> --- a/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
> +++ b/ShellPkg/Library/UefiShellLevel3CommandsLib/Alias.c
> @@ -2,7 +2,7 @@
>Main file for Alias shell level 3 function.
> 
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2009 - 2014, Intel Corporation. All rights reserved. 
> +  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.
> + 
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be 
> found
> at @@ -92,6 +92,8 @@ ShellCommandRunAlias (
>CONST CHAR16*Param1;
>CONST CHAR16*Param2;
>CHAR16  *CleanParam2;
> +  CONST CHAR16*ConstAliasVal;
> +  BOOLEAN Volatile;
> 
>ProblemParam= NULL;
>ShellStatus = SHELL_SUCCESS;
> @@ -165,8 +167,19 @@ ShellCommandRunAlias (
>  }
>}
>  } else if (ShellCommandLineGetCount(Package) == 2) {
> -  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_FEW),
> gShellLevel3HiiHandle, L"alias");
> -  ShellStatus = SHELL_INVALID_PARAMETER;
> +  //
> +  // print out a single alias
> +  //
> +  ConstAliasVal = gEfiShellProtocol->GetAlias(Param1, &Volatile);
> +  if (ConstAliasVal == NULL) {
> +ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_PARAM_INV),
> gShellLevel3HiiHandle, L"alias", Param1);
> +ShellStatus = SHELL_INVALID_PARAMETER;
> +  } else {
> +if (ShellCommandIsOnAliasList(Param1)) {
> +  Volatile = FALSE;
> +}
> +ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_ALIAS_OUTPUT),
> gShellLevel3HiiHandle, !Volatile?L' ':L'*', Param1, ConstAliasVal);
> +  }
>  } else {
>ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_GEN_TOO_MANY),
> gShellLevel3HiiHandle, L"alias");
>ShellStatus = SHELL_INVALID_PARAMETER;
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Fix Shell assert when mv a file to a NULL target.

2016-01-05 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Monday, January 4, 2016 8:03 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> 
> Subject: [PATCH] ShellPkg: Fix Shell assert when mv a file to a NULL target.
> Importance: High
> 
> When run command 'mv file ' the Shell assert. The patch refined the length of
> the buffer to fix this bug.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> index eb7287e..29efb1c 100644
> --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Mv.c
> @@ -2,7 +2,7 @@
>Main file for mv shell level 2 function.
> 
>(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
> +  Copyright (c) 2009 - 2016, Intel Corporation. All rights
> + reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be 
> found
> at @@ -731,7 +731,7 @@ ShellCommandRunMv (
>  //
>  // ValidateAndMoveFiles will report errors to the screen itself
>  //
> -CwdSize = StrSize(ShellGetCurrentDir(NULL)) + 1;
> +CwdSize = StrSize(ShellGetCurrentDir(NULL)) +
> + sizeof(CHAR16);
>  Cwd = AllocateZeroPool(CwdSize);
>  ASSERT (Cwd != NULL);
>  StrCpyS(Cwd, CwdSize/sizeof(CHAR16), ShellGetCurrentDir(NULL));
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 4/6] ArmVirtPkg: use small code model for all UEFI_APPLICATION modules

2016-01-04 Thread Carsey, Jaben


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Monday, January 4, 2016 10:27 AM
> To: Ard Biesheuvel ; edk2-de...@ml01.01.org;
> leif.lindh...@linaro.org; Gao, Liming ; Carsey, Jaben
> 
> Subject: Re: [PATCH 4/6] ArmVirtPkg: use small code model for all
> UEFI_APPLICATION modules
> Importance: High
> 
> On 12/24/15 14:03, Ard Biesheuvel wrote:
> > Unfortunately, compiling the DEBUG shell using the small code model is
> > not sufficient in all cases to get a successful build when the
> > toolchain defaults to the tiny code model. The reason is that not only
> > the Shell binary itself should be built using the small code model,
> > all Shell component libraries that are linked into the Shell binary
> > via NULL library class resolution should use the small code model as well.
> >
> > So override the code model and function alignment for DEBUG builds of
> > UEFI_APPLICATION modules when using GCC 4.9 (which is the only
> > toolchain that uses the tiny model). This should affect all Shell
> > component libraries in addition to the Shell core binary.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Ard Biesheuvel 
> > ---
> >  ArmVirtPkg/ArmVirt.dsc.inc | 21 
> >  1 file changed, 21 insertions(+)
> >
> > diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc
> > index 49e4264ee8a4..fbd710cb870d 100644
> > --- a/ArmVirtPkg/ArmVirt.dsc.inc
> > +++ b/ArmVirtPkg/ArmVirt.dsc.inc
> > @@ -406,3 +406,24 @@ [Components.common]
> >gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
> >gEfiMdePkgTokenSpaceGuid.PcdUefiLibMaxPrintBufferSize|8000
> >}
> > +
> > +[BuildOptions.AARCH64.EDKII.UEFI_APPLICATION]
> > +  #
> > +  # The bulk of the Shell functionality is implemented by
> > +UEFI_APPLICATION
> > +  # libraries that are linked into the Shell binary via NULL library
> > +class
> > +  # resolution. Since the Shell built in DEBUG mode exceeds the 1 MB
> > +range of
> > +  # the AARCH64 tiny code model which we use by default on GCC 4.9
> > +and later,
> > +  # the .text and .data sections of the remaining base libraries
> > +(which are
> > +  # built using the tiny code model regardless of the model we use
> > +for
> > +  # UEFI_APPLICATION modules) should be kept as close together as possible.
> > +  #
> > +  # By reverting to 8 byte function alignment for UEFI_APPLICATION
> > +modules
> > +  # (which is usually the default, but will be lowered to 4 if we are
> > +using the
> > +  # tiny code model) and letting the linker sort its input by
> > +alignment, we can
> > +  # force all UEFI_APPLICATION small code model .text input sections
> > +to appear
> > +  # first in the binary. The remaining base libraries will end up in
> > +close
> > +  # proximity of each other at the end of the image, preventing out
> > +of range
> > +  # problems when relocating their tiny model (+/- 1 MB) symbol references.
> > +  #
> > +  DEBUG_GCC49_*_CC_FLAGS = -mcmodel=small -falign-functions=8
> > +  DEBUG_GCC49_*_DLINK_FLAGS = -z common-page-size=0x1000
> >
> 
> I don't have technical objections, just that I don't really like the 
> complexity of
> this.
> 
> In <http://thread.gmane.org/gmane.comp.bios.edk2.devel/6213/focus=6249>,
> you wrote
> 
> > Well, this is primarily caused by the way the Shell is composed of
> > static libraries, and it is unlikely that this should ever affect
> > other UEFI_APPLICATION modules as well. And building everything else
> > with the large code model because of this seems backwards to me too.

Given that these other libraries are not listed anywhere else in the DSC, maybe 
we could move the other content to a  under the shell "{}" also?


> 
> I think I'd prefer a "one size fits all" code model where we (as
> developers) get to keep our sanity, even if it costs a tiny bit more 
> resources at
> runtime. Can you please summarize (again?) the benefits of the tiny model over
> the small model?
> 
> I can see the ADR / ADRP discussion in patch 3/6, but what does that 
> difference
> mean in practice?
> 
> What savings justify the code model proliferation between GCC <= 4.8 
> ("large"),
> CLANG 3.5 ("small"), GCC >= 4.9 ("tiny", except for the DEBUG Shell, which
> would be made "small" by the above)?
> 
> Would ArmVirtPkg build (with all supported toolchains) using the "small"
> code model?
> 
> Thanks
> Laszlo
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Refine the code format.

2015-12-30 Thread Carsey, Jaben
I think we should change 0 to CHAR_NULL in the comparison.

Otherwise: Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ni, Ruiyu
> Sent: Sunday, December 20, 2015 9:07 PM
> To: Qiu, Shumin ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> ; Jim Dailey 
> Subject: RE: [edk2] [PATCH] ShellPkg: Refine the code format.
> Importance: High
> 
> 
> 
> Reviewed-by: Ruiyu Ni 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
> Shumin
> Sent: Saturday, December 19, 2015 7:43 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> ; Jim Dailey 
> Subject: [edk2] [PATCH] ShellPkg: Refine the code format.
> 
> 1. Add function header comment.
> 2. Non-Boolean comparisons should explicitly use a compare operator.
> 
> Cc: Jim Dailey 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Application/Shell/ShellManParser.c | 23
> +--
>  1 file changed, 21 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellManParser.c
> b/ShellPkg/Application/Shell/ShellManParser.c
> index f12775f..6c18491 100644
> --- a/ShellPkg/Application/Shell/ShellManParser.c
> +++ b/ShellPkg/Application/Shell/ShellManParser.c
> @@ -15,7 +15,26 @@
> 
>  #include "Shell.h"
> 
> -CHAR16 EFIAPI InternalShellCharToUpper (IN CHAR16  Char);
> +/**
> +  Convert a Unicode character to upper case only if
> +  it maps to a valid small-case ASCII character.
> +
> +  This internal function only deal with Unicode character
> +  which maps to a valid small-case ASCII character, i.e.
> +  L'a' to L'z'. For other Unicode character, the input character
> +  is returned directly.
> +
> +  @param  Char  The character to convert.
> +
> +  @retval LowerCharacter   If the Char is with range L'a' to L'z'.
> +  @retval UnchangedOtherwise.
> +
> +**/
> +CHAR16
> +EFIAPI
> +InternalShellCharToUpper (
> +  IN CHAR16  Char
> +  );
> 
>  /**
>Verifies that the filename has .MAN on the end.
> @@ -630,7 +649,7 @@ ManFileFindTitleSection(
>// Do not pass any leading path information that may be present to
> IsTitleHeader().
>//
>Start = StrLen(Command);
> -  while (Start
> +  while ((Start != 0)
>   && (*(Command + Start - 1) != L'\\')
>   && (*(Command + Start - 1) != L'/')
>   && (*(Command + Start - 1) != L':')) {
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 2/4] ShellPkg: Refine the code logic of 'command history'.

2015-12-28 Thread Carsey, Jaben
Yao's suggestion seems like a good one.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Yao, Jiewen
> Sent: Wednesday, December 23, 2015 7:42 PM
> To: Qiu, Shumin ; edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ni, Ruiyu ;
> Qiu, Shumin 
> Subject: RE: [edk2] [PATCH v3 2/4] ShellPkg: Refine the code logic of 'command
> history'.
> Importance: High
> 
> Hi
> I suggest we also handle PcdShellMaxHistoryCommandCount == 0 case.
> 
> I think we can add below at the begging of function.
>   if (MaxHistoryCmdCount == 0) {
> return ;
>   }
> 
> Other change seems good. Reviewed by: jiewen@intel.com
> 
> 
> Thank you
> Yao Jiewen
> 
> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
> Shumin
> Sent: Wednesday, December 23, 2015 2:15 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben; Ni, Ruiyu; Qiu, Shumin
> Subject: [edk2] [PATCH v3 2/4] ShellPkg: Refine the code logic of 'command
> history'.
> 
> Add the PCD to PcdShellMaxHistoryCommandCount indicate the max count of
> history commands.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> Reviewed-by: Ruiyu Ni 
> Reviewed-by: Jaben Carsey 
> ---
>  ShellPkg/Application/Shell/Shell.c   | 24 +++-
>  ShellPkg/Application/Shell/Shell.inf | 25 +
>  ShellPkg/ShellPkg.dec|  3 +++
>  3 files changed, 39 insertions(+), 13 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c 
> b/ShellPkg/Application/Shell/Shell.c
> index 3606322..41c8a03 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -1288,13 +1288,35 @@ AddLineToCommandHistory(
>)
>  {
>BUFFER_LIST *Node;
> +  BUFFER_LIST *Walker;
> +  UINT16   MaxHistoryCmdCount;
> +  UINT16   Count;
> +
> +  Count = 0;
> +  MaxHistoryCmdCount = PcdGet16(PcdShellMaxHistoryCommandCount);
> 
>Node = AllocateZeroPool(sizeof(BUFFER_LIST));
>ASSERT(Node != NULL);
>Node->Buffer = AllocateCopyPool(StrSize(Buffer), Buffer);
>ASSERT(Node->Buffer != NULL);
> 
> -  InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link,
> &Node->Link);
> +  for ( Walker =
> (BUFFER_LIST*)GetFirstNode(&ShellInfoObject.ViewingSettings.CommandHistor
> y.Link)
> +  ; !IsNull(&ShellInfoObject.ViewingSettings.CommandHistory.Link, 
> &Walker-
> >Link)
> +  ; Walker =
> (BUFFER_LIST*)GetNextNode(&ShellInfoObject.ViewingSettings.CommandHisto
> ry.Link, &Walker->Link)
> +   ){
> +Count++;
> +  }
> +  if (Count < MaxHistoryCmdCount){
> +
> + InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link,
> &Node->Link);  } else {
> +Walker =
> (BUFFER_LIST*)GetFirstNode(&ShellInfoObject.ViewingSettings.CommandHistor
> y.Link);
> +RemoveEntryList(&Walker->Link);
> +if (Walker->Buffer != NULL) {
> +  FreePool(Walker->Buffer);
> +}
> +FreePool(Walker);
> +
> + InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link,
> + &Node->Link);  }
>  }
> 
>  /**
> diff --git a/ShellPkg/Application/Shell/Shell.inf
> b/ShellPkg/Application/Shell/Shell.inf
> index 09aecf7..253bfdb 100644
> --- a/ShellPkg/Application/Shell/Shell.inf
> +++ b/ShellPkg/Application/Shell/Shell.inf
> @@ -95,18 +95,19 @@
>gEfiDevicePathProtocolGuid  ## CONSUMES
> 
>  [Pcd]
> -  gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols  ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellRequireHiiPlatform   ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii  ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount   ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize  ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole ## CONSUMES
> -  gEfiShellPkgTokenSpaceGuid.PcdShellSupplier ## CONSUMES
> +  gEfiShellPkgTokenSpaceGuid.PcdShellSupportLevel   ## CONSUMES
> +  gEfiShellPkgTokenSpaceGuid.PcdShellSupportOldProtocols## CONSUMES
> +  gEfiShellPkgTokenSpaceGuid.PcdShel

Re: [edk2] about UEFI Shell and NTFS filesystem

2015-12-28 Thread Carsey, Jaben
Is it possible that the NT32 file system driver is completely read only?  I am 
not sure myself...

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> LiHongcheng
> Sent: Monday, December 28, 2015 7:02 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] about UEFI Shell and NTFS filesystem
> Importance: High
> 
> Dear Sir/Madam,
>   Recently, I entered into the built-in shell of my computer, and switched
> into fs2: partition, I listed the contents and found that it was my OS`s disk 
> C.
> Then I tried to create a folder with MKDIR command, but it printed out an 
> error
> message: mkdir: Cannot create fs2:\new - Write Protected.
>   Are there somebody who know how to turn off the write-protection? Or
> have anyone met this problem before? If so, please give me some advice. Thank
> you very much!
> 
> owen
> 发送自 Windows 10 版邮件应用
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] AppPkg/.../Python-2.7.10: Update pyconfig for Python 2.7.10 compliance.

2015-12-27 Thread Carsey, Jaben
Content looks good.  The format is harder to find the changes than the standard 
output from git I think.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Sunday, December 27, 2015 4:34 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Bjorge,
> Erik C 
> Subject: [Patch] AppPkg/.../Python-2.7.10: Update pyconfig for Python 2.7.10
> compliance.
> Importance: High
> 
> Jaben or Erik, could you please review the following patch?
> 
> AppPkg/Applications/Python/Python-2.7.10/*/pyconfig.h: Update pyconfig for
> Python 2.7.10 compliance.
> 
> Add new constants required for Python 2.7.10.
> Update package and help values.
> Define networking constants so that the getaddrinfo, gethostbyname, and
> getnameinfo functions are used from the sockets package.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> ---
>  .../Python/Python-2.7.10/Ia32/pyconfig.h | 18 +-  .../Python/Python-
> 2.7.10/X64/pyconfig.h  | 89 +++--
>  2 files changed, 73 insertions(+), 34 deletions(-)
> 
> diff C3 a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> *** a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h Tue Dec 22
> 16:15:45 2015
> --- b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h Sun Dec 27
> 15:07:14 2015
> ***
> *** 289,295 
>   #endif
> 
>   /* Define if you have the getaddrinfo function. */ ! #undef
> HAVE_GETADDRINFO
> 
>   /* Define to 1 if you have the 'getcwd' function. */
>   #define HAVE_GETCWD   1
> --- 289,296 
>   #endif
> 
>   /* Define if you have the getaddrinfo function. */ ! //#undef
> HAVE_GETADDRINFO ! #define HAVE_GETADDRINFO  1
> 
>   /* Define to 1 if you have the 'getcwd' function. */
>   #define HAVE_GETCWD   1
> ***
> *** 304,310 
>   #undef HAVE_GETGROUPS
> 
>   /* Define to 1 if you have the 'gethostbyname' function. */ ! #undef
> HAVE_GETHOSTBYNAME
> 
>   /* Define this if you have some version of gethostbyname_r() */
>   #undef HAVE_GETHOSTBYNAME_R
> --- 305,312 
>   #undef HAVE_GETGROUPS
> 
>   /* Define to 1 if you have the 'gethostbyname' function. */ ! //#undef
> HAVE_GETHOSTBYNAME ! #define HAVE_GETHOSTBYNAME  1
> 
>   /* Define this if you have some version of gethostbyname_r() */
>   #undef HAVE_GETHOSTBYNAME_R
> ***
> *** 328,334 
>   #undef HAVE_GETLOGIN
> 
>   /* Define to 1 if you have the 'getnameinfo' function. */ ! #undef
> HAVE_GETNAMEINFO
> 
>   /* Define if you have the 'getpagesize' function. */
>   #undef HAVE_GETPAGESIZE
> --- 330,337 
>   #undef HAVE_GETLOGIN
> 
>   /* Define to 1 if you have the 'getnameinfo' function. */ ! //#undef
> HAVE_GETNAMEINFO ! #define HAVE_GETNAMEINFO 1
> 
>   /* Define if you have the 'getpagesize' function. */
>   #undef HAVE_GETPAGESIZE
> diff C3 a/AppPkg/Applications/Python/X64/pyconfig.h
> b/AppPkg/Applications/Python/X64/pyconfig.h
> *** a/AppPkg/Applications/Python/X64/pyconfig.h  Tue Nov 03 10:58:06 2015
> --- b/AppPkg/Applications/Python/X64/pyconfig.h  Sun Dec 27 15:11:17 2015
> ***
> *** 1,6 
> --- 1,7 
>   /** @file
>   Manually generated Python Configuration file for EDK II.
> 
> + Copyright (c) 2015, Daryl McDaniel. All rights reserved.
>   Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
>   This program and the accompanying materials are licensed and made
> available under
>   the terms and conditions of the BSD License that accompanies this
> distribution.
> ***
> *** 67,72 
> --- 68,76 
>   /* Define to 1 if you have the 'alarm' function. */
>   #undef HAVE_ALARM
> 
> + /* Define to 1 if you have the  header file. */ #undef
> + HAVE_ALLOCA_H
> +
>   /* Define this if your time.h defines altzone. */
>   #undef HAVE_ALTZONE
> 
> ***
> *** 109,114 
> --- 113,121 
>   /* define to 1 if your sem_getvalue is broken. */
>   #define HAVE_BROKEN_SEM_GETVALUE  1
> 
> + /* Define if 'unsetenv' does not return an int. */ #undef
> + HAVE_BROKEN_UNSETENV
> +
>   /* Define this if you have the type _Bool. */
>   #define HAVE_C99_BOOL 1
> 
> ***
> *** 170,179 
>   /* Define to 1 if you have the device macros. */
>   #undef HAVE_DEVICE_MACROS
> 
> ! /* Define if we have /dev/ptc. */
>   #undef HAVE_DEV_PTC
> 
> ! /* Define if we have /dev/ptmx. */
>  

Re: [edk2] [PATCH] ShellPkg : Change UefiShellInstall1CommandsLib.inf type to UEFI_APPLICATION

2015-12-21 Thread Carsey, Jaben
I am fine with the change.  I just wanted to know what the goal was...  if the 
library could be used by a DXE, then shouldn't we just all EFI_APPLICATION as 
another of the supported build types?

> -Original Message-
> From: El-Haj-Mahmoud, Samer [mailto:samer.el-haj-mahm...@hpe.com]
> Sent: Monday, December 21, 2015 5:30 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; El-Haj-Mahmoud, Samer  haj-mahm...@hpe.com>
> Subject: RE: [PATCH] ShellPkg : Change UefiShellInstall1CommandsLib.inf type 
> to
> UEFI_APPLICATION
> Importance: High
> 
> Jaben,
> 
> Using UEFI_APPLICATION for all Shell app and libraries allows the use of
> different compiler flags for the Shell application itself and also for any 
> other
> applications that are built separately and that use Shell libraries.
> 
> It looks like the ShellPkg INFs use a mix of UEFI_APPLICATION and UEFI_DRIVER.
> Do you think they should all be cleaned up to be consistent, or left alone 
> and this
> change discarded?
> 
> Thanks,
> --Samer
> 
> 
> -Original Message-
> From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> Sent: Monday, December 21, 2015 8:16 PM
> To: El-Haj-Mahmoud, Samer ; edk2-
> de...@lists.01.org
> Cc: Qiu, Shumin ; El-Haj-Mahmoud, Samer  haj-mahm...@hpe.com>; Carsey, Jaben 
> Subject: RE: [PATCH] ShellPkg : Change UefiShellInstall1CommandsLib.inf type 
> to
> UEFI_APPLICATION
> 
> What's the benefit of this change?  It's not bad, but I don't know why its
> important...
> 
> Jaben
> 
> > -Original Message-
> > From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hpe.com]
> > Sent: Monday
> , December 21, 2015 4:29 PM
> > To: edk2-devel@lists.01.org
> > Cc: Qiu, Shumin ; Carsey, Jaben
> > ; Samer El-Haj-Mahmoud  > mahm...@hpe.com>; Samer El-Haj-Mahmoud 
> > Subject: [PATCH] ShellPkg : Change UefiShellInstall1CommandsLib.inf
> > type to UEFI_APPLICATION
> > Importance: High
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Samer El-Haj-Mahmoud 
> > ---
> >  .../UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf  | 3 
> > ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git
> > a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Comma
> > ndsLi
> > b.inf
> > b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Comma
> > ndsLi
> > b.inf
> > index dc1b622..b2644c2 100644
> > ---
> > a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Comma
> > ndsLi
> > b.inf
> > +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1C
> > +++ om
> > +++ mandsLib.inf
> > @@ -2,6 +2,7 @@
> >  #  Provides shell install1 functions
> >  #
> >  #  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
> > 
> > +#  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> >  #
> >  #  This program and the accompanying materials  #  are licensed and
> > made available under the terms and conditions of the BSD License @@
> > -16,7 +17,7 @@
> >INF_VERSION= 0x00010006
> >BASE_NAME  = UefiShellInstall1CommandsLib
> >FILE_GUID  = D250E364-51C6-49ed-AEBF-6D83F5130F74
> > -  MODULE_TYPE= UEFI_DRIVER
> > +  MODULE_TYPE= UEFI_APPLICATION
> >VERSION_STRING = 1.0
> >LIBRARY_CLASS  = NULL|UEFI_APPLICATION UEFI_DRIVER
> >CONSTRUCTOR= ShellInstall1CommandsLibConstructor
> > --
> > 2.6.3.windows.1
> 

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 2/4] ShellPkg: Refine the code logic of 'command history'.

2015-12-21 Thread Carsey, Jaben
Can you make this into a PCD?

That would be cleaner.  I would like patchable be one option.


> -Original Message-
> From: Qiu, Shumin
> Sent: Monday, December 21, 2015 7:19 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> ; Ni, Ruiyu 
> Subject: [PATCH v2 2/4] ShellPkg: Refine the code logic of 'command history'.
> Importance: High
> 
> Add the macro MAX_HISTORY_COMMANDS_COUNT to indicate the max count
> of history commands.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> Reviewed-by: Ruiyu Ni 
> ---
>  ShellPkg/Application/Shell/Shell.c | 24 +++-
>  ShellPkg/Application/Shell/Shell.h |  2 ++
>  2 files changed, 25 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c 
> b/ShellPkg/Application/Shell/Shell.c
> index 3606322..be97879 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -1288,13 +1288,35 @@ AddLineToCommandHistory(ble
>)
>  {
>BUFFER_LIST *Node;
> +  BUFFER_LIST *Walker;
> +  UINT8   MaxHistoryCmdCount;
> +  UINT8   Count;
> +
> +  Count = 0;
> +  MaxHistoryCmdCount = MAX_HISTORY_COMMANDS_COUNT;
> 
>Node = AllocateZeroPool(sizeof(BUFFER_LIST));
>ASSERT(Node != NULL);
>Node->Buffer = AllocateCopyPool(StrSize(Buffer), Buffer);
>ASSERT(Node->Buffer != NULL);
> 
> -  InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link,
> &Node->Link);
> +  for ( Walker =
> (BUFFER_LIST*)GetFirstNode(&ShellInfoObject.ViewingSettings.CommandHistor
> y.Link)
> +  ; !IsNull(&ShellInfoObject.ViewingSettings.CommandHistory.Link, 
> &Walker-
> >Link)
> +  ; Walker =
> (BUFFER_LIST*)GetNextNode(&ShellInfoObject.ViewingSettings.CommandHisto
> ry.Link, &Walker->Link)
> +   ){
> +Count++;
> +  }
> +  if (Count < MaxHistoryCmdCount){
> +InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link,
> &Node->Link);
> +  } else {
> +Walker =
> (BUFFER_LIST*)GetFirstNode(&ShellInfoObject.ViewingSettings.CommandHistor
> y.Link);
> +RemoveEntryList(&Walker->Link);
> +if (Walker->Buffer != NULL) {
> +  FreePool(Walker->Buffer);
> +}
> +FreePool(Walker);
> +InsertTailList(&ShellInfoObject.ViewingSettings.CommandHistory.Link,
> &Node->Link);
> +  }
>  }
> 
>  /**
> diff --git a/ShellPkg/Application/Shell/Shell.h
> b/ShellPkg/Application/Shell/Shell.h
> index 5726320..d5d5878 100644
> --- a/ShellPkg/Application/Shell/Shell.h
> +++ b/ShellPkg/Application/Shell/Shell.h
> @@ -124,6 +124,8 @@ typedef struct {
> 
>  extern SHELL_INFO ShellInfoObject;
> 
> +#define MAX_HISTORY_COMMANDS_COUNT32
> +
>  /**
>Converts the command line to it's post-processed form.  this replaces 
> variables
> and alias' per UEFI Shell spec.
> 
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 3/4] ShellPkg: Fix memory leak in ShellProtocol.

2015-12-21 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Monday, December 21, 2015 7:19 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> ; Ni, Ruiyu 
> Subject: [PATCH v2 3/4] ShellPkg: Fix memory leak in ShellProtocol.
> Importance: High
> 
> 1. Close unused file handle.
> 2. Free the local allocated buffer function returned.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> Reviewed-by: Ruiyu Ni 
> ---
>  ShellPkg/Application/Shell/ShellProtocol.c | 5 +
>  1 file changed, 5 insertions(+)
> 
> diff --git a/ShellPkg/Application/Shell/ShellProtocol.c
> b/ShellPkg/Application/Shell/ShellProtocol.c
> index def3bd3..6d5fc1f 100644
> --- a/ShellPkg/Application/Shell/ShellProtocol.c
> +++ b/ShellPkg/Application/Shell/ShellProtocol.c
> @@ -1361,6 +1361,7 @@ EfiShellDeleteFileByName(
>//
>// now delete the file
>//
> +  ShellFileHandleRemove(FileHandle);
>return (ShellInfoObject.NewEfiShellProtocol->DeleteFile(FileHandle));
>  }
> 
> @@ -2338,6 +2339,7 @@ ShellSearchHandle(
>// recurse with the next part of the pattern
>//
>Status = ShellSearchHandle(NextFilePatternStart, 
> UnicodeCollation,
> ShellInfoNode->Handle, FileList, ShellInfoNode, MapName);
> +  EfiShellClose(ShellInfoNode->Handle);
>  }
>} else if (!EFI_ERROR(Status)) {
>  //
> @@ -2456,6 +2458,7 @@ EfiShellFindFiles(
>  ; PatternCurrentLocation++);
>  PatternCurrentLocation++;
>  Status = ShellSearchHandle(PatternCurrentLocation, gUnicodeCollation,
> RootFileHandle, FileList, NULL, MapName);
> +EfiShellClose(RootFileHandle);
>}
>FreePool(RootDevicePath);
>  }
> @@ -3260,6 +3263,7 @@ EfiShellGetAlias(
> 
>  if (Volatile == NULL) {
>GetVariable2 (AliasLower, &gShellAliasGuid, (VOID **)&AliasVal, NULL);
> +  FreePool(AliasLower);
>return (AddBufferToFreeList(AliasVal));
>  }
>  RetSize = 0;
> @@ -3273,6 +3277,7 @@ EfiShellGetAlias(
>if (RetVal != NULL) {
>  FreePool(RetVal);
>}
> +  FreePool(AliasLower);
>return (NULL);
>  }
>  if ((EFI_VARIABLE_NON_VOLATILE & Attribs) ==
> EFI_VARIABLE_NON_VOLATILE) {
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v2 1/4] ShellPkg: Fix memory leak in SimpleTextOutput on file.

2015-12-21 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Monday, December 21, 2015 7:19 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> ; Ni, Ruiyu 
> Subject: [PATCH v2 1/4] ShellPkg: Fix memory leak in SimpleTextOutput on file.
> Importance: High
> 
> Free 'SimpleTextOut->Mode' buffer before 'SimpleTextOut' is free.
> 
> Cc: Jaben Carsey 
> Cc: Ruiyu Ni 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> Reviewed-by: Ruiyu Ni 
> ---
>  ShellPkg/Application/Shell/ConsoleWrappers.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Application/Shell/ConsoleWrappers.c
> b/ShellPkg/Application/Shell/ConsoleWrappers.c
> index 04a7513..46af141 100644
> --- a/ShellPkg/Application/Shell/ConsoleWrappers.c
> +++ b/ShellPkg/Application/Shell/ConsoleWrappers.c
> @@ -484,7 +484,8 @@ CreateSimpleTextOutOnFile(
>  *HandleLocation = ProtocolToReturn->TheHandle;
>  return ((EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)ProtocolToReturn);
>} else {
> -FreePool(ProtocolToReturn);
> +SHELL_FREE_NON_NULL(ProtocolToReturn->SimpleTextOut.Mode);
> +SHELL_FREE_NON_NULL(ProtocolToReturn);
>  return (NULL);
>}
>  }
> @@ -511,6 +512,7 @@ CloseSimpleTextOutOnFile(
>  ((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)-
> >TheHandle,
>  &gEfiSimpleTextOutProtocolGuid,
>  &(((SHELL_EFI_SIMPLE_TEXT_OUTPUT_PROTOCOL*)SimpleTextOut)-
> >SimpleTextOut));
> +  FreePool(SimpleTextOut->Mode);
>FreePool(SimpleTextOut);
>return (Status);
>  }
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Add AIP IPv6 UNDI support to Shell dh

2015-12-21 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hpe.com]
> Sent: Monday, December 21, 2015 4:22 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> ; Samer El-Haj-Mahmoud  mahm...@hpe.com>; Samer El-Haj-Mahmoud 
> Subject: [PATCH] ShellPkg: Add AIP IPv6 UNDI support to Shell dh
> Importance: High
> 
> Update Shell DH command to decode and print the value of
> gEfiAdapterInfoUndiIpv6SupportGuid AIP instance
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Samer El-Haj-Mahmoud 
> ---
>  .../UefiHandleParsingLib/UefiHandleParsingLib.c | 21
> +++--
>  .../UefiHandleParsingLib/UefiHandleParsingLib.inf   |  4 +++-
>  .../UefiHandleParsingLib/UefiHandleParsingLib.uni   |  4 +++-
>  3 files changed, 25 insertions(+), 4 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> index 6f093ff..4c46e5e 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> @@ -1,9 +1,9 @@
>  /** @file
>Provides interface to advanced shell functionality for parsing both handle 
> and
> protocol database.
> 
> -  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> -  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
>Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
> +  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> +  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be 
> found
> at @@ -690,6 +690,10 @@ AdapterInformationDumpInformation (
>  TempRetVal = CatSPrint (RetVal, TempStr,
> L"gEfiAdapterInfoSanMacAddressGuid");
>  SHELL_FREE_NON_NULL (RetVal);
>  RetVal = TempRetVal;
> +  } else if (CompareGuid (&InfoTypesBuffer[GuidIndex],
> &gEfiAdapterInfoUndiIpv6SupportGuid)) {
> +TempRetVal = CatSPrint (RetVal, TempStr,
> L"gEfiAdapterInfoUndiIpv6SupportGuid");
> +SHELL_FREE_NON_NULL (RetVal);
> +RetVal = TempRetVal;
>} else {
> 
>  GuidStr = GetStringNameFromGuid (&InfoTypesBuffer[GuidIndex], NULL);
> @@ -782,6 +786,19 @@ AdapterInformationDumpInformation (
>   );
>SHELL_FREE_NON_NULL (RetVal);
>RetVal = TempRetVal;
> +} else if (CompareGuid (&InfoTypesBuffer[GuidIndex],
> &gEfiAdapterInfoUndiIpv6SupportGuid) == TRUE) {
> +  TempStr = HiiGetString (mHandleParsingHiiHandle,
> STRING_TOKEN(STR_UNDI_IPV6_INFO), NULL);
> +  if (TempStr == NULL) {
> +goto ERROR_EXIT;
> +  }
> +
> +  TempRetVal = CatSPrint (
> + RetVal,
> + TempStr,
> + ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT
> *)InformationBlock)->Ipv6Support
> + );
> +  SHELL_FREE_NON_NULL (RetVal);
> +  RetVal = TempRetVal;
>  } else {
>TempStr = HiiGetString (mHandleParsingHiiHandle,
> STRING_TOKEN(STR_UNKNOWN_INFO_TYPE), NULL);
>if (TempStr == NULL) {
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> index 4a19e39..52eed86 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
> @@ -1,7 +1,8 @@
>  ##  @file
>  #  Provides interface to advanced shell functionality for parsing both 
> handle and
> protocol database.
> -#  (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
> #  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. 
> +#  (C) Copyright 2013-2015 Hewlett-Packard Development Company,
> +L.P. #  (C) Copyright 2015 Hewlett Packard Enterprise Development
> +LP
>  #
>  #  This program and the accompanying materials  #  are licensed and made
> available under the terms and conditions of the BSD License @@ -309,6 +310,7
> @@
>gEfiAdapterInfoMediaStateGuid   ## 
> SOMETIMES_CONSUMES ##
> GUID
>gEfiAdapterInfoNetworkBootGuid  ## 
> SOMETIMES_CONSUMES
> ## GUID
>gEfiAdapterInfoSanMacAddressGuid## 
> SOMETIMES_

Re: [edk2] [PATCH] ShellPkg : Change UefiShellInstall1CommandsLib.inf type to UEFI_APPLICATION

2015-12-21 Thread Carsey, Jaben
What's the benefit of this change?  It's not bad, but I don't know why its 
important...

Jaben

> -Original Message-
> From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hpe.com]
> Sent: Monday
, December 21, 2015 4:29 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> ; Samer El-Haj-Mahmoud  mahm...@hpe.com>; Samer El-Haj-Mahmoud 
> Subject: [PATCH] ShellPkg : Change UefiShellInstall1CommandsLib.inf type to
> UEFI_APPLICATION
> Importance: High
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Samer El-Haj-Mahmoud 
> ---
>  .../UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf  | 3 
> ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLi
> b.inf
> b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLi
> b.inf
> index dc1b622..b2644c2 100644
> ---
> a/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLi
> b.inf
> +++ b/ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1Com
> +++ mandsLib.inf
> @@ -2,6 +2,7 @@
>  #  Provides shell install1 functions
>  #
>  #  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved. 
> +#  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>  #
>  #  This program and the accompanying materials  #  are licensed and made
> available under the terms and conditions of the BSD License @@ -16,7 +17,7
> @@
>INF_VERSION= 0x00010006
>BASE_NAME  = UefiShellInstall1CommandsLib
>FILE_GUID  = D250E364-51C6-49ed-AEBF-6D83F5130F74
> -  MODULE_TYPE= UEFI_DRIVER
> +  MODULE_TYPE= UEFI_APPLICATION
>VERSION_STRING = 1.0
>LIBRARY_CLASS  = NULL|UEFI_APPLICATION UEFI_DRIVER
>CONSTRUCTOR= ShellInstall1CommandsLibConstructor
> --
> 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Simple Textoutput is not working

2015-12-18 Thread Carsey, Jaben
I do not have experience with that platform and I normally test with UEFI Shell 
(UEFI not EDK/EFI) and HelloWorld.  I am sorry I cant be more helpful.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Daniel
> Sent: Thursday, December 17, 2015 11:19 PM
> To: edk2-de...@ml01.01.org
> Subject: Re: [edk2] Simple Textoutput is not working
> Importance: High
> 
> Carsey, Jaben  intel.com> writes:
> 
> >
> > For a really simple experiment.  If you run the HelloWorld app that is in
> MdeModulePkg, does it's print out work?
> >
> > -Jaben
> >
> Thanks for your reply.
> 
> I will give you a little bit more information. I'm compiling using Visual
> Studio 2013. I start my application using the PXE-Protokoll. I tried the
> ipxe and grub2 applications and they worked. I tried to start the HelloWorld
> there whas no output. I tried to start my application using the
> EFI-Shell.efi it didn't work. I tried your "myprintf" it didn't work.
> The System i was testing is a Fujitsu Lifebook E Series 64-Bit architektur.
> Today i will try to start the application on other Hardware (32-Bit &
> 64-Bit). Do you have other suggestions?
> 
> Kind regards
> Daniel
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Simple Textoutput is not working

2015-12-17 Thread Carsey, Jaben
For a really simple experiment.  If you run the HelloWorld app that is in 
MdeModulePkg, does it's print out work?

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Mahan, Patrick
> Sent: Thursday, December 17, 2015 11:30 AM
> To: bowser-dan...@web.de; edk2-devel@lists.01.org
> Subject: Re: [edk2] Simple Textoutput is not working
> 
> I am seeing something similar when using UEFI on a Dell T100 II.  From my UEFI
> driver I do the following:
> 
> VOID
> EFIAPI
> myprintf(IN CONST CHAR8 *format, ...)
> {
> CHAR16MyBuff[512];
> VA_LISTMarker;
> 
> VA_START(Marker, format);
> UnicodeVSPrintAsciiFormat(MyBuff, sizeof(MyBuff), format, Marker);
> VA_END(Marker);
> 
> gST->ConOut->OutputString(gST->ConOut, MyBuff);
> }
> 
> I am seeing the literal string in the format, but nothing else.  For example:
> 
> myprintf("Enter function a1\n");
> 
> prints "Enter function a1", but
> 
> myprintf("Enter function %a\n", __FUNCTION__);
> 
> prints "Enter function ".
> 
> I am building on Ubuntu 14.04 using the GCC 4.8 toolchain.  I finally realized
> this last night where I thought I was
> seeing incorrect PCI config values (the integer formats: %d and %x just print
> 0's).
> 
> So I am also interested in how to make this work correctly.
> 
> Patrick Mahan
> Cavium, Inc.
> 
> From: edk2-devel  on behalf of bowser-
> dan...@web.de 
> Sent: Thursday, December 17, 2015 6:44 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Simple Textoutput is not working
> 
> Hello everyone,
> 
> I have a problem regarding the output to the console using the EDK. When the
> EFI Systems loads my application I can't see any output. I tryed to change the
> output mode to texmode but it didn't work out. Can anyone help me?
> Following the code:
> 
> #include <../../EdkCompatibilityPkg/Foundation/Protocol/ConsoleControl
> ConsoleControl.h>
> EFI_STATUS EFIAPI UefiMain(IN EFI_HANDLEImageHandle,IN
> EFI_SYSTEM_TABLE  *SystemTable)
> {
> efi_image_handle = ImageHandle;
> efi_system_table = SystemTable;
> efi_boot_servic = SystemTable->BootServices;
> 
> EFI_GUID consol_control_guid =
> EFI_CONSOLE_CONTROL_PROTOCOL_GUID;
> 
> //Locate Protocol
> EFI_CONSOLE_CONTROL_PROTOCOL *console_control = NULL;
> status = efi_boot_servic->LocateProtocol(&consol_control_guid, NULL,
> (void**)&console_control);
> 
> 
> efi_system_table->ConOut->EnableCursor(efi_system_table->ConOut,
> TRUE);
> 
> status = console_control->SetMode(console_control,
> EfiConsoleControlScreenText);
> //I tried to reset the output but it didn't work out
> //efi_system_table->ConOut->Reset(efi_system_table->ConOut, TRUE);
> 
> AsciiPrint("status : %x\n", status);
> efi_system_table->ConOut->OutputString(efi_system_table->ConOut,
> L"Test\n");
> Print(L"test2\n");
> }
> 
> 
> 
> Kind regards
> Daniel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] Help in testing PCIe driver from UEFI shell

2015-12-16 Thread Carsey, Jaben
I think that you need to debug your DriverBinding.Start() and 
DriverBinding.Supported() APIs.  Those are what gets called in your driver when 
'connect' shell command it used.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Mahan, Patrick
> Sent: Wednesday, December 16, 2015 12:24 PM
> To: edk2-devel@lists.01.org
> Subject: [edk2] Help in testing PCIe driver from UEFI shell
> Importance: High
> 
> All,
> 
> I am looking for information on how to test our PCIe DXE driver for our NIC on
> Intel.  I am building from the latest EDK2
> sources using gcc v4.8 on Ubuntu.
> 
> The 'ver' command from the UEFI shell gives -
> 
> EFI Specification Revision : 2.10
> EFI Vendor  : Dell
> EFI Revision: 520.1
> 
> I have created a EDK2 package as per the instuctions in section 30 of the UEFI
> Driver Writer's Guide and have created
> a .efi file that I then copy to the FAT-32 partition used for EFI
> (/boot/efi/EFI/ubuntu).
> 
> I can load the driver successfully, print statements embedded show the
> driver's entry point is properly called.
> 
> However, when attempting to connect it is showing 0 for the PCI device which
> looks very suspicious to me.
> 
> Also, the shell 'pci' command does not show the NIC card, but if I boot into
> Ubuntu, lspci shows the card just fine
> which leads me to suspect that the PCI bus is not being scanned.
> 
> I've been googling around for a day now and cannot find any tutorials,
> examples or notes by anyone on how to
> address this issue, so I anyone has some pointers to give, I would appreciate 
> it
> greatly (with your favorite beverage
> if you wish :-) ).
> 
> Most of our initial work was done on our company's AARCH64 platform for
> which I simply included the driver's .inf
> into the platform .dsc and .fdf files and it is working there.  I would like 
> to
> move over to the Intel platform and test
> there for further validation.
> 
> Thanks for any pointers,
> 
> Patrick Mahan
> Cavium, Inc.
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Fix unhandled value in switch statement

2015-12-16 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Wednesday, December 16, 2015 5:30 AM
> To: Alcantara, Paulo 
> Cc: edk2-devel@lists.01.org; Carsey, Jaben ; Qiu,
> Shumin 
> Subject: Re: [edk2] [PATCH] ShellPkg: Fix unhandled value in switch statement
> Importance: High
> 
> On 16 December 2015 at 13:08, Alcantara, Paulo
>  wrote:
> > This patch fixes the following compile error under GCC 5.3.1:
> >
> > /home/pcacjr/work/edk2.git/ShellPkg/Application/Shell/ShellManParser.c:
> > In function 'IsTitleHeader':
> >
> /home/pcacjr/work/edk2.git/ShellPkg/Application/Shell/ShellManParser.c:50
> 2:5:
> > error: enumeration value 'Final' not handled in switch [-Werror=switch]
> >  switch (State) {
> >  ^
> > cc1: all warnings being treated as errors
> > GNUmakefile:457: recipe for target
> >
> '/home/pcacjr/work/edk2.git/Build/OvmfX64/DEBUG_GCC49/X64/ShellPkg/A
> pplication/Shell/Shell/OUTPUT/ShellManParser.obj'
> > failed
> > make: ***
> >
> [/home/pcacjr/work/edk2.git/Build/OvmfX64/DEBUG_GCC49/X64/ShellPkg/A
> pplication/Shell/Shell/OUTPUT/ShellManParser.obj]
> > Error 1
> >
> > Cc: Jaben Carsey 
> > Cc: Shumin Qiu 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Paulo Alcantara 
> 
> Acked-by: Ard Biesheuvel 
> 
> Please apply asap.
> 
> 
> > ---
> >  ShellPkg/Application/Shell/ShellManParser.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/ShellPkg/Application/Shell/ShellManParser.c
> b/ShellPkg/Application/Shell/ShellManParser.c
> > index ce471cf..2c66a20 100644
> > --- a/ShellPkg/Application/Shell/ShellManParser.c
> > +++ b/ShellPkg/Application/Shell/ShellManParser.c
> > @@ -564,6 +564,8 @@ IsTitleHeader(
> >  Line++;
> >break;
> >
> > +  default:
> > +   ;
> >  }
> >
> >} while (State < Final);
> > --
> > 2.6.4
> >
> > ___
> > edk2-devel mailing list
> > edk2-devel@lists.01.org
> > https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Fix the 'bcfg' command ASSERT when use some invalid parameters.

2015-12-15 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Qiu
> Shumin
> Sent: Monday, December 14, 2015 11:55 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [edk2] [PATCH] ShellPkg: Fix the 'bcfg' command ASSERT when use
> some invalid parameters.
> Importance: High
> 
> 'bcfg boot mv xx yy' command will ASSET when xx is larger than the count of
> boot options.
> This patch correct the order of ShellPrintHiiEx parameters to fix the bugs.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c | 4
> ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> index 055..142504a 100644
> --- a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> +++
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.c
> @@ -2,7 +2,7 @@
>Main file for BCFG command.
> 
>(C) Copyright 2014-2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.
> +  Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -1379,7 +1379,7 @@ ShellCommandRunBcfg (
>  Status = ShellConvertStringToUint64(CurrentParam, &Intermediate,
> TRUE, FALSE);
>  CurrentOperation.Number1 = (UINT16)Intermediate;
>  if (CurrentOperation.Number1 >= Count){
> -  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_BCFG_NUMB_RANGE), L"bcfg", gShellBcfgHiiHandle, Count);
> +  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN
> (STR_BCFG_NUMB_RANGE), gShellBcfgHiiHandle, L"bcfg", Count);
>ShellStatus = SHELL_INVALID_PARAMETER;
>  } else {
>CurrentParam = ShellCommandLineGetRawValue(Package,
> ++ParamNumber);
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Use %p for smbiosview SMBIOS table addresses

2015-12-14 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hpe.com]
> Sent: Monday, December 14, 2015 4:28 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben ;
> Samer El-Haj-Mahmoud ; Samer El-Haj-
> Mahmoud 
> Subject: [PATCH] ShellPkg: Use %p for smbiosview SMBIOS table addresses
> Importance: High
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Samer El-Haj-Mahmoud 
> ---
>  .../UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewStrings.uni  | 5
> +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni
> index 24fca87..9811542 100644
> ---
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni
> @@ -2,6 +2,7 @@
>  //
>  // Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
>  // (C) Copyright 2014-2015 Hewlett-Packard Development Company,
> L.P.
> +// (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>  // This program and the accompanying materials
>  // are licensed and made available under the terms and conditions of the BSD
> License
>  // which accompanies this distribution. The full text of the license may be
> found at
> @@ -78,7 +79,7 @@
>  #string STR_SMBIOSVIEW_PRINTINFO_DOCREV #language 
> en-US
> "SMBIOS Docrev:0x%x\r\n"
>  #string STR_SMBIOSVIEW_PRINTINFO_NUMBER_STRUCT  #language
> en-US "Number of Structures: %d\r\n"
>  #string STR_SMBIOSVIEW_PRINTINFO_MAX_STRUCT_SIZE#language
> en-US "Max Struct size:  %d\r\n"
> -#string STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR #language en-
> US "Table Address:0x%x\r\n"
> +#string STR_SMBIOSVIEW_PRINTINFO_TABLE_ADDR #language
> en-US "Table Address:0x%p\r\n"
>  #string STR_SMBIOSVIEW_PRINTINFO_TABLE_LENGTH   #language
> en-US "Table Length: %d\r\n"
>  #string STR_SMBIOSVIEW_PRINTINFO_TABLE_MAX_SIZE #language
> en-US "Table Max Size:   %d\r\n"
>  #string STR_SMBIOSVIEW_PRINTINFO_ANCHOR_STR #language
> en-US "Anchor String:%a\r\n"
> @@ -452,7 +453,7 @@
>  #string STR_SMBIOSVIEW_SMBIOSVIEW_SHOWTYPE  #language
> en-US "ShowType= "
>  #string STR_SMBIOSVIEW_SMBIOSVIEW_TYPE_HANDLE_DUMP_STRUCT
> #language en-US "Type=%d, Handle=0x%x\r\nDump Structure as:\r\n"
>  #string STR_SMBIOSVIEW_SMBIOSVIEW_INDEX_LENGTH  #language
> en-US "Index=%d,Length=0x%x,"
> -#string STR_SMBIOSVIEW_SMBIOSVIEW_ADDR  #language en-
> US "Addr=0x%x\r\n"
> +#string STR_SMBIOSVIEW_SMBIOSVIEW_ADDR  #language en-
> US "Addr=0x%p\r\n"
>  #string STR_SMBIOSVIEW_SMBIOSVIEW_ENTRYLEN  #language en-
> US "Entry Length: 0x%x\r\n"
>  #string STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDHANDLE
> #language en-US "Referenced Handle: 0x%x\r\n"
>  #string STR_SMBIOSVIEW_SMBIOSVIEW_REFERENCEDOFFSET
> #language en-US "Referenced Offset: 0x%x\r\n"
> --
> 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Fix a bug in smbiosview PowerSupply Characteristics

2015-12-14 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Samer El-Haj-Mahmoud [mailto:samer.el-haj-mahm...@hpe.com]
> Sent: Monday, December 14, 2015 4:24 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben ;
> Samer El-Haj-Mahmoud ; Samer El-Haj-
> Mahmoud 
> Subject: [PATCH] ShellPkg: Fix a bug in smbiosview PowerSupply
> Characteristics
> Importance: High
> 
> Fix bit shifting when isolating the Characteristics of Power Supply
> information
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Samer El-Haj-Mahmoud 
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c | 6
> +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> index e348c6f..3f99dc4 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> +++
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/PrintInfo.c
> @@ -3100,7 +3100,7 @@ DisplaySPSCharacteristics (
>// Bits 13:10 - DMTF Power Supply Type
>//
>ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_TYPE), gShellDebug1HiiHandle);
> -  Temp = (Characteristics & 0x1C00) << 10;
> +  Temp = (Characteristics & 0x1C00) >> 10;
>switch (Temp) {
>case 1:
>  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
> @@ -3141,7 +3141,7 @@ DisplaySPSCharacteristics (
>// Bits 9:7 - Status
>//
>ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_STATUS_DASH), gShellDebug1HiiHandle);
> -  Temp = (Characteristics & 0x380) << 7;
> +  Temp = (Characteristics & 0x380) >> 7;
>switch (Temp) {
>case 1:
>  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
> @@ -3170,7 +3170,7 @@ DisplaySPSCharacteristics (
>// Bits 6:3 - DMTF Input Voltage Range Switching
>//
>ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_INPUT_VOLTAGE_RANGE),
> gShellDebug1HiiHandle);
> -  Temp = (Characteristics & 0x78) << 3;
> +  Temp = (Characteristics & 0x78) >> 3;
>switch (Temp) {
>case 1:
>  ShellPrintHiiEx(-1,-1,NULL,STRING_TOKEN
> (STR_SMBIOSVIEW_PRINTINFO_OTHER_SPACE), gShellDebug1HiiHandle);
> --
> 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg Ease MAN file Title Header syntax requirements

2015-12-14 Thread Carsey, Jaben
Looks good to me.

Shumin, 
If it looks good to you, can you also commit?

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> jim_dai...@dell.com
> Sent: Monday, December 14, 2015 11:44 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: [edk2] [PATCH] ShellPkg Ease MAN file Title Header syntax
> requirements
> Importance: High
> 
> ShellPkg: Ease the shell's MAN file Title Header syntax requirements.
> 
> Prior to this change, the shell would not use a MAN file if the
> Title Header line was not strictly formatted.  For example, if the
> case of the command name in the file was not exactly the same as the
> case of the command name as typed by the user, the MAN file would
> not be used.  Also, extra whitespace on the line would also cause the
> shell to ignore the MAN file.  This change allows "extra" white space
> and ignores case when looking for the command name.  It also ignores
> any path information for cases where the user enters a relative or
> absolute path to the EFI file.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jim Dailey 
> 
> diff --git a/trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c
> b/trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c
> --- a/trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c  (revision
> 19175)
> +++ b/trunk/edk2/ShellPkg/Application/Shell/ShellManParser.c
>   (working copy)
> @@ -2,6 +2,7 @@
>Provides interface to shell MAN file parser.
> 
>Copyright (c) 2009 - 2015, Intel Corporation. All rights reserved.
> +  Copyright 2015 Dell Inc.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -14,6 +15,8 @@
> 
>  #include "Shell.h"
> 
> +CHAR16 EFIAPI InternalShellCharToUpper (IN CHAR16  Char);
> +
>  /**
>Verifies that the filename has .MAN on the end.
> 
> @@ -445,14 +448,141 @@
>  }
> 
>  /**
> +  Parses a line from a MAN file to see if it is the Title Header. If it is, 
> then
> +  if the "Brief Description" is desired, allocate a buffer for it and return 
> a
> +  copy. Upon a sucessful return the caller is responsible to free the memory
> in
> +  *BriefDesc
> +
> +  Uses a simple state machine that allows "unlimited" whitespace before and
> after the
> +  ".TH", compares Command and the MAN file commnd name without respect
> to case, and
> +  allows "unlimited" whitespace and '0' and '1' characters before the Short
> Description.
> +  The PCRE regex describing this functionality is:
> ^\s*\.TH\s+(\S)\s[\s01]*(.*)$
> +  where group 1 is the Command Name and group 2 is the Short Description.
> +
> +  @param[in] Command name of command whose MAN file we think
> Line came from
> +  @param[in] LinePointer to a line from the MAN file
> +  @param[out] BriefDesc  pointer to pointer to string where 
> description
> goes.
> +  @param[out] BriefSize  pointer to size of allocated BriefDesc
> +  @param[out] Found  TRUE if the Title Header was found and it
> belongs to Command
> +
> +  @retval TRUE   Line contained the Title Header
> +  @retval FALSE  Line did not contain the Title Header
> +**/
> +BOOLEAN
> +IsTitleHeader(
> +  IN CONST CHAR16   *Command,
> +  IN CHAR16 *Line,
> +  OUT CHAR16**BriefDesc OPTIONAL,
> +  OUT UINTN *BriefSize OPTIONAL,
> +  OUT BOOLEAN   *Found
> +  )
> +{
> +  // The states of a simple state machine used to recognize a title header 
> line
> +  // and to extract the Short Description, if desired.
> +  typedef enum {
> +LookForThMacro, LookForCommandName, CompareCommands,
> GetBriefDescription, Final
> +  } STATEVALUES;
> +
> +  STATEVALUES  State;
> +  UINTNCommandIndex; // Indexes Command as we compare its chars to
> the MAN file.
> +  BOOLEAN  ReturnValue;  // TRUE if this the Title Header line of *some*
> MAN file.
> +  BOOLEAN  ReturnFound;  // TRUE if this the Title Header line of *the
> desired* MAN file.
> +
> +  ReturnValue = FALSE;
> +  ReturnFound = FALSE;
> +  CommandIndex = 0;
> +  State = LookForThMacro;
> +
> +  do {
> +
> +if (*Line == L'\0') {
> +  break;
> +}
> +
> +switch (State) {
> +
> +  // Handle "^\s*.TH\s"
> +  // Go to state LookForCommandName if the title header macr

Re: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

2015-12-14 Thread Carsey, Jaben
Looks good.  Thanks!

> -Original Message-
> From: Kinney, Michael D
> Sent: Monday, December 14, 2015 10:14 AM
> To: Carsey, Jaben ; edk2-devel@lists.01.org; Kinney,
> Michael D 
> Cc: Ni, Ruiyu 
> Subject: RE: [Patch] ShellPkg/Mm: Fix build warnings
> Importance: High
> 
> Jaben,
> 
> Eric Tian made the commit.  Can you please verify that it was rebased 
> correctly.
> 
> Thanks,
> 
> Mike
> 
> > -Original Message-
> > From: Carsey, Jaben
> > Sent: Monday, December 14, 2015 8:12 AM
> > To: Kinney, Michael D ; edk2-
> > de...@lists.01.org
> > Cc: Ni, Ruiyu ; Carsey, Jaben
> > 
> > Subject: RE: [Patch] ShellPkg/Mm: Fix build warnings
> >
> > Mike,
> >
> > Your second patch needs to be rebased.  This is changing some of
> > the lines that were changed with the most recent patch to this
> > file.
> >
> > -Jaben
> >
> > > -Original Message-
> > > From: Kinney, Michael D
> > > Sent: Saturday, December 12, 2015 1:50 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Ni, Ruiyu ; Carsey, Jaben
> > 
> > > Subject: [Patch] ShellPkg/Mm: Fix build warnings
> > > Importance: High
> > >
> > > Fix build warnings for potentially uninitialized local
> > variables
> > > in the functions ShellMmLocateIoProtocol() and
> > ShellCommandRunMm()
> > > in the Shell implementation of the 'mm' command.
> > >
> > > Cc: Ruiyu Ni 
> > > Cc: Jaben Carsey 
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Michael Kinney 
> > > ---
> > >  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24
> > +-
> > > --
> > >  1 file changed, 13 insertions(+), 11 deletions(-)
> > >
> > > diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > index 3f08cc8..1e2c0cb 100644
> > > --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> > > @@ -328,6 +328,8 @@ ShellMmLocateIoProtocol (
> > >  return FALSE;
> > >}
> > >
> > > +  Segment = 0;
> > > +  Bus = 0;
> > >if ((AccessType == ShellMmPci) || (AccessType ==
> > ShellMmPciExpress)) {
> > >  ShellMmDecodePciAddress ((BOOLEAN) (AccessType ==
> > ShellMmPci),
> > > Address, &Segment, &Bus, NULL, NULL, NULL);
> > >}
> > > @@ -614,18 +616,18 @@ ShellCommandRunMm (
> > >  // skip space characters
> > >  //
> > >  for (Index = 0; InputStr[Index] == ' '; Index++);
> > > -  }
> > >
> > > -  if ((InputStr != NULL) && (InputStr[Index] !=
> > CHAR_NULL)) {
> > > -if ((InputStr[Index] == '.') || (InputStr[Index] ==
> > 'q') || (InputStr[Index] ==
> > > 'Q')) {
> > > -  Complete = TRUE;
> > > -} else if (!EFI_ERROR (ShellConvertStringToUint64
> > (InputStr + Index,
> > > &Buffer, TRUE, TRUE)) &&
> > > -   (Buffer <= mShellMmMaxNumber[Size])
> > > -   ) {
> > > -  ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo,
> > FALSE, Address,
> > > Size, &Buffer);
> > > -} else {
> > > -  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> > (STR_MM_ERROR),
> > > gShellDebug1HiiHandle, L"mm");
> > > -  continue;
> > > +if ((InputStr[Index] != CHAR_NULL)) {
> > > +  if ((InputStr[Index] == '.') || (InputStr[Index] ==
> > 'q') || (InputStr[Index]
> > > == 'Q')) {
> > > +Complete = TRUE;
> > > +  } else if (!EFI_ERROR (ShellConvertStringToUint64
> > (InputStr + Index,
> > > &Buffer, TRUE, TRUE)) &&
> > > + (Buffer <= mShellMmMaxNumber[Size])
> > > + ) {
> > > +ShellMmAccess (AccessType, PciRootBridgeIo,
> > CpuIo, FALSE, Address,
> > > Size, &Buffer);
> > > +  } else {
> > > +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> > (STR_MM_ERROR),
> > > gShellDebug1HiiHandle, L"mm");
> > > +continue;
> > > +  }
> > >  }
> > >}
> > >
> > > --
> > > 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] ShellPkg/Mm: Fix build warnings

2015-12-14 Thread Carsey, Jaben
Mike,

Your second patch needs to be rebased.  This is changing some of the lines that 
were changed with the most recent patch to this file.

-Jaben

> -Original Message-
> From: Kinney, Michael D
> Sent: Saturday, December 12, 2015 1:50 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Carsey, Jaben 
> Subject: [Patch] ShellPkg/Mm: Fix build warnings
> Importance: High
> 
> Fix build warnings for potentially uninitialized local variables
> in the functions ShellMmLocateIoProtocol() and ShellCommandRunMm()
> in the Shell implementation of the 'mm' command.
> 
> Cc: Ruiyu Ni 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael Kinney 
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c | 24 +-
> --
>  1 file changed, 13 insertions(+), 11 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> index 3f08cc8..1e2c0cb 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> @@ -328,6 +328,8 @@ ShellMmLocateIoProtocol (
>  return FALSE;
>}
> 
> +  Segment = 0;
> +  Bus = 0;
>if ((AccessType == ShellMmPci) || (AccessType == ShellMmPciExpress)) {
>  ShellMmDecodePciAddress ((BOOLEAN) (AccessType == ShellMmPci),
> Address, &Segment, &Bus, NULL, NULL, NULL);
>}
> @@ -614,18 +616,18 @@ ShellCommandRunMm (
>  // skip space characters
>  //
>  for (Index = 0; InputStr[Index] == ' '; Index++);
> -  }
> 
> -  if ((InputStr != NULL) && (InputStr[Index] != CHAR_NULL)) {
> -if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || 
> (InputStr[Index] ==
> 'Q')) {
> -  Complete = TRUE;
> -} else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + Index,
> &Buffer, TRUE, TRUE)) &&
> -   (Buffer <= mShellMmMaxNumber[Size])
> -   ) {
> -  ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, Address,
> Size, &Buffer);
> -} else {
> -  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR),
> gShellDebug1HiiHandle, L"mm");
> -  continue;
> +if ((InputStr[Index] != CHAR_NULL)) {
> +  if ((InputStr[Index] == '.') || (InputStr[Index] == 'q') || 
> (InputStr[Index]
> == 'Q')) {
> +Complete = TRUE;
> +  } else if (!EFI_ERROR (ShellConvertStringToUint64 (InputStr + 
> Index,
> &Buffer, TRUE, TRUE)) &&
> + (Buffer <= mShellMmMaxNumber[Size])
> + ) {
> +ShellMmAccess (AccessType, PciRootBridgeIo, CpuIo, FALSE, 
> Address,
> Size, &Buffer);
> +  } else {
> +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_MM_ERROR),
> gShellDebug1HiiHandle, L"mm");
> +continue;
> +  }
>  }
>}
> 
> --
> 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg/Shell - Fix ASSERT() when FvSimpleFileSystemDxe is used

2015-12-11 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Kinney, Michael D
> Sent: Friday, December 11, 2015 1:24 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: [PATCH] ShellPkg/Shell - Fix ASSERT() when FvSimpleFileSystemDxe is
> used
> Importance: High
> 
> When the FvSimpleFileSystemDxe module is included in a platform,
> Simple File System Protocols are produced for firmware volumes(FV)
> that do not have the same style device paths as file systems with
> file names.  The ShellPkg has an assumption that the device path
> contains device path nodes of type MEDIA_FILEPATH_DP and generates
> an ASSERT() if any other device path nodes are encountered.  This
> change removes the ASSERT() condition and instead returns NULL that
> means EfiShellGetFilePathFromDevicePath() can not convert the
> device path nodes that represent the file path to a Unicode string.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Michael Kinney 
> ---
>  ShellPkg/Application/Shell/ShellProtocol.c | 51 +++--
> -
>  1 file changed, 25 insertions(+), 26 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/ShellProtocol.c
> b/ShellPkg/Application/Shell/ShellProtocol.c
> index 9c370cc..def3bd3 100644
> --- a/ShellPkg/Application/Shell/ShellProtocol.c
> +++ b/ShellPkg/Application/Shell/ShellProtocol.c
> @@ -449,38 +449,37 @@ EfiShellGetFilePathFromDevicePath(
>; FilePath = (FILEPATH_DEVICE_PATH*)NextDevicePathNode (&FilePath-
> >Header)
>   ){
>  //
> -// all the rest should be file path nodes
> +// If any node is not a file path node, then the conversion can not 
> be
> completed
>  //
>  if ((DevicePathType(&FilePath->Header) != MEDIA_DEVICE_PATH) ||
>  (DevicePathSubType(&FilePath->Header) != MEDIA_FILEPATH_DP)) {
>FreePool(PathForReturn);
> -  PathForReturn = NULL;
> -  ASSERT(FALSE);
> -} else {
> -  //
> -  // append the path part onto the filepath.
> -  //
> -  ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn
> != NULL));
> -
> -  AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath),
> FilePath);
> -  ASSERT (AlignedNode != NULL);
> -
> -  // File Path Device Path Nodes 'can optionally add a "\" separator 
> to
> -  //  the beginning and/or the end of the Path Name string.'
> -  // (UEFI Spec 2.4 section 9.3.6.4).
> -  // If necessary, add a "\", but otherwise don't
> -  // (This is specified in the above section, and also implied by the
> -  //  UEFI Shell spec section 3.7)
> -  if ((PathSize != 0)&&
> -  (PathForReturn != NULL)&&
> -  (PathForReturn[PathSize - 1] != L'\\') &&
> -  (AlignedNode->PathName[0]!= L'\\')) {
> -PathForReturn = StrnCatGrow (&PathForReturn, &PathSize, L"\\", 
> 1);
> -  }
> +  return NULL;
> +}
> 
> -  PathForReturn = StrnCatGrow(&PathForReturn, &PathSize,
> AlignedNode->PathName, 0);
> -  FreePool(AlignedNode);
> +//
> +// append the path part onto the filepath.
> +//
> +ASSERT((PathForReturn == NULL && PathSize == 0) || (PathForReturn !=
> NULL));
> +
> +AlignedNode = AllocateCopyPool (DevicePathNodeLength(FilePath),
> FilePath);
> +ASSERT (AlignedNode != NULL);
> +
> +// File Path Device Path Nodes 'can optionally add a "\" separator to
> +//  the beginning and/or the end of the Path Name string.'
> +// (UEFI Spec 2.4 section 9.3.6.4).
> +// If necessary, add a "\", but otherwise don't
> +// (This is specified in the above section, and also implied by the
> +//  UEFI Shell spec section 3.7)
> +if ((PathSize != 0)&&
> +(PathForReturn != NULL)&&
> +(PathForReturn[PathSize - 1] != L'\\') &&
> +(AlignedNode->PathName[0]!= L'\\')) {
> +  PathForReturn = StrnCatGrow (&PathForReturn, &PathSize, L"\\", 1);
>  }
> +
> +PathForReturn = StrnCatGrow(&PathForReturn, &PathSize,
> AlignedNode->PathName, 0);
> +FreePool(AlignedNode);
>} // for loop of remaining nodes
>  }
>  if (PathForReturn != NULL) {
> --
> 2.6.3.windows.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Make 'dh' support showing all spec defined protocols.

2015-12-04 Thread Carsey, Jaben
I am the author.  Shumin did some final verification and fixed a bug and then 
sent out for review.

> -Original Message-
> From: Justen, Jordan L
> Sent: Friday, December 04, 2015 4:11 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Qiu, Shumin
> 
> Subject: [PATCH] ShellPkg: Make 'dh' support showing all spec defined
> protocols.
> Importance: High
> 
> From: Qiu Shumin 
> 
> When using 'dh' to dump all protocols installed on a handle, some of
> them are shown as 'UnknownDevice'.
> 
> Device patch make 'dh' support all spec defined protocols.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jaben Carsey 
> Reviewed-by: Qiu Shumin 
> Reviewed-by: Ruiyu Ni 
> Reviewed-by: Samer El-Haj-Mahmoud 
> ---
> 
>  Here is the patch with a diff after converting the .uni to utf-8.
> 
>  Who is the author of this patch? Qui or Jaben?
> 
>  .../UefiHandleParsingLib/UefiHandleParsingLib.c| 123
> +
>  .../UefiHandleParsingLib/UefiHandleParsingLib.inf  | 115
> +++
>  .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | 116
> +++
>  3 files changed, 354 insertions(+)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> index b211de7..6f093ff 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> @@ -1026,6 +1026,124 @@ STATIC CONST GUID_INFO_BLOCK
> mGuidStringList[] = {
>{STRING_TOKEN(STR_DISK_INFO), &gEfiDiskInfoProtocolGuid,
> NULL},
> 
>  //
> +// PI Spec 1.0
> +//
> +  {STRING_TOKEN(STR_BDS_ARCH),  &gEfiBdsArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_CPU_ARCH),  &gEfiCpuArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_MET_ARCH),
> &gEfiMetronomeArchProtocolGuid,   NULL},
> +  {STRING_TOKEN(STR_MON_ARCH),
> &gEfiMonotonicCounterArchProtocolGuid,NULL},
> +  {STRING_TOKEN(STR_RTC_ARCH),
> &gEfiRealTimeClockArchProtocolGuid,   NULL},
> +  {STRING_TOKEN(STR_RESET_ARCH),&gEfiResetArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_RT_ARCH),   &gEfiRuntimeArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_SEC_ARCH),  &gEfiSecurityArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_TIMER_ARCH),&gEfiTimerArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_VAR_ARCH),
> &gEfiVariableWriteArchProtocolGuid,   NULL},
> +  {STRING_TOKEN(STR_V_ARCH),&gEfiVariableArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_SECP),  &gEfiSecurityPolicyProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_WDT_ARCH),
> &gEfiWatchdogTimerArchProtocolGuid,   NULL},
> +  {STRING_TOKEN(STR_SCR),   
> &gEfiStatusCodeRuntimeProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_SMB_HC),&gEfiSmbusHcProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_FV_2),  &gEfiFirmwareVolume2ProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_FV_BLOCK),
> &gEfiFirmwareVolumeBlockProtocolGuid, NULL},
> +  {STRING_TOKEN(STR_CAP_ARCH),  &gEfiCapsuleArchProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_MP_SERVICE),&gEfiMpServiceProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_HBRAP),
> &gEfiPciHostBridgeResourceAllocationProtocolGuid, NULL},
> +  {STRING_TOKEN(STR_PCIP),  &gEfiPciPlatformProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_PCIO),  &gEfiPciOverrideProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_PCIE),
> &gEfiPciEnumerationCompleteProtocolGuid,  NULL},
> +  {STRING_TOKEN(STR_IPCID),
> &gEfiIncompatiblePciDeviceSupportProtocolGuid,NULL},
> +  {STRING_TOKEN(STR_PCIHPI),&gEfiPciHotPlugInitProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_PCIHPR),
> &gEfiPciHotPlugRequestProtocolGuid,   NULL},
> +  {STRING_TOKEN(STR_SMBIOS),&gEfiSmbiosProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_S3_SAVE),   &gEfiS3SaveStateProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_S3_S_SMM),
> &gEfiS3SmmSaveStateProtocolGuid,  NULL},
> +  {STRING_TOKEN(STR_RSC),   &gEfiRscHandlerProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_S_RSC), &gEfiSmmRscHandlerProtocolGuid,
> NULL},
> +  {STRING_TOKEN(STR_ACPI_SDT),  &gEfiAcpiSdtProtocolGuid,
>

Re: [edk2] [PATCH v2 17/20] ShellPkg: Convert all .uni files to utf-8

2015-12-04 Thread Carsey, Jaben
Agreed. that works fine too... 

> -Original Message-
> From: Justen, Jordan L
> Sent: Friday, December 04, 2015 2:14 PM
> To: Carsey, Jaben ; edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> 
> Subject: RE: [PATCH v2 17/20] ShellPkg: Convert all .uni files to utf-8
> Importance: High
> 
> On 2015-12-04 13:16:34, Carsey, Jaben wrote:
> > There is a large change outstanding that was reviewed, but not yet
> > committed for updating DH to display additional protocols. Can you
> > commit that before this change?
> 
> How about we do the opposite? Commit this one first, and then rebase
> that patch. This would let us actually see the diff of that change in
> source control.
> 
> I'd be willing to do the rebase for that patch.
> 
> -Jordan
> 
> >
> > If yes,
> >
> > Reviewed-by: Jaben Carsey 
> >
> > > -Original Message-
> > > From: Justen, Jordan L
> > > Sent: Friday, December 04, 2015 12:14 PM
> > > To: edk2-devel@lists.01.org
> > > Cc: Justen, Jordan L ; Carsey, Jaben
> > > ; Qiu, Shumin 
> > > Subject: [PATCH v2 17/20] ShellPkg: Convert all .uni files to utf-8
> > > Importance: High
> > >
> > > To convert these files I ran:
> > >
> > > $ python3 BaseTools/Scripts/ConvertUni.py ShellPkg
> > >
> > > Cc: Jaben Carsey 
> > > Cc: Shumin Qiu 
> > > Contributed-under: TianoCore Contribution Agreement 1.0
> > > Signed-off-by: Jordan Justen 
> > > ---
> > >  ShellPkg/Application/Shell/Shell.uni   | Bin 4840 -> 2419 
> > > bytes
> > >  ShellPkg/Library/UefiDpLib/UefiDpLib.uni   | Bin 18146 -> 9072 
> > > bytes
> > >  .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | Bin 32404 -> 16201
> > > bytes
> > >  .../UefiShellBcfgCommandLib.uni| Bin 18414 -> 9206 
> > > bytes
> > >  .../Edit/TextEditStrings.uni   | Bin 11484 -> 5741 
> > > bytes
> > >  .../HexEdit/HexeditStrings.uni | Bin 13156 -> 6577 
> > > bytes
> > >  .../SmbiosView/SmbiosViewStrings.uni   | Bin 109944 -> 54971
> bytes
> > >  .../UefiShellDebug1CommandsLib.uni | Bin 140676 -> 70337
> bytes
> > >  .../UefiShellDriver1CommandsLib.uni| Bin 70806 -> 35402 
> > > bytes
> > >  .../UefiShellLevel1CommandsLib.uni | Bin 43930 -> 21964 
> > > bytes
> > >  .../UefiShellLevel2CommandsLib.uni | Bin 109742 -> 54870
> bytes
> > >  .../UefiShellLevel3CommandsLib.uni | Bin 44956 -> 22477 
> > > bytes
> > >  .../UefiShellNetwork1CommandsLib.uni   | Bin 21094 -> 10546
> bytes
> > >  .../UefiShellTftpCommandLib.uni| Bin 9952 -> 4975 
> > > bytes
> > >  14 files changed, 0 insertions(+), 0 deletions(-)
> > >
> > > diff --git a/ShellPkg/Application/Shell/Shell.uni
> > > b/ShellPkg/Application/Shell/Shell.uni
> > > index 25cf699..301d879 100644
> > > Binary files a/ShellPkg/Application/Shell/Shell.uni and
> > > b/ShellPkg/Application/Shell/Shell.uni differ
> > > diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.uni
> > > b/ShellPkg/Library/UefiDpLib/UefiDpLib.uni
> > > index 5bcb496..b092274 100644
> > > Binary files a/ShellPkg/Library/UefiDpLib/UefiDpLib.uni and
> > > b/ShellPkg/Library/UefiDpLib/UefiDpLib.uni differ
> > > diff --git
> a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > > b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > > index d8e45d0..1d142e9 100644
> > > Binary files
> a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> > > and b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> differ
> > > diff --git
> > >
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> > >
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> > > index d34f314..b680a48 100644
> > > Binary files
> > >
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> > > and
> > >
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> > > differ
> > > diff --git
> > > a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni
> > > b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.un

Re: [edk2] [PATCH v2 17/20] ShellPkg: Convert all .uni files to utf-8

2015-12-04 Thread Carsey, Jaben
There is a large change outstanding that was reviewed, but not yet committed 
for updating DH to display additional protocols.  Can you commit that before 
this change?

If yes,

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Justen, Jordan L
> Sent: Friday, December 04, 2015 12:14 PM
> To: edk2-devel@lists.01.org
> Cc: Justen, Jordan L ; Carsey, Jaben
> ; Qiu, Shumin 
> Subject: [PATCH v2 17/20] ShellPkg: Convert all .uni files to utf-8
> Importance: High
> 
> To convert these files I ran:
> 
> $ python3 BaseTools/Scripts/ConvertUni.py ShellPkg
> 
> Cc: Jaben Carsey 
> Cc: Shumin Qiu 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jordan Justen 
> ---
>  ShellPkg/Application/Shell/Shell.uni   | Bin 4840 -> 2419 bytes
>  ShellPkg/Library/UefiDpLib/UefiDpLib.uni   | Bin 18146 -> 9072 bytes
>  .../UefiHandleParsingLib/UefiHandleParsingLib.uni  | Bin 32404 -> 16201
> bytes
>  .../UefiShellBcfgCommandLib.uni| Bin 18414 -> 9206 bytes
>  .../Edit/TextEditStrings.uni   | Bin 11484 -> 5741 bytes
>  .../HexEdit/HexeditStrings.uni | Bin 13156 -> 6577 bytes
>  .../SmbiosView/SmbiosViewStrings.uni   | Bin 109944 -> 54971 
> bytes
>  .../UefiShellDebug1CommandsLib.uni | Bin 140676 -> 70337 
> bytes
>  .../UefiShellDriver1CommandsLib.uni| Bin 70806 -> 35402 bytes
>  .../UefiShellLevel1CommandsLib.uni | Bin 43930 -> 21964 bytes
>  .../UefiShellLevel2CommandsLib.uni | Bin 109742 -> 54870 
> bytes
>  .../UefiShellLevel3CommandsLib.uni | Bin 44956 -> 22477 bytes
>  .../UefiShellNetwork1CommandsLib.uni   | Bin 21094 -> 10546 bytes
>  .../UefiShellTftpCommandLib.uni| Bin 9952 -> 4975 bytes
>  14 files changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.uni
> b/ShellPkg/Application/Shell/Shell.uni
> index 25cf699..301d879 100644
> Binary files a/ShellPkg/Application/Shell/Shell.uni and
> b/ShellPkg/Application/Shell/Shell.uni differ
> diff --git a/ShellPkg/Library/UefiDpLib/UefiDpLib.uni
> b/ShellPkg/Library/UefiDpLib/UefiDpLib.uni
> index 5bcb496..b092274 100644
> Binary files a/ShellPkg/Library/UefiDpLib/UefiDpLib.uni and
> b/ShellPkg/Library/UefiDpLib/UefiDpLib.uni differ
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> index d8e45d0..1d142e9 100644
> Binary files a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni
> and b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.uni differ
> diff --git
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> index d34f314..b680a48 100644
> Binary files
> a/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> and
> b/ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.uni
> differ
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni
> index a61cae3..f799148 100644
> Binary files
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni and
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Edit/TextEditStrings.uni
> differ
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni
> index f521931..d9591ca 100644
> Binary files
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni
> and
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/HexEdit/HexeditStrings.uni
> differ
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni
> index f368825..24fca87 100644
> Binary files
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni and
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/SmbiosView/SmbiosViewSt
> rings.uni differ
> diff --git
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Command
> sLib.uni
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Command
> sLib.uni
> index e16175a..1974060 100644
> Binary files
> a/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Command
> sLib.uni and
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1Command
> sLib.uni differ
> diff --git
>

Re: [edk2] [PATCH v2 15/20] PerformancePkg: Convert all .uni files to utf-8

2015-12-04 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Justen, Jordan L
> Sent: Friday, December 04, 2015 12:14 PM
> To: edk2-devel@lists.01.org
> Cc: Justen, Jordan L ; Daryl McDaniel  li...@mc2research.org>; Carsey, Jaben 
> Subject: [PATCH v2 15/20] PerformancePkg: Convert all .uni files to utf-8
> Importance: High
> 
> To convert these files I ran:
> 
> $ python3 BaseTools/Scripts/ConvertUni.py PerformancePkg
> 
> Cc: Daryl McDaniel 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jordan Justen 
> ---
>  PerformancePkg/Dp_App/DpStrings.uni | Bin 38432 -> 19222 bytes
>  1 file changed, 0 insertions(+), 0 deletions(-)
> 
> diff --git a/PerformancePkg/Dp_App/DpStrings.uni
> b/PerformancePkg/Dp_App/DpStrings.uni
> index c4c146f..f368f34 100644
> Binary files a/PerformancePkg/Dp_App/DpStrings.uni and
> b/PerformancePkg/Dp_App/DpStrings.uni differ
> --
> 2.6.2

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] ShellPkg: Fix ifconfig hang issue with incomplete parameters

2015-12-04 Thread Carsey, Jaben
Looks good to me.  I think we should wait for Leekha for up to a few days to 
confirm that this fixes the problem at their location.

Reviewed-by: Jaben Carsey 

-Jaben

> -Original Message-
> From: Wu, Jiaxin
> Sent: Thursday, December 03, 2015 5:27 PM
> To: edk2-devel@lists.01.org
> Cc: Leekha Shaveta ; Carsey, Jaben
> ; Ye, Ting 
> Subject: [Patch] ShellPkg: Fix ifconfig hang issue with incomplete parameters
> Importance: High
> 
> This patch is used to fix ifconfig hang issue with incomplete
> parameters. In addition, some error related output information
> is added to increase the interactivity.
> 
> Cc: Leekha Shaveta 
> Cc: Carsey Jaben 
> Cc: Ye Ting 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> ---
>  .../UefiShellNetwork1CommandsLib/Ifconfig.c|  61 --
> ---
>  .../UefiShellNetwork1CommandsLib.uni   | Bin 21094 -> 21256 bytes
>  2 files changed, 47 insertions(+), 14 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> index fb6f575..f8dbc88 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> @@ -826,10 +826,11 @@ IfConfigClearInterfaceInfo (
>  Ip4Config2DataTypePolicy,
>  sizeof (EFI_IP4_CONFIG2_POLICY),
>  &Policy
>  );
>  if (EFI_ERROR (Status)) {
> +  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellNetwork1HiiHandle, L"ifconfig");
>ShellStatus = SHELL_ACCESS_DENIED;
>break;
>  }
>}
> 
> @@ -902,10 +903,11 @@ IfConfigSetInterfaceInfo (
>NULL,
>NULL,
>&TimeOutEvt
>);
>if (EFI_ERROR (Status)) {
> +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellNetwork1HiiHandle, L"ifconfig");
>  ShellStatus = SHELL_ACCESS_DENIED;
>  goto ON_EXIT;
>}
> 
>Status = gBS->CreateEvent (
> @@ -914,10 +916,11 @@ IfConfigSetInterfaceInfo (
>IfConfigManualAddressNotify,
>&IsAddressOk,
>&MappedEvt
>);
>if (EFI_ERROR (Status)) {
> +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellNetwork1HiiHandle, L"ifconfig");
>  ShellStatus = SHELL_ACCESS_DENIED;
>  goto ON_EXIT;
>}
> 
>//
> @@ -972,10 +975,11 @@ IfConfigSetInterfaceInfo (
>  //
>  if (StrCmp(VarArg->Arg, L"dhcp") == 0) {
>if (IfCb->Policy == Ip4Config2PolicyDhcp) {
>  Status = IfConfigStartIp4 (IfCb->NicHandle, gImageHandle);
>  if (EFI_ERROR(Status)) {
> +  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellNetwork1HiiHandle, L"ifconfig");
>ShellStatus = SHELL_ACCESS_DENIED;
>goto ON_EXIT;
>  }
>} else {
>  //
> @@ -987,74 +991,100 @@ IfConfigSetInterfaceInfo (
>  Ip4Config2DataTypePolicy,
>  sizeof (EFI_IP4_CONFIG2_POLICY),
>  &Policy
>  );
>  if (EFI_ERROR(Status)) {
> +  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_GEN_ERR_AD),
> gShellNetwork1HiiHandle, L"ifconfig");
>ShellStatus = SHELL_ACCESS_DENIED;
>goto ON_EXIT;
>  }
>}
> 
>VarArg= VarArg->Next;
> 
>  } else if (StrCmp (VarArg->Arg, L"static") == 0) {
> -  //
> -  // Set manual config policy.
> -  //
> -  Policy = Ip4Config2PolicyStatic;
> -  Status = IfCb->IfCfg->SetData (
> -  IfCb->IfCfg,
> -  Ip4Config2DataTypePolicy,
> -  sizeof (EFI_IP4_CONFIG2_POLICY),
> -  &Policy
> -  );
> -  if (EFI_ERROR(Status)) {
> -ShellStatus = SHELL_ACCESS_DENIED;
> +  VarArg= VarArg->Next;
> +  if (VarArg == NULL) {
> +ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> (STR_IFCONFIG_LACK_COMMAND), gShellNetwork1HiiHandle);
> +ShellStatus = SHELL_INVALID_PARAMETER;
>  goto ON_EXIT;
>}
> 
> -  VarArg= VarArg->Next;
> -
>ZeroMem (&ManualAddress, s

Re: [edk2] [PATCH] ShellPkg: Refine the code to reduce time cost of 'map -r'

2015-12-03 Thread Carsey, Jaben


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, December 03, 2015 9:16 AM
> To: Carsey, Jaben ; Qiu, Shumin
> ; edk2-de...@ml01.01.org
> Subject: Re: [edk2] [PATCH] ShellPkg: Refine the code to reduce time cost of
> 'map -r'
> Importance: High
> 
> On 12/03/15 18:04, Carsey, Jaben wrote:
> >
> >
> >> -Original Message-
> >> From: Laszlo Ersek [mailto:ler...@redhat.com]
> >> Sent: Thursday, December 03, 2015 3:26 AM
> >> To: Qiu, Shumin ; edk2-de...@ml01.01.org
> >> Cc: Carsey, Jaben 
> >> Subject: Re: [edk2] [PATCH] ShellPkg: Refine the code to reduce time cost
> of
> >> 'map -r'
> >> Importance: High
> >>
> >> On 12/03/15 06:35, Qiu Shumin wrote:
> >>> In some platform 'map -r' may cost more than 1 min. This patch filter the
> >> target handles by
> >>> BlockIO and SimpleFileSystem protocol to reduce the time cost.
> >>
> >> Hijacking this thread and asking a more general question -- I noticed
> >> recently that the "devices" and "drivers" commands can take quite long.
> >> I guess there is a lot of processing to be done for those. But, has it
> >> been considered to change the internal representation of the protocol
> >> database to speed things up? (I'm asking this without knowing too much
> >> about the current representation.)
> >>
> >> I'm not suggesting that the current proto DB representation is slow; I'm
> >> just curious if the perf consequences of the representation have been
> >> considered before.
> >
> >
> > not to my knowledge.  Curiosity - do you mean internal representation in
> the shell or in the platform?  The shell maintains almost no internal
> representation of anything.
> 
> In the platform. The performance of some of the protocol boot services
> could depend on that representation.
> 
> But, maybe the shell could be optimized too (I haven't looked at the
> code). I can imagine that for cross-referencing various things it uses
> O(n^2) nested loops or something similar, even if state is not
> maintained longer than a command's execution.


Correct.  The data must be flushed after each command, but we could optimize 
the processing done within the commands.  I have looked and I can tell you that 
it could be better.  Heck I wrote most of that and I agree it could be better.

-Jaben

> 
> Thanks
> Laszlo
> 
> >
> >>
> >> Thanks!
> >> Laszlo
> >>
> >>>
> >>> Cc: Jaben Carsey 
> >>> Contributed-under: TianoCore Contribution Agreement 1.0
> >>> Signed-off-by: Qiu Shumin 
> >>> ---
> >>>  .../Library/UefiShellCommandLib/ConsistMapping.c   | 40
> >> --
> >>>  1 file changed, 30 insertions(+), 10 deletions(-)
> >>>
> >>> diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> >> b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> >>> index 9bd7b2c..86e8dc5 100644
> >>> --- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> >>> +++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> >>> @@ -16,6 +16,10 @@
> >>>  #include 
> >>>  #include 
> >>>  #include 
> >>> +#include 
> >>> +#include 
> >>> +
> >>> +
> >>>
> >>>  typedef enum {
> >>>MTDTypeUnknown,
> >>> @@ -1349,20 +1353,22 @@ ShellCommandConsistMappingInitialize (
> >>>OUT EFI_DEVICE_PATH_PROTOCOL   ***Table
> >>>)
> >>>  {
> >>> -  EFI_HANDLE*HandleBuffer;
> >>> -  UINTN HandleNum;
> >>> -  UINTN HandleLoop;
> >>> -  EFI_DEVICE_PATH_PROTOCOL  **TempTable;
> >>> -  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
> >>> -  EFI_DEVICE_PATH_PROTOCOL  *HIDevicePath;
> >>> -  UINTN Index;
> >>> -  EFI_STATUSStatus;
> >>> +  EFI_HANDLE  *HandleBuffer;
> >>> +  UINTN   HandleNum;
> >>> +  UINTN   HandleLoop;
> >>> +  EFI_DEVICE_PATH_PROTOCOL**TempTable;
> >>> +  EFI_DEVICE_PATH_PROTOCOL*DevicePath;
> >>> +  EFI_DEVICE_PATH_PROTOCOL*HIDevicePath;
> >>> +  EFI_BLOCK_IO_PROTOC

Re: [edk2] [PATCH] ShellPkg: Refine the code to reduce time cost of 'map -r'

2015-12-03 Thread Carsey, Jaben


> -Original Message-
> From: Laszlo Ersek [mailto:ler...@redhat.com]
> Sent: Thursday, December 03, 2015 3:26 AM
> To: Qiu, Shumin ; edk2-de...@ml01.01.org
> Cc: Carsey, Jaben 
> Subject: Re: [edk2] [PATCH] ShellPkg: Refine the code to reduce time cost of
> 'map -r'
> Importance: High
> 
> On 12/03/15 06:35, Qiu Shumin wrote:
> > In some platform 'map -r' may cost more than 1 min. This patch filter the
> target handles by
> > BlockIO and SimpleFileSystem protocol to reduce the time cost.
> 
> Hijacking this thread and asking a more general question -- I noticed
> recently that the "devices" and "drivers" commands can take quite long.
> I guess there is a lot of processing to be done for those. But, has it
> been considered to change the internal representation of the protocol
> database to speed things up? (I'm asking this without knowing too much
> about the current representation.)
> 
> I'm not suggesting that the current proto DB representation is slow; I'm
> just curious if the perf consequences of the representation have been
> considered before.


not to my knowledge.  Curiosity - do you mean internal representation in the 
shell or in the platform?  The shell maintains almost no internal 
representation of anything.

> 
> Thanks!
> Laszlo
> 
> >
> > Cc: Jaben Carsey 
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Qiu Shumin 
> > ---
> >  .../Library/UefiShellCommandLib/ConsistMapping.c   | 40
> --
> >  1 file changed, 30 insertions(+), 10 deletions(-)
> >
> > diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> > index 9bd7b2c..86e8dc5 100644
> > --- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> > +++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> > @@ -16,6 +16,10 @@
> >  #include 
> >  #include 
> >  #include 
> > +#include 
> > +#include 
> > +
> > +
> >
> >  typedef enum {
> >MTDTypeUnknown,
> > @@ -1349,20 +1353,22 @@ ShellCommandConsistMappingInitialize (
> >OUT EFI_DEVICE_PATH_PROTOCOL   ***Table
> >)
> >  {
> > -  EFI_HANDLE*HandleBuffer;
> > -  UINTN HandleNum;
> > -  UINTN HandleLoop;
> > -  EFI_DEVICE_PATH_PROTOCOL  **TempTable;
> > -  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
> > -  EFI_DEVICE_PATH_PROTOCOL  *HIDevicePath;
> > -  UINTN Index;
> > -  EFI_STATUSStatus;
> > +  EFI_HANDLE  *HandleBuffer;
> > +  UINTN   HandleNum;
> > +  UINTN   HandleLoop;
> > +  EFI_DEVICE_PATH_PROTOCOL**TempTable;
> > +  EFI_DEVICE_PATH_PROTOCOL*DevicePath;
> > +  EFI_DEVICE_PATH_PROTOCOL*HIDevicePath;
> > +  EFI_BLOCK_IO_PROTOCOL   *BlockIo;
> > +  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;
> > +  UINTN   Index;
> > +  EFI_STATUS  Status;
> >
> >HandleBuffer  = NULL;
> >
> >Status = gBS->LocateHandleBuffer (
> > -  AllHandles,
> > -  NULL,
> > +  ByProtocol,
> > +  &gEfiDevicePathProtocolGuid,
> >NULL,
> >&HandleNum,
> >&HandleBuffer
> > @@ -1385,6 +1391,20 @@ ShellCommandConsistMappingInitialize (
> >continue;
> >  }
> >
> > +Status = gBS->HandleProtocol( HandleBuffer[HandleLoop],
> > +  &gEfiBlockIoProtocolGuid,
> > +  (VOID **)&BlockIo
> > +  );
> > +if (EFI_ERROR(Status)) {
> > +  Status = gBS->HandleProtocol( HandleBuffer[HandleLoop],
> > +&gEfiSimpleFileSystemProtocolGuid,
> > +(VOID **)&SimpleFileSystem
> > +);
> > +  if (EFI_ERROR(Status)) {
> > +continue;
> > +  }
> > +}
> > +
> >  for (Index = 0; TempTable[Index] != NULL; Index++) {
> >if (DevicePathCompare (&TempTable[Index], &HIDevicePath) == 0) {
> >  FreePool (HIDevicePath);
> >

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Refine the code to reduce time cost of 'map -r'

2015-12-03 Thread Carsey, Jaben
Shumin,

Could we loop over a list of handles made by 
1) LocateHandleBuffer on BlockIO 
2) LocateHandleBuffer on SimpleFileSystem
3) Combine these lists (removing duplicates)

Would that be faster?  Not sure if this would be worth it, but something I 
thought of... Your change is still good.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Wednesday, December 02, 2015 9:36 PM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> 
> Subject: [PATCH] ShellPkg: Refine the code to reduce time cost of 'map -r'
> Importance: High
> 
> In some platform 'map -r' may cost more than 1 min. This patch filter the
> target handles by
> BlockIO and SimpleFileSystem protocol to reduce the time cost.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  .../Library/UefiShellCommandLib/ConsistMapping.c   | 40
> --
>  1 file changed, 30 insertions(+), 10 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> index 9bd7b2c..86e8dc5 100644
> --- a/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> +++ b/ShellPkg/Library/UefiShellCommandLib/ConsistMapping.c
> @@ -16,6 +16,10 @@
>  #include 
>  #include 
>  #include 
> +#include 
> +#include 
> +
> +
> 
>  typedef enum {
>MTDTypeUnknown,
> @@ -1349,20 +1353,22 @@ ShellCommandConsistMappingInitialize (
>OUT EFI_DEVICE_PATH_PROTOCOL   ***Table
>)
>  {
> -  EFI_HANDLE*HandleBuffer;
> -  UINTN HandleNum;
> -  UINTN HandleLoop;
> -  EFI_DEVICE_PATH_PROTOCOL  **TempTable;
> -  EFI_DEVICE_PATH_PROTOCOL  *DevicePath;
> -  EFI_DEVICE_PATH_PROTOCOL  *HIDevicePath;
> -  UINTN Index;
> -  EFI_STATUSStatus;
> +  EFI_HANDLE  *HandleBuffer;
> +  UINTN   HandleNum;
> +  UINTN   HandleLoop;
> +  EFI_DEVICE_PATH_PROTOCOL**TempTable;
> +  EFI_DEVICE_PATH_PROTOCOL*DevicePath;
> +  EFI_DEVICE_PATH_PROTOCOL*HIDevicePath;
> +  EFI_BLOCK_IO_PROTOCOL   *BlockIo;
> +  EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *SimpleFileSystem;
> +  UINTN   Index;
> +  EFI_STATUS  Status;
> 
>HandleBuffer  = NULL;
> 
>Status = gBS->LocateHandleBuffer (
> -  AllHandles,
> -  NULL,
> +  ByProtocol,
> +  &gEfiDevicePathProtocolGuid,
>NULL,
>&HandleNum,
>&HandleBuffer
> @@ -1385,6 +1391,20 @@ ShellCommandConsistMappingInitialize (
>continue;
>  }
> 
> +Status = gBS->HandleProtocol( HandleBuffer[HandleLoop],
> +  &gEfiBlockIoProtocolGuid,
> +  (VOID **)&BlockIo
> +  );
> +if (EFI_ERROR(Status)) {
> +  Status = gBS->HandleProtocol( HandleBuffer[HandleLoop],
> +&gEfiSimpleFileSystemProtocolGuid,
> +(VOID **)&SimpleFileSystem
> +);
> +  if (EFI_ERROR(Status)) {
> +continue;
> +  }
> +}
> +
>  for (Index = 0; TempTable[Index] != NULL; Index++) {
>if (DevicePathCompare (&TempTable[Index], &HIDevicePath) == 0) {
>  FreePool (HIDevicePath);
> --
> 1.9.5.msysgit.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/3] BaseTools/Scripts: Add ConvertUtf16ToUtf8.py script

2015-12-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jordan Justen
> Sent: Wednesday, December 02, 2015 2:17 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Justen, Jordan L
> ; Gao, Liming 
> Subject: [edk2] [PATCH 1/3] BaseTools/Scripts: Add ConvertUtf16ToUtf8.py
> script
> Importance: High
> 
> This script uses python codecs to convert .uni string files from
> utf-16 to utf-8.
> 
> The advantages of utf-8 data:
>  * Generally smaller files
>  * More commonly supported by editors
>  * Not treated as binary data in patch files
> 
> Cc: Yonghong Zhu 
> Cc: Liming Gao 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jordan Justen 
> ---
>  BaseTools/Scripts/ConvertUtf16ToUtf8.py | 123
> 
>  1 file changed, 123 insertions(+)
>  create mode 100755 BaseTools/Scripts/ConvertUtf16ToUtf8.py
> 
> diff --git a/BaseTools/Scripts/ConvertUtf16ToUtf8.py
> b/BaseTools/Scripts/ConvertUtf16ToUtf8.py
> new file mode 100755
> index 000..5f54603
> --- /dev/null
> +++ b/BaseTools/Scripts/ConvertUtf16ToUtf8.py
> @@ -0,0 +1,123 @@
> +## @file
> +#  Check a patch for various format issues
> +#
> +#  Copyright (c) 2015, Intel Corporation. All rights reserved.
> +#
> +#  This program and the accompanying materials are licensed and made
> +#  available under the terms and conditions of the BSD License which
> +#  accompanies this distribution. The full text of the license may be
> +#  found at http://opensource.org/licenses/bsd-license.php
> +#
> +#  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS"
> +#  BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER
> +#  EXPRESS OR IMPLIED.
> +#
> +
> +from __future__ import print_function
> +
> +VersionNumber = '0.1'
> +__copyright__ = "Copyright (c) 2015, Intel Corporation  All rights reserved."
> +
> +import argparse
> +import codecs
> +import os
> +import sys
> +
> +try:
> +from io import StringIO
> +except ImportError:
> +from StringIO import StringIO
> +
> +class ConvertOneArg:
> +"""Converts utf-16 to utf-8 for one command line argument.
> +
> +   This could be a single file, or a directory.
> +"""
> +
> +def __init__(self, source):
> +self.source = source
> +
> +self.ok = True
> +
> +if not os.path.exists(source):
> +self.ok = False
> +elif os.path.isdir(source):
> +for (root, dirs, files) in os.walk(source):
> +files = filter(lambda a: a.endswith('.uni'), files)
> +for filename in files:
> +path = os.path.join(root, filename)
> +self.ok &= self.convert_one_file(path)
> +if not self.ok:
> +break
> +
> +if not self.ok:
> +break
> +else:
> +self.ok &= self.convert_one_file(source)
> +
> +def convert_one_file(self, source):
> +#
> +# Read file
> +#
> +utf16_file = open(source, mode='rb')
> +file_content = utf16_file.read()
> +utf16_file.close()
> +
> +#
> +# Detect UTF-16 Byte Order Mark at beginning of file.
> +#
> +if not (file_content.startswith(codecs.BOM_UTF16_BE) or
> +file_content.startswith(codecs.BOM_UTF16_LE)):
> +print(source + ": already utf-8")
> +return True
> +
> +#
> +# Decode utf-16 string data
> +#
> +str_content = file_content.decode('utf-16', 'ignore')
> +
> +#
> +# Encode string data to utf-8
> +#
> +utf8_content = str_content.encode('utf-8', 'ignore')
> +
> +#
> +# Write converted utf-8 data back to file
> +#
> +utf8_file = open(source, mode='wb')
> +utf8_file.write(utf8_content)
> +utf8_file.close()
> +
> +print(source + ": converted, size", len(file_content), '=>',
> len(utf8_content))
> +return True
> +
> +
> +class ConvertUtf16ToUtf8App:
> +"""Converts files to utf-8 based on the command line arguments."""
> +
> +def __init__(self):
> +self.parse_options()
> +sources = self.args.source
> +
> +self.ok = True
> +for pa

Re: [edk2] [Patch 0/2] Fix Shell mm command bugs

2015-12-02 Thread Carsey, Jaben
For the series (I made a tiny comment on the INF in the other patch email)

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Tuesday, December 01, 2015 9:54 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu 
> Subject: [edk2] [Patch 0/2] Fix Shell mm command bugs
> Importance: High
> 
> The patches fix shell mm command help message and let it support
> multiple root bridge platforms.
> 
> Ruiyu Ni (2):
>   ShellPkg/mm: Fix the help message of mm to align to implementation.
>   ShellPkg/mm: Fix mm to support multiple root bridge platform
> 
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c   | 329 +++-
> -
>  .../UefiShellDebug1CommandsLib.h   |   3 +-
>  .../UefiShellDebug1CommandsLib.inf |   1 +
>  .../UefiShellDebug1CommandsLib.uni | Bin 140676 -> 139768 
> bytes
>  4 files changed, 181 insertions(+), 152 deletions(-)
> 
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch] ShellPkg: Fix wrong return status for Ifconfig.c

2015-12-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Jiaxin Wu
> Sent: Wednesday, December 02, 2015 12:54 AM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben ; Ye, Ting ;
> Cohen, Eugene 
> Subject: [edk2] [Patch] ShellPkg: Fix wrong return status for Ifconfig.c
> Importance: High
> 
> The Ifconfig command handler tries to return an EFI_STATUS when
> the return type should be SHELL_STATUS.
> 
> Cc: Cohen, Eugene 
> Cc: Carsey, Jaben 
> Cc: Ye Ting 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Jiaxin Wu 
> ---
>  .../UefiShellNetwork1CommandsLib/Ifconfig.c| 102 ++
> ---
>  1 file changed, 69 insertions(+), 33 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> index e16d46a..fb6f575 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> @@ -421,11 +421,11 @@ IfConfigGetInterfaceInfo (
>NULL,
>&HandleNum,
>&HandleBuffer
>   );
>if (EFI_ERROR (Status) || (HandleNum == 0)) {
> -return EFI_ABORTED;
> +return Status;
>}
> 
>//
>// Enumerate all handles that installed with ip4 service binding protocol.
>//
> @@ -585,15 +585,15 @@ ON_ERROR:
>  /**
>The list process of the ifconfig command.
> 
>@param[in]   IfListThe pointer of IfList(interface list).
> 
> -  @retval EFI_SUCCESSThe ifconfig command list processed successfully.
> +  @retval SHELL_SUCCESS  The ifconfig command list processed successfully.
>@retval others The ifconfig command list process failed.
> 
>  **/
> -EFI_STATUS
> +SHELL_STATUS
>  IfConfigShowInterfaceInfo (
>IN LIST_ENTRY*IfList
>)
>  {
>LIST_ENTRY   *Entry;
> @@ -781,35 +781,37 @@ IfConfigShowInterfaceInfo (
>  }
>}
> 
>ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN (STR_IFCONFIG_INFO_BREAK),
> gShellNetwork1HiiHandle);
> 
> -  return EFI_SUCCESS;
> +  return SHELL_SUCCESS;
>  }
> 
>  /**
>The clean process of the ifconfig command to clear interface info.
> 
>@param[in]   IfListThe pointer of IfList(interface list).
> 
> -  @retval EFI_SUCCESSThe ifconfig command clean processed successfully.
> +  @retval SHELL_SUCCESS  The ifconfig command clean processed
> successfully.
>@retval others The ifconfig command clean process failed.
> 
>  **/
> -EFI_STATUS
> +SHELL_STATUS
>  IfConfigClearInterfaceInfo (
>IN LIST_ENTRY*IfList
>)
>  {
> -  EFI_STATUSStatus;
> +  EFI_STATUSStatus;
> +  SHELL_STATUS  ShellStatus;
>LIST_ENTRY*Entry;
>LIST_ENTRY*Next;
>IFCONFIG_INTERFACE_CB *IfCb;
>EFI_IP4_CONFIG2_POLICYPolicy;
> 
>Policy = Ip4Config2PolicyDhcp;
>Status = EFI_SUCCESS;
> +  ShellStatus = SHELL_SUCCESS;
> 
>if (IsListEmpty (IfList)) {
>  ShellPrintHiiEx (-1, -1, NULL, STRING_TOKEN
> (STR_IFCONFIG_INVALID_INTERFACE), gShellNetwork1HiiHandle);
>}
> 
> @@ -823,37 +825,37 @@ IfConfigClearInterfaceInfo (
>  IfCb->IfCfg,
>  Ip4Config2DataTypePolicy,
>  sizeof (EFI_IP4_CONFIG2_POLICY),
>  &Policy
>  );
> -
>  if (EFI_ERROR (Status)) {
> +  ShellStatus = SHELL_ACCESS_DENIED;
>break;
>  }
>}
> 
> -  return Status;
> +  return ShellStatus;
>  }
> 
>  /**
>The set process of the ifconfig command.
> 
>@param[in]   IfListThe pointer of IfList(interface list).
>@param[in]   VarArgThe pointer of ARG_LIST(Args with "-s" option).
> 
> -  @retval EFI_SUCCESSThe ifconfig command set processed successfully.
> +  @retval SHELL_SUCCESS  The ifconfig command set processed successfully.
>@retval others The ifconfig command set process failed.
> 
>  **/
> -EFI_STATUS
> +SHELL_STATUS
>  IfConfigSetInterfaceInfo (
>IN LIST_ENTRY*IfList,
>IN ARG_LIST  *VarArg
>)
>  {
> -
>EFI_STATUS   Status;
> +  SHELL_STATUS ShellStatus;
>IFCONFIG_INTERFACE_CB*IfCb;
>VAR_CHECK_CODE   CheckCode;
>EFI_EVENTTimeOutEvt;
>   

Re: [edk2] Where do I find the system table address for an EFI app ?

2015-12-02 Thread Carsey, Jaben
I am pretty sure it’s there in a shell app also.  What entry point lib are you 
using to build your app?

-Jaben

From: Shubha Ramani [mailto:shubharam...@yahoo.com]
Sent: Wednesday, December 02, 2015 9:11 AM
To: Carsey, Jaben ; edk2-devel@lists.01.org
Subject: Re: [edk2] Where do I find the system table address for an EFI app ?
Importance: High

Not in a Shell App though. How do you answer to the debugger when it's asking 
for the System Table address for a shell app ?

Thanks,

Shubha

Shubha D. Ramani
shubharam...@gmail.com<mailto:shubharam...@gmail.com>
shubharam...@yahoo.com<mailto:shubharam...@yahoo.com>


On Tuesday, December 1, 2015 8:39 AM, "Carsey, Jaben" 
mailto:jaben.car...@intel.com>> wrote:

Its passed as a parameter to the "main" function when your app starts.

-Jaben

> -Original Message-
> From: edk2-devel 
> [mailto:edk2-devel-boun...@lists.01.org<mailto:edk2-devel-boun...@lists.01.org>]
>  On Behalf Of
> Shubha Ramani
> Sent: Tuesday, December 01, 2015 8:35 AM
> To: edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> Subject: Re: [edk2] Where do I find the system table address for an EFI app ?
> Importance: High
>
>  I'm sorry but this was unclear. I meant where do I find the System Table
> address for a UEFI Shell App ?The debugger is asking for it. I couldn't find 
> it in
> the generated *.map file.
> Thanks
> Shubha
> Shubha D. ramanishubharam...@gmail.com<mailto:ramanishubharam...@gmail.com>
> shubharam...@yahoo.com<mailto:shubharam...@yahoo.com>
>
>
>On Monday, November 30, 2015 3:00 PM, Shubha Ramani
> mailto:shubharam...@yahoo.com>> wrote:
>
>
>  I'm trying to debug it using a debugger and the debugger is asking me this
> question.
> I looked at the *.map file which is generated and I could not locate the 
> System
> Table address.
> Thanks,
> Shubha Shubha D. 
> ramanishubharam...@gmail.com<mailto:ramanishubharam...@gmail.com>
> shubharam...@yahoo.com<mailto:shubharam...@yahoo.com>

>
>
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org<mailto:edk2-devel@lists.01.org>
> https://lists.01.org/mailman/listinfo/edk2-devel


___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [Patch 2/2] ShellPkg/mm: Fix mm to support multiple root bridge platform

2015-12-02 Thread Carsey, Jaben
I propose to rev the version of the library + 0.1 in the INF file?

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Ruiyu Ni
> Sent: Tuesday, December 01, 2015 9:54 PM
> To: edk2-devel@lists.01.org
> Cc: Ni, Ruiyu ; Qiu, Shumin 
> Subject: [edk2] [Patch 2/2] ShellPkg/mm: Fix mm to support multiple root
> bridge platform
> Importance: High
> 
> In multiple root bridge platforms, different root bridges may
> share the same segment but occupy different range of buses,
> or may occupy different segments.
> The fix is to find the correct root bridge IO instance by
> comparing not only the segment but also the bus ranges.
> Directly use Cpu Io for MMIO and IO accesses because some MMIO
> or IO is not occupied by PCI devices so it doesn't make sense
> to use root bridge IO to access them.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ruiyu Ni 
> Cc: Shumin Qiu 
> ---
>  ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c   | 329 +++-
> -
>  .../UefiShellDebug1CommandsLib.h   |   3 +-
>  .../UefiShellDebug1CommandsLib.inf |   1 +
>  .../UefiShellDebug1CommandsLib.uni | Bin 139696 -> 139768 
> bytes
>  4 files changed, 181 insertions(+), 152 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> index ca64f2c..fa1451c 100644
> --- a/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> +++ b/ShellPkg/Library/UefiShellDebug1CommandsLib/Mm.c
> @@ -2,7 +2,7 @@
>Main file for Mm shell Debug1 function.
> 
>(C) Copyright 2015 Hewlett-Packard Development Company, L.P.
> -  Copyright (c) 2005 - 2014, Intel Corporation. All rights reserved.
> +  Copyright (c) 2005 - 2015, Intel Corporation. All rights reserved.
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -19,12 +19,30 @@
>  #include 
> 
>  typedef enum {
> -  EfiMemory,
> -  EFIMemoryMappedIo,
> -  EfiIo,
> -  EfiPciConfig,
> -  EfiPciEConfig
> -} EFI_ACCESS_TYPE;
> +  ShellMmMemory,
> +  ShellMmMemoryMappedIo,
> +  ShellMmIo,
> +  ShellMmPci,
> +  ShellMmPciExpress
> +} SHELL_MM_ACCESS_TYPE;
> +
> +typedef struct {
> +  UINT64 Register : 12;
> +  UINT64 Function : 8;
> +  UINT64 Device : 8;
> +  UINT64 Bus : 8;
> +  UINT64 Segment : 8;
> +  UINT64 Reserved : 20;
> +} SHELL_MM_PCIE_ADDRESS;
> +
> +typedef struct {
> +  UINT64 Register : 8;
> +  UINT64 Function : 8;
> +  UINT64 Device : 8;
> +  UINT64 Bus : 8;
> +  UINT64 Segment : 8;
> +  UINT64 Reserved : 24;
> +} SHELL_MM_PCI_ADDRESS;
> 
>  STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
>{L"-mmio", TypeFlag},
> @@ -37,7 +55,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
>{NULL, TypeMax}
>};
> 
> -STATIC CONST UINT64 MaxNum[9]  = { 0xff, 0x, 0x,
> 0xULL };
> +STATIC CONST UINT64 mShellMmMaxNumber[9]  = { 0xff, 0x, 0x,
> 0xULL };
> 
>  /**
>Read some data into a buffer from memory.
> @@ -176,22 +194,43 @@ GetHex (
>  }
> 
>  /**
> -  Get the PCI-E Address from a PCI address format 0xssbbddffrrr
> -  where ss is SEGMENT, bb is BUS, dd is DEVICE, ff is FUNCTION
> -  and rrr is REGISTER (extension format for PCI-E).
> -
> -  @param[in] InputAddress   PCI address format on input.
> -  @param[out]PciEAddressPCI-E address extention format.
> +  Extract the PCI segment, bus, device, function, register from
> +  from a SHELL_MM_PCI or SHELL_MM_PCIE format of address..
> +
> +  @param[in]  AccessType Access type.
> +  @param[in]  AddressSHELL_MM_PCI or SHELL_MM_PCIE address.
> +  @param[out] SegmentPCI segment number.
> +  @param[out] BusPCI bus number.
> +  @param[out] Device PCI device number.
> +  @param[out] Function   PCI function number.
> +  @param[out] Register   PCI register offset.
>  **/
>  VOID
>  EFIAPI
> -GetPciEAddressFromInputAddress (
> -  IN UINT64 InputAddress,
> -  OUT UINT64*PciEAddress
> +ShellMmDecodePciAddress (
> +  IN SHELL_MM_ACCESS_TYPE   AccessType,
> +  IN UINT64 Address,
> +  OUT UINT32*Segment,
> +  OUT UINT8 *Bus,
> +  OUT UINT8 *Device,
> +  OUT UINT8 *Fu

Re: [edk2] [PATCH 4/5] ShellPkg: add missing SHELL_STATUS cast

2015-12-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Wednesday, December 02, 2015 9:03 AM
> To: edk2-devel@lists.01.org; ler...@redhat.com; Gao, Liming
> ; Zhang, Chao B ; Carsey,
> Jaben ; Qiu, Shumin ; Fan,
> Jeff ; Tian, Feng 
> Cc: Ard Biesheuvel 
> Subject: [PATCH 4/5] ShellPkg: add missing SHELL_STATUS cast
> Importance: High
> 
> The prototype of ShellCommandRunIfconfig() indicates that it returns
> a SHELL_STATUS, so returning a EFI_STATUS requires an explicit cast.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Ard Biesheuvel 
> ---
>  ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> index e16d46a8ec4d..2347aab9e96e 100644
> --- a/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> +++ b/ShellPkg/Library/UefiShellNetwork1CommandsLib/Ifconfig.c
> @@ -1384,5 +1384,5 @@ ON_EXIT:
>  IfConfigCleanup (Private);
>}
> 
> -  return Status;
> +  return (SHELL_STATUS)Status;
>  }
> --
> 1.9.1

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] MdePkg: DebugAssert enhancement

2015-12-01 Thread Carsey, Jaben
Change seems fine to me.  Note that I am not maintainer on this PKG.

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Anbazhagan, Baraneedharan
> Sent: Tuesday, December 01, 2015 3:26 PM
> To: edk2-devel@lists.01.org; Carsey, Jaben ; Gao,
> Liming ; Kinney, Michael D
> 
> Subject: Re: [edk2] MdePkg: DebugAssert enhancement
> Importance: High
> 
> MdePkg: DebugAssert enhancement
> 
> If the assert happens in a library, then it's hard to determine which
> module using that library is generating that assert.  Use gEfiCallerBaseName
> in DebugAssert to display the module name.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Baraneedharan Anbazhagan 
> 
> 
>  MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c| 2 +-
>  MdePkg/Library/UefiDebugLibConOut/DebugLib.c| 3 ++-
>  MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c | 3 ++-
>  MdePkg/Library/UefiDebugLibStdErr/DebugLib.c| 3 ++-
>  4 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> index 6fa235c..8ab0847 100644
> --- a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> +++ b/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> @@ -133,7 +133,7 @@ DebugAssert (
>//
>// Generate the ASSERT() message in Ascii format
>//
> -  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT %a(%d): %a\n", FileName,
> LineNumber, Description);
> +  AsciiSPrint (Buffer, sizeof (Buffer), "ASSERT [%a] %a(%d): %a\n",
> gEfiCallerBaseName, FileName, LineNumber, Description);
> 
>//
>// Send the print string to the Console Output device
> diff --git a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> index 2ac2204..0bc112f 100644
> --- a/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> +++ b/MdePkg/Library/UefiDebugLibConOut/DebugLib.c
> @@ -121,7 +121,8 @@ DebugAssert (
>UnicodeSPrintAsciiFormat (
>  Buffer,
>  sizeof (Buffer),
> -"ASSERT %a(%d): %a\n",
> +"ASSERT [%a] %a(%d): %a\n",
> +gEfiCallerBaseName,
>  FileName,
>  LineNumber,
>  Description
> diff --git a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> index 10d3e34..0e95046 100644
> --- a/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> +++ b/MdePkg/Library/UefiDebugLibDebugPortProtocol/DebugLib.c
> @@ -175,7 +175,8 @@ DebugAssert (
>AsciiSPrint (
>  Buffer,
>  sizeof (Buffer),
> -"ASSERT %a(%d): %a\n",
> +"ASSERT [%a] %a(%d): %a\n",
> +gEfiCallerBaseName,
>  FileName,
>  LineNumber,
>  Description
> diff --git a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> index bbd6d94..cacb90a 100644
> --- a/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> +++ b/MdePkg/Library/UefiDebugLibStdErr/DebugLib.c
> @@ -122,7 +122,8 @@ DebugAssert (
>UnicodeSPrintAsciiFormat (
>  Buffer,
>  sizeof (Buffer),
> -"ASSERT %a(%d): %a\n",
> +"ASSERT [%a] %a(%d): %a\n",
> +gEfiCallerBaseName,
>  FileName,
>  LineNumber,
>  Description
> 
> > -Original Message-
> > From: Carsey, Jaben [mailto:jaben.car...@intel.com]
> > Sent: Tuesday, December 01, 2015 3:05 PM
> > To: Anbazhagan, Baraneedharan
> > Cc: Carsey, Jaben
> > Subject: RE: MdePkg: DebugAssert enhancement
> >
> > You need to send this with your attestation and signed off by lines.  Please
> resubmit
> > with those things.
> >
> > > -Original Message-
> > > From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> > > Anbazhagan, Baraneedharan
> > > Sent: Tuesday, December 01, 2015 1:02 PM
> > > To: edk2-devel@lists.01.org; Gao, Liming ;
> > > Kinney, Michael D 
> > > Subject: [edk2] MdePkg: DebugAssert enhancement
> > >
> > > Hi,
> > > Current DebugAssert function prints the file name and line number. If
> > > the assert happens in a library, then it's hard to determine which
> > > module using that library is generating that assert.  Can we add
> > > gEfiCallerBaseName to display the module name as well?
> > >
> > > -Baranee
> > >
> > > diff --git a/MdePkg/Library/BaseDebugLibSerialPort/DebugLib.c
> > > b/MdePkg/Library/BaseDebugLibSerialPort

Re: [edk2] Where do I find the system table address for an EFI app ?

2015-12-01 Thread Carsey, Jaben
Its passed as a parameter to the "main" function when your app starts.

-Jaben

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Shubha Ramani
> Sent: Tuesday, December 01, 2015 8:35 AM
> To: edk2-devel@lists.01.org
> Subject: Re: [edk2] Where do I find the system table address for an EFI app ?
> Importance: High
> 
>  I'm sorry but this was unclear. I meant where do I find the System Table
> address for a UEFI Shell App ?The debugger is asking for it. I couldn't find 
> it in
> the generated *.map file.
> Thanks
> Shubha
> Shubha D. ramanishubharam...@gmail.com
> shubharam...@yahoo.com
> 
> 
> On Monday, November 30, 2015 3:00 PM, Shubha Ramani
>  wrote:
> 
> 
>  I'm trying to debug it using a debugger and the debugger is asking me this
> question.
> I looked at the *.map file which is generated and I could not locate the 
> System
> Table address.
> Thanks,
> Shubha Shubha D. ramanishubharam...@gmail.com
> shubharam...@yahoo.com
> 
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.

2015-11-23 Thread Carsey, Jaben
Not sure how to RB this ... it's fine with me to commit it.

> -Original Message-
> From: Ard Biesheuvel [mailto:ard.biesheu...@linaro.org]
> Sent: Monday, November 23, 2015 5:22 AM
> To: Leif Lindholm 
> Cc: edk2-devel@lists.01.org; Carsey, Jaben ; Qiu,
> Shumin 
> Subject: Re: [PATCH] ShellBinPkg: Arm/AArch64 Shell binary update.
> Importance: High
> 
> On 23 November 2015 at 14:20, Leif Lindholm 
> wrote:
> > The binaries of ShellBinPkg are generated with ShellPkg from r18915.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Leif Lindholm 
> > ---
> >
> > Patch generated with --no-binary, actual binaries available from
> > https://git.linaro.org/people/leif.lindholm/edk2.git/shortlog/refs/hea
> > ds/shellbinupdate
> >
> 
> Acked-by: Ard Biesheuvel 
> 
> >  ShellBinPkg/MinUefiShell/AArch64/Shell.efi | Bin 387808 -> 382304 bytes
> >  ShellBinPkg/MinUefiShell/Arm/Shell.efi | Bin 330208 -> 330336 bytes
> >  ShellBinPkg/UefiShell/AArch64/Shell.efi| Bin 887136 -> 873664 bytes
> >  ShellBinPkg/UefiShell/Arm/Shell.efi| Bin 769536 -> 769088 bytes
> >  4 files changed, 0 insertions(+), 0 deletions(-)
> >
> > diff --git a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> > b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi
> > index d5756e1..9faeaff 100755
> > Binary files a/ShellBinPkg/MinUefiShell/AArch64/Shell.efi and
> > b/ShellBinPkg/MinUefiShell/AArch64/Shell.efi differ diff --git
> > a/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> > b/ShellBinPkg/MinUefiShell/Arm/Shell.efi
> > index 8a7d7e5..695f72a 100755
> > Binary files a/ShellBinPkg/MinUefiShell/Arm/Shell.efi and
> > b/ShellBinPkg/MinUefiShell/Arm/Shell.efi differ diff --git
> > a/ShellBinPkg/UefiShell/AArch64/Shell.efi
> > b/ShellBinPkg/UefiShell/AArch64/Shell.efi
> > index 056da8d..76b0a03 100755
> > Binary files a/ShellBinPkg/UefiShell/AArch64/Shell.efi and
> > b/ShellBinPkg/UefiShell/AArch64/Shell.efi differ diff --git
> > a/ShellBinPkg/UefiShell/Arm/Shell.efi
> > b/ShellBinPkg/UefiShell/Arm/Shell.efi
> > index afa91c4..4d95e08 100755
> > Binary files a/ShellBinPkg/UefiShell/Arm/Shell.efi and
> > b/ShellBinPkg/UefiShell/Arm/Shell.efi differ
> > --
> > 2.1.4
> >
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg: Corrected CatSPrint usage to prevent memory leaks.

2015-11-17 Thread Carsey, Jaben
Good catch. 

Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Cecil Sheng
> Sent: Tuesday, November 17, 2015 4:19 PM
> To: edk2-devel@lists.01.org
> Cc: Cecil Sheng 
> Subject: [edk2] [PATCH] ShellPkg: Corrected CatSPrint usage to prevent
> memory leaks.
> Importance: High
> 
> CatSPrint allocates return buffer for the caller. The caller doesn't have to
> allocate one, and has to free the used buffers.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cecil Sheng 
> ---
>  .../UefiHandleParsingLib/UefiHandleParsingLib.c| 231 +++-
> -
>  1 file changed, 122 insertions(+), 109 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> index b6ce509..5f4cc05 100644
> --- a/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> +++ b/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.c
> @@ -1,6 +1,7 @@
>  /** @file
>Provides interface to advanced shell functionality for parsing both handle
> and protocol database.
> 
> +  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>(C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.
>Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.
>This program and the accompanying materials
> @@ -108,9 +109,9 @@ HandleParsingLibConstructor (
>return (EFI_SUCCESS);
>  }
> 
> -/**
> +/**
>Initialization function for HII packages.
> -
> +
>  **/
>  VOID
>  HandleParsingHiiInit (VOID)
> @@ -180,10 +181,7 @@ LoadedImageProtocolDumpInformation(
>HandleParsingHiiInit();
> 
>Temp = HiiGetString(mHandleParsingHiiHandle,
> STRING_TOKEN(STR_LI_DUMP_MAIN), NULL);
> -  RetVal = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
> -  if (Temp == NULL || RetVal == NULL) {
> -SHELL_FREE_NON_NULL(Temp);
> -SHELL_FREE_NON_NULL(RetVal);
> +  if (Temp == NULL) {
>  return NULL;
>}
> 
> @@ -205,22 +203,24 @@ LoadedImageProtocolDumpInformation(
>DataType = ConvertMemoryType(LoadedImage->ImageDataType);
>CodeType = ConvertMemoryType(LoadedImage->ImageCodeType);
> 
> -  RetVal = CatSPrint(RetVal,
> -  Temp,
> -  LoadedImage->Revision,
> -  LoadedImage->ParentHandle,
> -  LoadedImage->SystemTable,
> -  LoadedImage->DeviceHandle,
> -  LoadedImage->FilePath,
> -  LoadedImage->LoadOptionsSize,
> -  LoadedImage->LoadOptions,
> -  LoadedImage->ImageBase,
> -  LoadedImage->ImageSize,
> -  CodeType,
> -  DataType,
> -  LoadedImage->Unload);
> -
> -
> +  RetVal = CatSPrint(
> + NULL,
> + Temp,
> + LoadedImage->Revision,
> + LoadedImage->ParentHandle,
> + LoadedImage->SystemTable,
> + LoadedImage->DeviceHandle,
> + LoadedImage->FilePath,
> + LoadedImage->LoadOptionsSize,
> + LoadedImage->LoadOptions,
> + LoadedImage->ImageBase,
> + LoadedImage->ImageSize,
> + CodeType,
> + DataType,
> + LoadedImage->Unload
> + );
> +
> +
>SHELL_FREE_NON_NULL(Temp);
>SHELL_FREE_NON_NULL(CodeType);
>SHELL_FREE_NON_NULL(DataType);
> @@ -258,10 +258,7 @@ GraphicsOutputProtocolDumpInformation(
>HandleParsingHiiInit();
> 
>Temp = HiiGetString(mHandleParsingHiiHandle,
> STRING_TOKEN(STR_GOP_DUMP_MAIN), NULL);
> -  RetVal = AllocateZeroPool (PcdGet16 (PcdShellPrintBufferSize));
> -  if (Temp == NULL || RetVal == NULL) {
> -SHELL_FREE_NON_NULL(Temp);
> -SHELL_FREE_NON_NULL(RetVal);
> +  if (Temp == NULL) {
>  return NULL;
>}
> 
> @@ -276,29 +273,29 @@ GraphicsOutputProtocolDumpInformation(
> 
>if (EFI_ERROR (Status)) {
>  SHELL_FREE_NON_NULL (Temp);
> -SHELL_FREE_NON_NULL (RetVal);
>  return NULL;
>}
> 
>Fmt = ConvertPixelFormat(GraphicsOutput->Mode->Info->PixelFormat);
> 
> -  RetVal = CatSPrint(RetVal,
> -  Temp,
> -  GraphicsOutput->Mode->MaxMode,
> -  GraphicsOutput->Mode->Mode,
> -  GraphicsOutput->Mode->FrameBufferBase,
> -  

Re: [edk2] ShellPkg: Network commands (ifconfig/ping) broken

2015-11-10 Thread Carsey, Jaben


> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of Laszlo
> Ersek
> Sent: Tuesday, November 10, 2015 3:54 AM
> To: Leif Lindholm 
> Cc: edk2-devel@lists.01.org ; Wu, Jiaxin
> 
> Subject: Re: [edk2] ShellPkg: Network commands (ifconfig/ping) broken
> Importance: High
> 
> On 11/10/15 11:43, Leif Lindholm wrote:
> > On Tue, Nov 10, 2015 at 11:28:10AM +0100, Laszlo Ersek wrote:
> >> On 11/10/15 11:20, Conen, Johannes wrote:
> >>> Hmm, you're right. is it briefly mentioned in the "ShellPkg
> >>> Notes.txt" - I must admit, I only took a look at the
> >>> "UDK2015-ReleaseNotes-MyWorkSpace.txt" and expected all major
> changes
> >>> to mentioned there (and well, they were, like the moving of the
> >>> library files). So this non-backwards-compatibility from UDK2015 to
> >>> UDK2014 regarding network-related stuff is intended?
> >>
> >> I'll have to let Jiaxin answer this question; I'm not a participant in
> >> UDK feature planning. And, I have no idea how UDK releases account for
> >> compatibility in general.
> >>
> >> (My *guess* is that UDK2015 generally targets (or moved towards) UEFI
> >> 2.5, and Ip4Config (version 1) is apparently deprecated in UEFI 2.5.)
> >
> > The actual wording from the specification is:
> > ---
> > The EFI_IP4_CONFIG_PROTOCOL has been replaced with the new
> > EFI_IP4_CONFIG2_PROTOCOL.
> > • All new designs based on this specification should exclusively use
> >   EFI_IP4_CONFIG2_PROTOCOL .
> > • The EFI_IP4_CONFIG_PROTOCOL will be removed in the next revision of
> >   this specification.
> > ---
> >
> > Clearly this creates a compatibility breakage at some point.
> >
> > Is this something we consider "not a problem", or should the shell
> > implement (providing a reference for how to implement) fallback to
> > EFI_IP4_CONFIG_PROTOCOL if EFI_IP4_CONFIG2_PROTOCOL is not available?
> 
> Whether the shell in edk2 should or should not provide fallback code for
> EFI_IP4_CONFIG_PROTOCOL is for Intel to answer :), but I think I can ask
> one more question as to "how".
> 
> Namely, if one adds (or keeps) the Ip4Config fallback code to (in) the
> shell in edk2, how does that compat feature get tested, staying within
> the tree? It would require keeping the Ip4Config protocol implementation
> around just for the sake of testing the fallback.
> 
> I don't think that's a good idea.
> 
> Instead, any dependencies on specific versions of the UEFI spec should
> be spelled out loud and clear. (I believe I've read such requirements
> presented by Windows, on MSDN.) Mapping each UDK release to a UEFI spec
> version would be a bonus.

Seems like the short answer here is that the config command has a missing error 
condition/printout.  If this has simply stated something like "the required 
protocol (EFI_IP4_CONFIG2_PROTOCOL) was not found." I think we would have 
gotten to the answer a lot closer.

The intention was to replace support for EFI_IP4_CONFIG_PROTOCOL with 
EFI_IP4_CONFIG2_PROTOCOL, we do not believe that we can successfully maintain 
functional support for EFI_IP4_CONFIG_PROTOCOL.

Should (used above) is one of those words where the meaning is vague.  Should 
it do backwards compatibility and if so, for how long?  

-Jaben

> 
> Thanks
> Laszlo
> 
> >
> > Regards,
> >
> > Leif
> >
> >> Thanks
> >> Laszlo
> >>
> >>>
> >>> Greetings
> >>> Johannes
> >>>
> >>> -Ursprüngliche Nachricht-
> >>> Von: Laszlo Ersek [mailto:ler...@redhat.com]
> >>> Gesendet: Dienstag, 10. November 2015 11:06
> >>> An: Conen, Johannes; Wu, Jiaxin; edk2-devel@lists.01.org
> >>> Cc: Leif Lindholm (Linaro address)
> >>> Betreff: Re: [edk2] ShellPkg: Network commands (ifconfig/ping) broken
> >>>
> >>> On 11/10/15 10:49, Conen, Johannes wrote:
> >>>> Hi there,
> >>>>
> >>>> I made my tests with the binary shell from ShellBinPkg from UDK2014,
> >>>> from UDK2015, the current master and a few commits in between and
> >>>> rebuilt the shell from ShellPkg for UDK2014, UDK2015, the current
> >>>> master and a few commits in between UDK2014 and UDK2015.
> >>>>
> >>>> It worked fine with r17868 and didn't work anymore with r17869, so it
> >>>> has to be that commit (I of course rebuilt the shell from ShellPkg).
>

Re: [edk2] [PATCH] PerformancePkg/Dp_App: Support dumping cumulative data

2015-11-09 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Cinnamon Shia
> Sent: Monday, November 09, 2015 6:54 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH] PerformancePkg/Dp_App: Support dumping
> cumulative data
> Importance: High
> 
> Add a new option -c to dump cumulative data.
> For example:
> shell> dp -c
> ==[ Cumulative ]
> (Times in microsec.) Cumulative   Average ShortestLongest
>Name  CountDurationDurationDurationDuration
> LoadImage: 200 1007000   0  10
> StartImage:2002000   9   0 700
>   DB:Start:2002000  10   0 900
> DB:Support: 20  10   0   07000
> 
> shell> dp -c DXE
> ==[ Cumulative ]
> (Times in microsec.) Cumulative   Average ShortestLongest
>Name  CountDurationDurationDurationDuration
> LoadImage: 200 1007000   0  10
> StartImage:2002000   9   0 700
>   DB:Start:2002000  10   0 900
> DB:Support: 20  10   0   07000
> DXE  130003000   03000
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Cinnamon Shia 
> ---
>  PerformancePkg/Dp_App/Dp.c  |  62
> +---
>  PerformancePkg/Dp_App/DpInternal.h  |  10 --
>  PerformancePkg/Dp_App/DpStrings.uni | Bin 36606 -> 38432 bytes
>  PerformancePkg/Dp_App/DpTrace.c |  56
> +---
>  4 files changed, 117 insertions(+), 11 deletions(-)
> 
> diff --git a/PerformancePkg/Dp_App/Dp.c b/PerformancePkg/Dp_App/Dp.c
> index 57144a8..0f61b9d 100644
> --- a/PerformancePkg/Dp_App/Dp.c
> +++ b/PerformancePkg/Dp_App/Dp.c
> @@ -14,6 +14,7 @@
>timer information to calculate elapsed time for each measurement.
> 
>Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.
> +  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -81,6 +82,7 @@ PARAM_ITEM_LIST  ParamList[] = {
>  #endif
>{STRING_TOKEN (STR_DP_OPTION_LX), TypeFlag},   // -x   eXclude
> Cumulative Items
>{STRING_TOKEN (STR_DP_OPTION_LI), TypeFlag},   // -i   Display Identifier
> +  {STRING_TOKEN (STR_DP_OPTION_LC), TypeValue},  // -c   Display
> cumulative data.
>{STRING_TOKEN (STR_DP_OPTION_LN), TypeValue},  // -n # Number of
> records to display for A and R
>{STRING_TOKEN (STR_DP_OPTION_LT), TypeValue}   // -t # Threshold of
> interest
>};
> @@ -138,6 +140,7 @@ ShowHelp( void )
>PrintToken (STRING_TOKEN (STR_DP_HELP_THRESHOLD));
>PrintToken (STRING_TOKEN (STR_DP_HELP_COUNT));
>PrintToken (STRING_TOKEN (STR_DP_HELP_ID));
> +  PrintToken (STRING_TOKEN (STR_DP_HELP_CUM_DATA));
>PrintToken (STRING_TOKEN (STR_DP_HELP_HELP));
>Print(L"\n");
>  }
> @@ -168,7 +171,26 @@ DumpStatistics( void )
>FreePool (StringPtrUnknown);
>  }
> 
> -/**
> +/**
> +  Initialize the cumulative data.
> +
> +**/
> +VOID
> +InitCumulativeData (
> +  VOID
> +  )
> +{
> +  UINTN Index;
> +
> +  for (Index = 0; Index < NumCum; ++Index) {
> +CumData[Index].Count = 0;
> +CumData[Index].MinDur = PERF_MAXDUR;
> +CumData[Index].MaxDur = 0;
> +CumData[Index].Duration = 0;
> +  }
> +}
> +
> +/**
>Dump performance data.
> 
>@param[in]  ImageHandle The image handle.
> @@ -203,6 +225,9 @@ InitializeDp (
>BOOLEAN   TraceMode;
>BOOLEAN   ProfileMode;
>BOOLEAN   ExcludeMode;
> +  BOOLEAN   CumulativeMode;
> +  CONST CHAR16  *CustomCumulativeToken;
> +  PERF_CUM_DATA *CustomCumulativeData;
> 
>EFI_STRINGStringDpOptionQh;
>EFI_STRINGStringDpOptionLh;
> @@ -218,6 +243,7 @@ InitializeDp (
>EFI_STRINGStringDpOptionLn;
>EFI_STRINGStringDpOptionLt;
>EFI_STRINGStringDpOptionLi;
> +  EFI_STRINGStringDpOptionLc;
> 
>SummaryMode = FALSE;
>VerboseMode = 

Re: [edk2] [PATCH 4/4] AppPkg/Python-2.7.10: AppPkg.dsc, pyconfig.h, PyMod-2.7.10 (resend)

2015-11-09 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Daryl McDaniel
> Sent: Saturday, November 07, 2015 11:46 AM
> To: edk2-devel@lists.01.org; Carsey, Jaben ;
> Bjorge, Erik C 
> Subject: [edk2] [PATCH 4/4] AppPkg/Python-2.7.10: AppPkg.dsc, pyconfig.h,
> PyMod-2.7.10 (resend)
> Importance: High
> 
> Resent using git send-email.  Maybe this will be easier to use.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> ---
>  AppPkg/AppPkg.dsc  |   5 +-
>  .../Python/Python-2.7.10/Ia32/pyconfig.h   |  93 
>  .../Python-2.7.10/PyMod-2.7.10/Lib/ntpath.py   |  30 +++-
>  .../Python/Python-2.7.10/PyMod-2.7.10/Lib/os.py|  35 -
>  .../Python/Python-2.7.10/PyMod-2.7.10/Lib/pydoc.py |  17 +++
>  .../Python/Python-2.7.10/PyMod-2.7.10/Lib/site.py  | 165 
> ++---
>  .../Python-2.7.10/PyMod-2.7.10/Modules/_sre.c  | 150 ++-
>  .../Python-2.7.10/PyMod-2.7.10/Modules/addrinfo.h  | 101 +++--
>  .../PyMod-2.7.10/Modules/errnomodule.c |  57 ++-
>  .../PyMod-2.7.10/Modules/expat/expat_external.h|   4 +-
>  .../Python-2.7.10/PyMod-2.7.10/Modules/getpath.c   | 143 +-
>  .../Python-2.7.10/PyMod-2.7.10/Modules/main.c  |  61 
>  .../PyMod-2.7.10/Modules/selectmodule.c|  43 --
>  .../PyMod-2.7.10/Modules/zlib/gzguts.h |  10 +-
>  .../PyMod-2.7.10/Modules/zlib/zutil.h  |  11 +-
>  .../PyMod-2.7.10/Objects/longobject.c  |  14 +-
>  .../PyMod-2.7.10/Objects/stringlib/localeutil.h|  17 ++-
>  .../PyMod-2.7.10/Python/getcopyright.c |  24 ++-
>  .../Python-2.7.10/PyMod-2.7.10/Python/marshal.c|  21 ++-
>  .../Python-2.7.10/PyMod-2.7.10/Python/random.c |  32 +++-
>  .../Python/Python-2.7.10/X64/pyconfig.h|  63 ++--
>  21 files changed, 640 insertions(+), 456 deletions(-)
> 
> diff --git a/AppPkg/AppPkg.dsc b/AppPkg/AppPkg.dsc
> index 6db32a1..58bc84e 100644
> --- a/AppPkg/AppPkg.dsc
> +++ b/AppPkg/AppPkg.dsc
> @@ -126,9 +126,12 @@
>gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80400040
>}
> 
> - Un-comment the following line to build Python.
> + Un-comment the following line to build Python 2.7.2.
>  #  AppPkg/Applications/Python/PythonCore.inf
> 
> + Un-comment the following line to build Python 2.7.10.
> +# AppPkg/Applications/Python/Python-2.7.10/Python2710.inf
> +
>   Un-comment the following line to build Lua.
>  #  AppPkg/Applications/Lua/Lua.inf
> 
> diff --git a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> index 99b3422..00cfd54 100644
> --- a/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> +++ b/AppPkg/Applications/Python/Python-2.7.10/Ia32/pyconfig.h
> @@ -1,6 +1,7 @@
>  /** @file
>  Manually generated Python Configuration file for EDK II.
> 
> +Copyright (c) 2015, Daryl McDaniel. All rights reserved.
>  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.
>  This program and the accompanying materials are licensed and made
> available under
>  the terms and conditions of the BSD License that accompanies this
> distribution.
> @@ -67,6 +68,9 @@
>  /* Define to 1 if you have the 'alarm' function. */
>  #undef HAVE_ALARM
> 
> +/* Define to 1 if you have the  header file. */
> +#undef HAVE_ALLOCA_H
> +
>  /* Define this if your time.h defines altzone. */
>  #undef HAVE_ALTZONE
> 
> @@ -109,6 +113,9 @@
>  /* define to 1 if your sem_getvalue is broken. */
>  #define HAVE_BROKEN_SEM_GETVALUE  1
> 
> +/* Define if 'unsetenv' does not return an int. */
> +#undef HAVE_BROKEN_UNSETENV
> +
>  /* Define this if you have the type _Bool. */
>  #define HAVE_C99_BOOL 1
> 
> @@ -170,10 +177,10 @@
>  /* Define to 1 if you have the device macros. */
>  #undef HAVE_DEVICE_MACROS
> 
> -/* Define if we have /dev/ptc. */
> +/* Define to 1 if you have the /dev/ptc device file. */
>  #undef HAVE_DEV_PTC
> 
> -/* Define if we have /dev/ptmx. */
> +/* Define to 1 if you have the /dev/ptmx device file. */
>  #undef HAVE_DEV_PTMX
> 
>  /* Define to 1 if you have the  header file. */
> @@ -274,11 +281,11 @@
>  #undef HAVE_GAMMA
> 
>  /* Define if we can use gcc inline assembler to get and set x87 control word
> -*/
> +   */
>  #if defined(__GNUC__)
>#define HAVE_GCC_ASM_FOR_X87  1
>  #else
> -  #undef HAVE_GCC_ASM_FOR_X87
> +#undef HAVE_GCC_ASM_FOR_X87
>  #

Re: [edk2] [PATCH] ShellPkg: Don't strip positional parameters of quotation marks.

2015-11-06 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Qiu, Shumin
> Sent: Friday, November 06, 2015 12:06 AM
> To: edk2-devel@lists.01.org
> Cc: Qiu, Shumin ; Carsey, Jaben
> 
> Subject: [PATCH] ShellPkg: Don't strip positional parameters of quotation
> marks.
> Importance: High
> 
> Per Shell SPEC 2.1 'Double-quotation marks that surround arguments are not
> stripped in positional parameters'. This patch makes Shell implementation to
> follow SPEC.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Qiu Shumin 
> ---
>  ShellPkg/Application/Shell/Shell.c | 30 ++---
>  ShellPkg/Application/Shell/Shell.h |  8 
>  .../Application/Shell/ShellParametersProtocol.c| 52 ---
> ---
>  .../Application/Shell/ShellParametersProtocol.h| 36 ++-
>  ShellPkg/Application/Shell/ShellProtocol.c |  2 +-
>  5 files changed, 80 insertions(+), 48 deletions(-)
> 
> diff --git a/ShellPkg/Application/Shell/Shell.c
> b/ShellPkg/Application/Shell/Shell.c
> index cb9d969..8af6647 100644
> --- a/ShellPkg/Application/Shell/Shell.c
> +++ b/ShellPkg/Application/Shell/Shell.c
> @@ -1863,7 +1863,7 @@ IsValidSplit(
>return (EFI_OUT_OF_RESOURCES);
>  }
>  TempWalker = (CHAR16*)Temp;
> -if (!EFI_ERROR(GetNextParameter(&TempWalker, &FirstParameter,
> StrSize(CmdLine {
> +if (!EFI_ERROR(GetNextParameter(&TempWalker, &FirstParameter,
> StrSize(CmdLine), TRUE))) {
>if (GetOperationType(FirstParameter) == Unknown_Invalid) {
>  ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_SHELL_NOT_FOUND),
> ShellInfoObject.HiiHandle, FirstParameter);
>  SetLastError(SHELL_NOT_FOUND);
> @@ -2029,7 +2029,7 @@ DoHelpUpdate(
> 
>Walker = *CmdLine;
>while(Walker != NULL && *Walker != CHAR_NULL) {
> -if (!EFI_ERROR(GetNextParameter(&Walker, &CurrentParameter,
> StrSize(*CmdLine {
> +if (!EFI_ERROR(GetNextParameter(&Walker, &CurrentParameter,
> StrSize(*CmdLine), TRUE))) {
>if (StrStr(CurrentParameter, L"-?") == CurrentParameter) {
>  CurrentParameter[0] = L' ';
>  CurrentParameter[1] = L' ';
> @@ -2173,7 +2173,7 @@ RunInternalCommand(
>//
>// get the argc and argv updated for internal commands
>//
> -  Status = UpdateArgcArgv(ParamProtocol, NewCmdLine, &Argv, &Argc);
> +  Status = UpdateArgcArgv(ParamProtocol, NewCmdLine, Internal_Command,
> &Argv, &Argc);
>if (!EFI_ERROR(Status)) {
>  //
>  // Run the internal command.
> @@ -2520,7 +2520,7 @@ RunShellCommand(
>  return (EFI_OUT_OF_RESOURCES);
>}
>TempWalker = CleanOriginal;
> -  if (!EFI_ERROR(GetNextParameter(&TempWalker, &FirstParameter,
> StrSize(CleanOriginal {
> +  if (!EFI_ERROR(GetNextParameter(&TempWalker, &FirstParameter,
> StrSize(CleanOriginal), TRUE))) {
>  //
>  // Depending on the first parameter we change the behavior
>  //
> @@ -2767,34 +2767,34 @@ RunScriptFileHandle (
>if (NewScriptFile->Argv != NULL) {
>  switch (NewScriptFile->Argc) {
>default:
> -Status = ShellCopySearchAndReplace(CommandLine2,  CommandLine,
> PrintBuffSize, L"%9", NewScriptFile->Argv[9], FALSE, TRUE);
> +Status = ShellCopySearchAndReplace(CommandLine2,  CommandLine,
> PrintBuffSize, L"%9", NewScriptFile->Argv[9], FALSE, FALSE);
>  ASSERT_EFI_ERROR(Status);
>case 9:
> -Status = ShellCopySearchAndReplace(CommandLine,  CommandLine2,
> PrintBuffSize, L"%8", NewScriptFile->Argv[8], FALSE, TRUE);
> +Status = ShellCopySearchAndReplace(CommandLine,  CommandLine2,
> PrintBuffSize, L"%8", NewScriptFile->Argv[8], FALSE, FALSE);
>  ASSERT_EFI_ERROR(Status);
>case 8:
> -Status = ShellCopySearchAndReplace(CommandLine2,  CommandLine,
> PrintBuffSize, L"%7", NewScriptFile->Argv[7], FALSE, TRUE);
> +Status = ShellCopySearchAndReplace(CommandLine2,  CommandLine,
> PrintBuffSize, L"%7", NewScriptFile->Argv[7], FALSE, FALSE);
>  ASSERT_EFI_ERROR(Status);
>case 7:
> -Status = ShellCopySearchAndReplace(CommandLine,  CommandLine2,
> PrintBuffSize, L"%6", NewScriptFile->Argv[6], FALSE, TRUE);
> +Status = ShellCopySearchAndReplace(CommandLine,  CommandLine2,
> PrintBuffSize, L"%6", NewScriptFile->Argv[6], FALSE, FALSE);
>

[edk2] [PATCH] ShellBinPkg: Update INF with Protocols section

2015-11-05 Thread Carsey, Jaben
Shumin,

Can you review this please?

ShellBinPkg: Update INF with Protocols section

Add missing section for the binary shell INF file.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Jaben Carsey 
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data issue

2015-11-04 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zeng, Star
> Sent: Tuesday, November 03, 2015 5:01 PM
> To: Cinnamon Shia ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH v3 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative
> data issue
> Importance: High
> 
> On 2015/11/4 0:55, Cinnamon Shia wrote:
> > The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
> > keep cumulating on every execution of dp.
> > Initialize the CumData at dp's entry point.
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Cinnamon Shia 
> > ---
> >   ShellPkg/Library/UefiDpLib/Dp.c | 27 ++-
> >   1 file changed, 26 insertions(+), 1 deletion(-)
> 
> Reviewed-by: Star Zeng 
> 
> >
> > diff --git a/ShellPkg/Library/UefiDpLib/Dp.c
> b/ShellPkg/Library/UefiDpLib/Dp.c
> > index 8270172..62a4e7b 100644
> > --- a/ShellPkg/Library/UefiDpLib/Dp.c
> > +++ b/ShellPkg/Library/UefiDpLib/Dp.c
> > @@ -14,6 +14,7 @@
> > timer information to calculate elapsed time for each measurement.
> >
> > Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
> > +  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> > This program and the accompanying materials
> > are licensed and made available under the terms and conditions of the
> BSD License
> > which accompanies this distribution.  The full text of the license may 
> > be
> found at
> > @@ -110,7 +111,26 @@ DumpStatistics( void )
> > SHELL_FREE_NON_NULL (StringPtrUnknown);
> >   }
> >
> > -/**
> > +/**
> > +  Initialize the cumulative data.
> > +
> > +**/
> > +VOID
> > +InitCumulativeData (
> > +  VOID
> > +  )
> > +{
> > +  UINTN Index;
> > +
> > +  for (Index = 0; Index < NumCum; ++Index) {
> > +CumData[Index].Count = 0;
> > +CumData[Index].MinDur = PERF_MAXDUR;
> > +CumData[Index].MaxDur = 0;
> > +CumData[Index].Duration = 0;
> > +  }
> > +}
> > +
> > +/**
> > Dump performance data.
> >
> > @param[in]  ImageHandle The image handle.
> > @@ -219,6 +239,11 @@ ShellCommandRunDp (
> > }
> >
> > //
> > +  // Initialize the pre-defined cumulative data.
> > +  //
> > +  InitCumulativeData ();
> > +
> > +  //
> > // Timer specific processing
> > //
> > // Get the Performance counter characteristics:
> >
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH v3 2/2] ShellPkg/UefiDpLib: Support dumping cumulative data

2015-11-04 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Zeng, Star
> Sent: Tuesday, November 03, 2015 5:01 PM
> To: Cinnamon Shia ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH v3 2/2] ShellPkg/UefiDpLib: Support dumping
> cumulative data
> Importance: High
> 
> On 2015/11/4 0:55, Cinnamon Shia wrote:
> > Add a new option -c to dump cumulative data.
> > For example:
> > shell> dp -c
> > ==[ Cumulative ]
> > (Times in microsec.) Cumulative   Average ShortestLongest
> > Name  CountDurationDurationDurationDuration
> > LoadImage: 200 1007000   0  10
> > StartImage:2002000   9   0 700
> >DB:Start:2002000  10   0 900
> > DB:Support: 20  10   0   07000
> >
> > shell> dp -c DXE
> > ==[ Cumulative ]
> > (Times in microsec.) Cumulative   Average ShortestLongest
> > Name  CountDurationDurationDurationDuration
> > LoadImage: 200 1007000   0  10
> > StartImage:2002000   9   0 700
> >DB:Start:2002000  10   0 900
> > DB:Support: 20  10   0   07000
> >  DXE  130003000   03000
> >
> > Contributed-under: TianoCore Contribution Agreement 1.0
> > Signed-off-by: Cinnamon Shia 
> > ---
> >   ShellPkg/Library/UefiDpLib/Dp.c  |  33 +--
> >   ShellPkg/Library/UefiDpLib/DpInternal.h  |   9 +++--
> >   ShellPkg/Library/UefiDpLib/DpTrace.c |  55
> ---
> >   ShellPkg/Library/UefiDpLib/UefiDpLib.uni | Bin 17466 -> 18146 bytes
> >   4 files changed, 87 insertions(+), 10 deletions(-)
> 
> Reviewed-by: Star Zeng 
> 
> >
> > diff --git a/ShellPkg/Library/UefiDpLib/Dp.c
> b/ShellPkg/Library/UefiDpLib/Dp.c
> > index 62a4e7b..4d109d0 100644
> > --- a/ShellPkg/Library/UefiDpLib/Dp.c
> > +++ b/ShellPkg/Library/UefiDpLib/Dp.c
> > @@ -79,6 +79,7 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = {
> >   #endif // PROFILING_IMPLEMENTED
> > {L"-x", TypeFlag},   // -x   eXclude Cumulative Items
> > {L"-i", TypeFlag},   // -i   Display Identifier
> > +  {L"-c", TypeValue},  // -c   Display cumulative data.
> > {L"-n", TypeValue},  // -n # Number of records to display for A and R
> > {L"-t", TypeValue},  // -t # Threshold of interest
> > {NULL, TypeMax}
> > @@ -164,6 +165,9 @@ ShellCommandRunDp (
> > BOOLEAN   TraceMode;
> > BOOLEAN   ProfileMode;
> > BOOLEAN   ExcludeMode;
> > +  BOOLEAN   CumulativeMode;
> > +  CONST CHAR16  *CustomCumulativeToken;
> > +  PERF_CUM_DATA *CustomCumulativeData;
> >
> > StringPtr   = NULL;
> > SummaryMode = FALSE;
> > @@ -173,6 +177,8 @@ ShellCommandRunDp (
> > TraceMode   = FALSE;
> > ProfileMode = FALSE;
> > ExcludeMode = FALSE;
> > +  CumulativeMode = FALSE;
> > +  CustomCumulativeData = NULL;
> >
> > // Get DP's entry time as soon as possible.
> > // This is used as the Shell-Phase end time.
> > @@ -210,6 +216,7 @@ ShellCommandRunDp (
> >   #endif  // PROFILING_IMPLEMENTED
> > ExcludeMode = ShellCommandLineGetFlag (ParamPackage, L"-x");
> > mShowId = ShellCommandLineGetFlag (ParamPackage, L"-i");
> > +  CumulativeMode = ShellCommandLineGetFlag (ParamPackage, L"-c");
> >
> > // Options with Values
> > CmdLineArg  = ShellCommandLineGetValue (ParamPackage, L"-n");
> > @@ -244,6 +251,20 @@ ShellCommandRunDp (
> > InitCumulativeData ();
> >
> > //
> > +  // Init the custom cumulative data.
> > +  //
> > +  CustomCumulativeToken = ShellCommandLineGetValue (ParamPackage,
> L"-c");
> > +  if (CustomCumulativeToken != NULL) {
> > +CustomCumulativeData = AllocateZeroPool (sizeof (PERF_CUM_DATA));
> > +CustomCumulativeData->MinDur = 0;
> > +CustomCumulativeData->MaxDur = 0;
> > +CustomCumulativeData->Count  = 0;
> > +CustomCumulativeData->Duration = 0;
> > +Cu

Re: [edk2] [Patch v2 1/1] AppPkg/Python remove improper characters from pyconfig.h

2015-11-03 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Tuesday, November 03, 2015 10:37 AM
> To: edk2-devel@lists.01.org; Carsey, Jaben ;
> Bjorge, Erik C ; Rosenbaum, Lee G
> 
> Subject: [Patch v2 1/1] AppPkg/Python remove improper characters from
> pyconfig.h
> Importance: High
> 
> AppPkg: Within the Ia32 and X64 pyconfig.h files, there are 178 occurrences
> of an accent character, `, being used instead of a regular single quote, ',
> within comments.
> 
> Replace all occurrences of ` within comments with '.  Example:
> OLD:  `foobar'
> NEW: 'foobar'
> 
> The same changes are applied to both
> AppPkg/Applications/Python/Ia32/pyconfig.h and
> AppPkg/Applications/Python/X64/pyconfig.h.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> 
> *** a/AppPkg/Applications/Python/X64/pyconfig.h-revBASE.svn001.tmp.h
>   Fri
> Mar 23 17:19:06 2012
> --- b/AppPkg/Applications/Python/X64/pyconfig.h   Tue Oct 20 12:43:43
> 2015
> ***
> *** 58,88 
>  the case on Motorola V4 (R40V4.2) */
>   #undef GETTIMEOFDAY_NO_TZ
> 
> ! /* Define to 1 if you have the `acosh' function. */
>   #undef HAVE_ACOSH
> 
>   /* struct addrinfo (netdb.h) */
>   #undef HAVE_ADDRINFO
> 
> ! /* Define to 1 if you have the `alarm' function. */
>   #undef HAVE_ALARM
> 
>   /* Define this if your time.h defines altzone. */
>   #undef HAVE_ALTZONE
> 
> ! /* Define to 1 if you have the `asinh' function. */
>   #undef HAVE_ASINH
> 
>   /* Define to 1 if you have the  header file. */
>   #undef HAVE_ASM_TYPES_H
> 
> ! /* Define to 1 if you have the `atanh' function. */
>   #undef HAVE_ATANH
> 
>   /* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))
> */
>   #undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
> 
> ! /* Define to 1 if you have the `bind_textdomain_codeset' function. */
>   #undef HAVE_BIND_TEXTDOMAIN_CODESET
> 
>   /* Define to 1 if you have the  header file. */
> --- 58,88 
>  the case on Motorola V4 (R40V4.2) */
>   #undef GETTIMEOFDAY_NO_TZ
> 
> ! /* Define to 1 if you have the 'acosh' function. */
>   #undef HAVE_ACOSH
> 
>   /* struct addrinfo (netdb.h) */
>   #undef HAVE_ADDRINFO
> 
> ! /* Define to 1 if you have the 'alarm' function. */
>   #undef HAVE_ALARM
> 
>   /* Define this if your time.h defines altzone. */
>   #undef HAVE_ALTZONE
> 
> ! /* Define to 1 if you have the 'asinh' function. */
>   #undef HAVE_ASINH
> 
>   /* Define to 1 if you have the  header file. */
>   #undef HAVE_ASM_TYPES_H
> 
> ! /* Define to 1 if you have the 'atanh' function. */
>   #undef HAVE_ATANH
> 
>   /* Define if GCC supports __attribute__((format(PyArg_ParseTuple, 2, 3)))
> */
>   #undef HAVE_ATTRIBUTE_FORMAT_PARSETUPLE
> 
> ! /* Define to 1 if you have the 'bind_textdomain_codeset' function. */
>   #undef HAVE_BIND_TEXTDOMAIN_CODESET
> 
>   /* Define to 1 if you have the  header file. */
> ***
> *** 112,139 
>   /* Define this if you have the type _Bool. */
>   #define HAVE_C99_BOOL 1
> 
> ! /* Define to 1 if you have the `chflags' function. */
>   #undef HAVE_CHFLAGS
> 
> ! /* Define to 1 if you have the `chown' function. */
>   #undef HAVE_CHOWN
> 
>   /* Define if you have the 'chroot' function. */
>   #undef HAVE_CHROOT
> 
> ! /* Define to 1 if you have the `clock' function. */
>   #define HAVE_CLOCK1
> 
> ! /* Define to 1 if you have the `confstr' function. */
>   #undef HAVE_CONFSTR
> 
>   /* Define to 1 if you have the  header file. */
>   #undef HAVE_CONIO_H
> 
> ! /* Define to 1 if you have the `copysign' function. */
>   #undef HAVE_COPYSIGN
> 
> ! /* Define to 1 if you have the `ctermid' function. */
>   #undef HAVE_CTERMID
> 
>   /* Define if you have the 'ctermid_r' function. */
> --- 112,139 
>   /* Define this if you have the type _Bool. */
>   #define HAVE_C99_BOOL 1
> 
> ! /* Define to 1 if you have the 'chflags' function. */
>   #undef HAVE_CHFLAGS
> 
> ! /* Define to 1 if you have the 'chown' function. */
>   #undef HAVE_CHOWN
> 
>   /* Define if you have the 'chroot' function. */
>   #undef HAVE_CHROOT
> 
> ! /* Define to 1 if you have the 'clock' function. */
>   #define HAVE_CLOCK1
> 
> ! /* Define to 1 if you have the 'confstr' function. *

Re: [edk2] [Patch 1/1] AppPkg/Python remove improper characters from pyconfig.h

2015-11-03 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Bjorge, Erik C
> Sent: Tuesday, November 03, 2015 10:43 AM
> To: Daryl McDaniel ; edk2-devel@lists.01.org;
> Carsey, Jaben ; Rosenbaum, Lee G
> 
> Subject: RE: [Patch 1/1] AppPkg/Python remove improper characters from
> pyconfig.h
> Importance: High
> 
> Reviewed-by: Erik Bjorge 
> 
> -Original Message-
> From: Daryl McDaniel [mailto:edk2-li...@mc2research.org]
> Sent: Tuesday, November 3, 2015 10:29 AM
> To: edk2-devel@lists.01.org; Carsey, Jaben ;
> Bjorge, Erik C ; Rosenbaum, Lee G
> 
> Subject: [Patch 1/1] AppPkg/Python remove improper characters from
> pyconfig.h
> 
> AppPkg: Within the Ia32 and X64 pyconfig.h files, there are 178 occurrences
> of an accent character, `, being used instead of a regular single quote, ',
> within comments.
> 
> Replace all occurrences of ` within comments with '.  Example:
> OLD:  `foobar'
> NEW: 'foobar'
> 
> The same changes are applied to both
> AppPkg/Applications/Python/Ia32/pyconfig.h and
> AppPkg/Applications/Python/X64/pyconfig.h.
> 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Daryl McDaniel 
> 
> 
> Changes are detailed in the attached patch file.
> 
> Sincerely,
> Daryl McDaniel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH] ShellPkg UefiDpLib: Use correct string length for the input UnicodeBuffer

2015-11-03 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: Zeng, Star
> Sent: Monday, November 02, 2015 8:02 PM
> To: edk2-devel@lists.01.org
> Cc: Carsey, Jaben 
> Subject: [PATCH] ShellPkg UefiDpLib: Use correct string length for the input
> UnicodeBuffer
> Importance: High
> 
> Same as the beginning of function to use DP_GAUGE_STRING_LENGTH, but not
> DXE_PERFORMANCE_STRING_LENGTH.
> 
> Cc: Jaben Carsey 
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Star Zeng 
> ---
>  ShellPkg/Library/UefiDpLib/DpUtilities.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/ShellPkg/Library/UefiDpLib/DpUtilities.c
> b/ShellPkg/Library/UefiDpLib/DpUtilities.c
> index 5237459..e9d8fb3 100644
> --- a/ShellPkg/Library/UefiDpLib/DpUtilities.c
> +++ b/ShellPkg/Library/UefiDpLib/DpUtilities.c
> @@ -164,8 +164,8 @@ DpGetShortPdbFileName (
>  for (IndexA = StartIndex; IndexA < EndIndex; IndexA++) {
>UnicodeBuffer[IndexU] = (CHAR16) PdbFileName[IndexA];
>IndexU++;
> -  if (IndexU >= DXE_PERFORMANCE_STRING_LENGTH) {
> -UnicodeBuffer[DXE_PERFORMANCE_STRING_LENGTH] = 0;
> +  if (IndexU >= DP_GAUGE_STRING_LENGTH) {
> +UnicodeBuffer[DP_GAUGE_STRING_LENGTH] = 0;
>  break;
>}
>  }
> --
> 1.9.5.msysgit.0

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data issue

2015-11-03 Thread Carsey, Jaben

> -Original Message-
> From: Zeng, Star
> Sent: Monday, November 02, 2015 7:13 PM
> To: Carsey, Jaben ; Cinnamon Shia
> ; edk2-devel@lists.01.org
> Subject: Re: [edk2] [PATCH 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data
> issue
> Importance: High
> 
> On 2015/11/3 1:12, Carsey, Jaben wrote:
> > Reviewed-by: Jaben Carsey 
> >
> >> -Original Message-
> >> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> >> Cinnamon Shia
> >> Sent: Monday, November 02, 2015 1:12 AM
> >> To: edk2-devel@lists.01.org
> >> Subject: [edk2] [PATCH 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data
> >> issue
> >> Importance: High
> >>
> >> The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
> >> keep cumulating on every execution of dp.
> >> Initialize the CumData at dp's entry point.
> >>
> >> Signed-off-by: Cinnamon Shia 
> >> ---
> >>   ShellPkg/Library/UefiDpLib/Dp.c | 27 ++-
> >>   1 file changed, 26 insertions(+), 1 deletion(-)
> >>
> >> diff --git a/ShellPkg/Library/UefiDpLib/Dp.c
> b/ShellPkg/Library/UefiDpLib/Dp.c
> >> index 8270172..62a4e7b 100644
> >> --- a/ShellPkg/Library/UefiDpLib/Dp.c
> >> +++ b/ShellPkg/Library/UefiDpLib/Dp.c
> 
> This patch is not needed for PerformancePkg\Dp_App as
> PerformancePkg\Dp_App is a standalone application.
> 
> Thanks,
> Star

Star,

This is for the DP library that allows the command to be built into the shell, 
not the application.  I am confused by your comment.

-Jaben

> 
> >> @@ -14,6 +14,7 @@
> >> timer information to calculate elapsed time for each measurement.
> >>
> >> Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
> >> +  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
> >> This program and the accompanying materials
> >> are licensed and made available under the terms and conditions of the
> BSD
> >> License
> >> which accompanies this distribution.  The full text of the license may 
> >> be
> >> found at
> >> @@ -110,7 +111,26 @@ DumpStatistics( void )
> >> SHELL_FREE_NON_NULL (StringPtrUnknown);
> >>   }
> >>
> >> -/**
> >> +/**
> >> +  Initialize the cumulative data.
> >> +
> >> +**/
> >> +VOID
> >> +InitCumulativeData (
> >> +  VOID
> >> +  )
> >> +{
> >> +  UINTN Index;
> >> +
> >> +  for (Index = 0; Index < NumCum; ++Index) {
> >> +CumData[Index].Count = 0;
> >> +CumData[Index].MinDur = PERF_MAXDUR;
> >> +CumData[Index].MaxDur = 0;
> >> +CumData[Index].Duration = 0;
> >> +  }
> >> +}
> >> +
> >> +/**
> >> Dump performance data.
> >>
> >> @param[in]  ImageHandle The image handle.
> >> @@ -219,6 +239,11 @@ ShellCommandRunDp (
> >> }
> >>
> >> //
> >> +  // Initialize the pre-defined cumulative data.
> >> +  //
> >> +  InitCumulativeData ();
> >> +
> >> +  //
> >> // Timer specific processing
> >> //
> >> // Get the Performance counter characteristics:
> >> --
> >> 1.9.5.msysgit.1
> >>
> >> ___
> >> edk2-devel mailing list
> >> edk2-devel@lists.01.org
> >> https://lists.01.org/mailman/listinfo/edk2-devel

___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


Re: [edk2] [PATCH 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data issue

2015-11-02 Thread Carsey, Jaben
Reviewed-by: Jaben Carsey 

> -Original Message-
> From: edk2-devel [mailto:edk2-devel-boun...@lists.01.org] On Behalf Of
> Cinnamon Shia
> Sent: Monday, November 02, 2015 1:12 AM
> To: edk2-devel@lists.01.org
> Subject: [edk2] [PATCH 1/2] ShellPkg/UefiDpLib: Fix a DP cumulative data
> issue
> Importance: High
> 
> The value of PERF_CUM_DATA.Count and PERF_CUM_DATA.Duration field
> keep cumulating on every execution of dp.
> Initialize the CumData at dp's entry point.
> 
> Signed-off-by: Cinnamon Shia 
> ---
>  ShellPkg/Library/UefiDpLib/Dp.c | 27 ++-
>  1 file changed, 26 insertions(+), 1 deletion(-)
> 
> diff --git a/ShellPkg/Library/UefiDpLib/Dp.c b/ShellPkg/Library/UefiDpLib/Dp.c
> index 8270172..62a4e7b 100644
> --- a/ShellPkg/Library/UefiDpLib/Dp.c
> +++ b/ShellPkg/Library/UefiDpLib/Dp.c
> @@ -14,6 +14,7 @@
>timer information to calculate elapsed time for each measurement.
> 
>Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.
> +  (C) Copyright 2015 Hewlett Packard Enterprise Development LP
>This program and the accompanying materials
>are licensed and made available under the terms and conditions of the BSD
> License
>which accompanies this distribution.  The full text of the license may be
> found at
> @@ -110,7 +111,26 @@ DumpStatistics( void )
>SHELL_FREE_NON_NULL (StringPtrUnknown);
>  }
> 
> -/**
> +/**
> +  Initialize the cumulative data.
> +
> +**/
> +VOID
> +InitCumulativeData (
> +  VOID
> +  )
> +{
> +  UINTN Index;
> +
> +  for (Index = 0; Index < NumCum; ++Index) {
> +CumData[Index].Count = 0;
> +CumData[Index].MinDur = PERF_MAXDUR;
> +CumData[Index].MaxDur = 0;
> +CumData[Index].Duration = 0;
> +  }
> +}
> +
> +/**
>Dump performance data.
> 
>@param[in]  ImageHandle The image handle.
> @@ -219,6 +239,11 @@ ShellCommandRunDp (
>}
> 
>//
> +  // Initialize the pre-defined cumulative data.
> +  //
> +  InitCumulativeData ();
> +
> +  //
>// Timer specific processing
>//
>// Get the Performance counter characteristics:
> --
> 1.9.5.msysgit.1
> 
> ___
> edk2-devel mailing list
> edk2-devel@lists.01.org
> https://lists.01.org/mailman/listinfo/edk2-devel
___
edk2-devel mailing list
edk2-devel@lists.01.org
https://lists.01.org/mailman/listinfo/edk2-devel


<    5   6   7   8   9   10   11   >