VirtualBox

Ignore:
Timestamp:
Sep 11, 2019 8:46:37 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
133262
Message:

Devices/EFI/FirmwareNew: Start upgrade process to edk2-stable201908 (compiles on Windows and works to some extent), bugref:4643

Location:
trunk/src/VBox/Devices/EFI/FirmwareNew
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/EFI/FirmwareNew

  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleLogger.c

    r77662 r80721  
    55  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
    66  (C) Copyright 2016 Hewlett-Packard Development Company, L.P.<BR>
    7   This program and the accompanying materials
    8   are licensed and made available under the terms and conditions of the BSD License
    9   which accompanies this distribution.  The full text of the license may be found at
    10   http://opensource.org/licenses/bsd-license.php
    11 
    12   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    13   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     7  SPDX-License-Identifier: BSD-2-Clause-Patent
    148**/
    159
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleLogger.h

    r77662 r80721  
    33
    44  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5   This program and the accompanying materials
    6   are licensed and made available under the terms and conditions of the BSD License
    7   which accompanies this distribution.  The full text of the license may be found at
    8   http://opensource.org/licenses/bsd-license.php
    9 
    10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  SPDX-License-Identifier: BSD-2-Clause-Patent
    126**/
    137
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleWrappers.c

    r77662 r80721  
    33
    44  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
    5   Copyright (c) 2010 - 2015, Intel Corporation. All rights reserved.<BR>
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD License
    8   which accompanies this distribution.  The full text of the license may be found at
    9   http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     6  SPDX-License-Identifier: BSD-2-Clause-Patent
    137
    148**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ConsoleWrappers.h

    r77662 r80721  
    33
    44  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
    5   Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD License
    8   which accompanies this distribution.  The full text of the license may be found at
    9   http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  Copyright (c) 2010 - 2018, Intel Corporation. All rights reserved.<BR>
     6  SPDX-License-Identifier: BSD-2-Clause-Patent
    137
    148**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleInternal.h

    r77662 r80721  
    33
    44  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5   This program and the accompanying materials
    6   are licensed and made available under the terms and conditions of the BSD License
    7   which accompanies this distribution.  The full text of the license may be found at
    8   http://opensource.org/licenses/bsd-license.php
    9 
    10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  SPDX-License-Identifier: BSD-2-Clause-Patent
    126
    137**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleWrappers.c

    r77662 r80721  
    66  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
    77  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
    8   This program and the accompanying materials
    9   are licensed and made available under the terms and conditions of the BSD License
    10   which accompanies this distribution.  The full text of the license may be found at
    11   http://opensource.org/licenses/bsd-license.php
    12 
    13   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    14   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     8  SPDX-License-Identifier: BSD-2-Clause-Patent
    159
    1610**/
     
    11491143EFIAPI
    11501144FileInterfaceEnvRead(
    1151   IN EFI_FILE_PROTOCOL *This,
    1152   IN OUT UINTN *BufferSize,
    1153   OUT VOID *Buffer
    1154   )
    1155 {
    1156   return (SHELL_GET_ENVIRONMENT_VARIABLE(
    1157     ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,
    1158     BufferSize,
    1159     Buffer));
     1145  IN     EFI_FILE_PROTOCOL *This,
     1146  IN OUT UINTN             *BufferSize,
     1147  OUT    VOID              *Buffer
     1148  )
     1149{
     1150  EFI_STATUS     Status;
     1151
     1152  *BufferSize = *BufferSize / sizeof (CHAR16) * sizeof (CHAR16);
     1153  if (*BufferSize != 0) {
     1154    //
     1155    // Make sure the first unicode character is \xFEFF
     1156    //
     1157    *(CHAR16 *)Buffer = gUnicodeFileTag;
     1158    Buffer            = (CHAR16 *)Buffer + 1;
     1159    *BufferSize      -= sizeof (gUnicodeFileTag);
     1160  }
     1161
     1162  Status = SHELL_GET_ENVIRONMENT_VARIABLE (
     1163             ((EFI_FILE_PROTOCOL_ENVIRONMENT*)This)->Name,
     1164             BufferSize,
     1165             Buffer
     1166             );
     1167  if (!EFI_ERROR (Status) || (Status == EFI_BUFFER_TOO_SMALL)) {
     1168    //
     1169    // BufferSize is valid and needs update when Status is Success or BufferTooSmall.
     1170    //
     1171    *BufferSize += sizeof (gUnicodeFileTag);
     1172  }
     1173  return Status;
    11601174}
    11611175
     
    19251939  )
    19261940{
     1941  EFI_STATUS  Status;
     1942  UINT64      Position;
    19271943  CHAR8       *AsciiStrBuffer;
    19281944  CHAR16      *UscStrBuffer;
    19291945  UINTN       Size;
    1930   UINTN       CharNum;
    1931   EFI_STATUS  Status;
    19321946  if (((EFI_FILE_PROTOCOL_FILE*)This)->Unicode) {
    19331947    //
    19341948    // Unicode
     1949    // There might be different file tag for the Unicode file. We cannot unconditionally insert the \xFEFF.
     1950    // So we choose to leave the file content as is.
    19351951    //
    19361952    return (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, BufferSize, Buffer));
     
    19391955    // Ascii
    19401956    //
    1941     Size  = (*BufferSize) / sizeof(CHAR16);
    1942     AsciiStrBuffer = AllocateZeroPool(Size + sizeof(CHAR8));
     1957    *BufferSize = *BufferSize / sizeof (CHAR16) * sizeof (CHAR16);
     1958    if (*BufferSize == 0) {
     1959      return EFI_SUCCESS;
     1960    }
     1961    Status = ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->GetPosition (((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Position);
     1962    if (EFI_ERROR (Status)) {
     1963      return Status;
     1964    }
     1965    if (Position == 0) {
     1966      //
     1967      // First two bytes in Buffer is for the Unicode file tag.
     1968      //
     1969      *(CHAR16 *)Buffer = gUnicodeFileTag;
     1970      Buffer = (CHAR16 *)Buffer + 1;
     1971      Size   = *BufferSize / sizeof (CHAR16) - 1;
     1972    } else {
     1973      Size   = *BufferSize / sizeof (CHAR16);
     1974    }
     1975    AsciiStrBuffer = AllocateZeroPool (Size + 1);
    19431976    if (AsciiStrBuffer == NULL) {
    19441977      return EFI_OUT_OF_RESOURCES;
    19451978    }
    1946     UscStrBuffer = AllocateZeroPool(*BufferSize + sizeof(CHAR16));
     1979    UscStrBuffer = AllocateZeroPool ((Size + 1) * sizeof(CHAR16));
    19471980    if (UscStrBuffer== NULL) {
    19481981      SHELL_FREE_NON_NULL(AsciiStrBuffer);
    19491982      return EFI_OUT_OF_RESOURCES;
    19501983    }
    1951     Status = (((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read(((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Size, AsciiStrBuffer));
     1984    Status = ((EFI_FILE_PROTOCOL_FILE*)This)->Orig->Read (((EFI_FILE_PROTOCOL_FILE*)This)->Orig, &Size, AsciiStrBuffer);
    19521985    if (!EFI_ERROR(Status)) {
    1953       CharNum = UnicodeSPrint(UscStrBuffer, *BufferSize + sizeof(CHAR16), L"%a", AsciiStrBuffer);
    1954       if (CharNum == Size) {
    1955         CopyMem (Buffer, UscStrBuffer, *BufferSize);
    1956       } else {
    1957         Status = EFI_UNSUPPORTED;
    1958       }
    1959     }
    1960     SHELL_FREE_NON_NULL(AsciiStrBuffer);
    1961     SHELL_FREE_NON_NULL(UscStrBuffer);
    1962     return (Status);
     1986      AsciiStrToUnicodeStrS (AsciiStrBuffer, UscStrBuffer, Size + 1);
     1987      *BufferSize = Size * sizeof (CHAR16);
     1988      CopyMem (Buffer, UscStrBuffer, *BufferSize);
     1989    }
     1990    SHELL_FREE_NON_NULL (AsciiStrBuffer);
     1991    SHELL_FREE_NON_NULL (UscStrBuffer);
     1992    return Status;
    19631993  }
    19641994}
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/FileHandleWrappers.h

    r77662 r80721  
    33
    44  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5   This program and the accompanying materials
    6   are licensed and made available under the terms and conditions of the BSD License
    7   which accompanies this distribution.  The full text of the license may be found at
    8   http://opensource.org/licenses/bsd-license.php
    9 
    10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  SPDX-License-Identifier: BSD-2-Clause-Patent
    126
    137**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.c

    r77662 r80721  
    22  This is THE shell (application)
    33
    4   Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
    55  (C) Copyright 2013-2014 Hewlett-Packard Development Company, L.P.<BR>
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD License
    8   which accompanies this distribution.  The full text of the license may be found at
    9   http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     6  Copyright 2015-2018 Dell Technologies.<BR>
     7  SPDX-License-Identifier: BSD-2-Clause-Patent
    138
    149**/
     
    1002997      ShellInfoObject.ShellInitSettings.BitUnion.Bits.Delay        = TRUE;
    1003998      // Check for optional delay value following "-delay"
    1004       DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
     999      if ((LoopVar + 1) >= gEfiShellParametersProtocol->Argc) {
     1000        DelayValueStr = NULL;
     1001      } else {
     1002        DelayValueStr = gEfiShellParametersProtocol->Argv[LoopVar + 1];
     1003      }
    10051004      if (DelayValueStr != NULL){
    10061005        if (*DelayValueStr == L':') {
     
    11701169    }
    11711170
     1171    InternalEfiShellSetEnv(L"homefilesystem", StartupScriptPath, TRUE);
     1172
    11721173    StartupScriptPath = StrnCatGrow (&StartupScriptPath, &Size, ((FILEPATH_DEVICE_PATH *)FileDevicePath)->PathName, 0);
    11731174    PathRemoveLastItem (StartupScriptPath);
     
    12071208  EFI_INPUT_KEY                 Key;
    12081209  CHAR16                        *FileStringPath;
     1210  CHAR16                        *FullFileStringPath;
    12091211  UINTN                         NewSize;
    12101212
     
    12741276  FileStringPath = LocateStartupScript (ImagePath, FilePath);
    12751277  if (FileStringPath != NULL) {
    1276     Status = RunScriptFile (FileStringPath, NULL, L"", ShellInfoObject.NewShellParametersProtocol);
     1278    FullFileStringPath = FullyQualifyPath(FileStringPath);
     1279    if (FullFileStringPath == NULL) {
     1280      Status = RunScriptFile (FileStringPath, NULL, FileStringPath, ShellInfoObject.NewShellParametersProtocol);
     1281    } else {
     1282      Status = RunScriptFile (FullFileStringPath, NULL, FullFileStringPath, ShellInfoObject.NewShellParametersProtocol);
     1283      FreePool(FullFileStringPath);
     1284    }
    12771285    FreePool (FileStringPath);
    12781286  } else {
     
    24282436  EFI_STATUS                StartStatus;
    24292437  CHAR16                    *CommandWithPath;
     2438  CHAR16                    *FullCommandWithPath;
    24302439  EFI_DEVICE_PATH_PROTOCOL  *DevPath;
    24312440  SHELL_STATUS              CalleeExitStatus;
     
    24732482      switch (Type) {
    24742483        case   Script_File_Name:
    2475           Status = RunScriptFile (CommandWithPath, NULL, CmdLine, ParamProtocol);
     2484          FullCommandWithPath = FullyQualifyPath(CommandWithPath);
     2485          if (FullCommandWithPath == NULL) {
     2486            Status = RunScriptFile (CommandWithPath, NULL, CmdLine, ParamProtocol);
     2487          } else {
     2488            Status = RunScriptFile (FullCommandWithPath, NULL, CmdLine, ParamProtocol);
     2489            FreePool(FullCommandWithPath);
     2490          }
    24762491          break;
    24772492        case   Efi_Application:
     
    27492764{
    27502765  return (RunShellCommand(CmdLine, NULL));
    2751 }
    2752 
    2753 
    2754 STATIC CONST UINT16 InvalidChars[] = {L'*', L'?', L'<', L'>', L'\\', L'/', L'\"', 0x0001, 0x0002};
    2755 /**
    2756   Function determines if the CommandName COULD be a valid command.  It does not determine whether
    2757   this is a valid command.  It only checks for invalid characters.
    2758 
    2759   @param[in] CommandName    The name to check
    2760 
    2761   @retval TRUE              CommandName could be a command name
    2762   @retval FALSE             CommandName could not be a valid command name
    2763 **/
    2764 BOOLEAN
    2765 IsValidCommandName(
    2766   IN CONST CHAR16     *CommandName
    2767   )
    2768 {
    2769   UINTN Count;
    2770   if (CommandName == NULL) {
    2771     ASSERT(FALSE);
    2772     return (FALSE);
    2773   }
    2774   for ( Count = 0
    2775       ; Count < sizeof(InvalidChars) / sizeof(InvalidChars[0])
    2776       ; Count++
    2777      ){
    2778     if (ScanMem16(CommandName, StrSize(CommandName), InvalidChars[Count]) != NULL) {
    2779       return (FALSE);
    2780     }
    2781   }
    2782   return (TRUE);
    27832766}
    27842767
     
    28432826      return (EFI_OUT_OF_RESOURCES);
    28442827    }
    2845     for (LoopVar = 0 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc; LoopVar++) {
     2828    //
     2829    // Put the full path of the script file into Argv[0] as required by section
     2830    // 3.6.2 of version 2.2 of the shell specification.
     2831    //
     2832    NewScriptFile->Argv[0] = StrnCatGrow(&NewScriptFile->Argv[0], NULL, NewScriptFile->ScriptName, 0);
     2833    for (LoopVar = 1 ; LoopVar < 10 && LoopVar < NewScriptFile->Argc; LoopVar++) {
    28462834      ASSERT(NewScriptFile->Argv[LoopVar] == NULL);
    28472835      NewScriptFile->Argv[LoopVar] = StrnCatGrow(&NewScriptFile->Argv[LoopVar], NULL, ShellInfoObject.NewShellParametersProtocol->Argv[LoopVar], 0);
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.h

    r77662 r80721  
    33
    44  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
    5   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD License
    8   which accompanies this distribution.  The full text of the license may be found at
    9   http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     6  SPDX-License-Identifier: BSD-2-Clause-Patent
    137
    148**/
     
    310304  );
    311305
    312 /**
    313   Function determines if the CommandName COULD be a valid command.  It does not determine whether
    314   this is a valid command.  It only checks for invalid characters.
    315 
    316   @param[in] CommandName    The name to check
    317 
    318   @retval TRUE              CommandName could be a command name
    319   @retval FALSE             CommandName could not be a valid command name
    320 **/
    321 BOOLEAN
    322 IsValidCommandName(
    323   IN CONST CHAR16     *CommandName
    324   );
    325306
    326307/**
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.inf

    r77662 r80721  
    33#
    44#  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
    5 #  Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
     5#  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
    66#
    7 #  This program and the accompanying materials
    8 #  are licensed and made available under the terms and conditions of the BSD License
    9 #  which accompanies this distribution. The full text of the license may be found at
    10 #  http://opensource.org/licenses/bsd-license.php
    11 #  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     7#  SPDX-License-Identifier: BSD-2-Clause-Patent
    138#
    149#
     
    2621# The following information is for reference only and not required by the build tools.
    2722#
    28 #  VALID_ARCHITECTURES           = IA32 X64 IPF EBC
     23#  VALID_ARCHITECTURES           = IA32 X64 EBC
    2924#
    3025
     
    10398  gEfiShellPkgTokenSpaceGuid.PcdShellSupportFrameworkHii    ## CONSUMES
    10499  gEfiShellPkgTokenSpaceGuid.PcdShellPageBreakDefault       ## CONSUMES
    105   gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize      ## CONSUMES
    106100  gEfiShellPkgTokenSpaceGuid.PcdShellInsertModeDefault      ## CONSUMES
    107101  gEfiShellPkgTokenSpaceGuid.PcdShellScreenLogCount         ## CONSUMES
    108   gEfiShellPkgTokenSpaceGuid.PcdShellMapNameLength          ## CONSUMES
    109102  gEfiShellPkgTokenSpaceGuid.PcdShellPrintBufferSize        ## CONSUMES
    110103  gEfiShellPkgTokenSpaceGuid.PcdShellForceConsole           ## CONSUMES
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/Shell.uni

    r77662 r80721  
    33// (C) Copyright 2013-2015 Hewlett-Packard Development Company, L.P.<BR>
    44// Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved. <BR>
    5 // This program and the accompanying materials
    6 // are licensed and made available under the terms and conditions of the BSD License
    7 // which accompanies this distribution. The full text of the license may be found at
    8 // http://opensource.org/licenses/bsd-license.php
    9 //
    10 // THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    11 // WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5// SPDX-License-Identifier: BSD-2-Clause-Patent
    126//
    137// Module Name:
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellEnvVar.c

    r77662 r80721  
    22  function declarations for shell environment functions.
    33
    4   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
    5   This program and the accompanying materials
    6   are licensed and made available under the terms and conditions of the BSD License
    7   which accompanies this distribution.  The full text of the license may be found at
    8   http://opensource.org/licenses/bsd-license.php
    9 
    10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     4  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     5  SPDX-License-Identifier: BSD-2-Clause-Patent
    126
    137**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellEnvVar.h

    r77662 r80721  
    77
    88
    9   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
    10   This program and the accompanying materials
    11   are licensed and made available under the terms and conditions of the BSD License
    12   which accompanies this distribution.  The full text of the license may be found at
    13   http://opensource.org/licenses/bsd-license.php
    14 
    15   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    16   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     9  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     10  SPDX-License-Identifier: BSD-2-Clause-Patent
    1711
    1812**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellManParser.c

    r77662 r80721  
    22  Provides interface to shell MAN file parser.
    33
    4   Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     4  Copyright (c) 2009 - 2019, Intel Corporation. All rights reserved.<BR>
    55  Copyright 2015 Dell Inc.
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD License
    8   which accompanies this distribution.  The full text of the license may be found at
    9   http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     6  SPDX-License-Identifier: BSD-2-Clause-Patent
    137
    148**/
     
    4640  }
    4741};
    48 
    49 
    50 /**
    51   Convert a Unicode character to upper case only if
    52   it maps to a valid small-case ASCII character.
    53 
    54   This internal function only deal with Unicode character
    55   which maps to a valid small-case ASCII character, i.e.
    56   L'a' to L'z'. For other Unicode character, the input character
    57   is returned directly.
    58 
    59   @param  Char  The character to convert.
    60 
    61   @retval LowerCharacter   If the Char is with range L'a' to L'z'.
    62   @retval Unchanged        Otherwise.
    63 
    64 **/
    65 CHAR16
    66 InternalShellCharToUpper (
    67   IN CHAR16  Char
    68   );
    6942
    7043/**
     
    417390          State = (BriefDesc == NULL) ? Final : GetBriefDescription;
    418391        }
    419         else if (InternalShellCharToUpper (*Line) != InternalShellCharToUpper (*(Command + CommandIndex++))) {
     392        else if (CharToUpper (*Line) != CharToUpper (*(Command + CommandIndex++))) {
    420393          State = Final;
    421394        }
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellManParser.h

    r77662 r80721  
    33
    44  Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
    5   This program and the accompanying materials
    6   are licensed and made available under the terms and conditions of the BSD License
    7   which accompanies this distribution.  The full text of the license may be found at
    8   http://opensource.org/licenses/bsd-license.php
    9 
    10   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    11   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     5  SPDX-License-Identifier: BSD-2-Clause-Patent
    126
    137**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellParametersProtocol.c

    r77662 r80721  
    66  Copyright (C) 2014, Red Hat, Inc.
    77  (C) Copyright 2013 Hewlett-Packard Development Company, L.P.<BR>
    8   Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
    9   This program and the accompanying materials
    10   are licensed and made available under the terms and conditions of the BSD License
    11   which accompanies this distribution.  The full text of the license may be found at
    12   http://opensource.org/licenses/bsd-license.php
    13 
    14   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    15   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     8  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     9  SPDX-License-Identifier: BSD-2-Clause-Patent
    1610
    1711**/
     
    166160      if (StripQuotation) {
    167161        CopyMem ((CHAR16*)NextDelim, NextDelim + 1, StrSize (NextDelim + 1));
    168           } else{
     162    } else{
    169163        NextDelim++;
    170           }
     164    }
    171165    }
    172166  }
     
    627621}
    628622
    629 /**
    630   Remove the unicode file tag from the begining of the file buffer since that will not be
    631   used by StdIn.
    632 
    633   @param[in]  Handle    Pointer to the handle of the file to be processed.
    634 
    635   @retval EFI_SUCCESS   The unicode file tag has been moved successfully.
    636 **/
    637 EFI_STATUS
    638 RemoveFileTag(
    639   IN SHELL_FILE_HANDLE *Handle
    640   )
    641 {
    642   UINTN             CharSize;
    643   CHAR16            CharBuffer;
    644 
    645   CharSize    = sizeof(CHAR16);
    646   CharBuffer  = 0;
    647   gEfiShellProtocol->ReadFile(*Handle, &CharSize, &CharBuffer);
    648   if (CharBuffer != gUnicodeFileTag) {
    649     gEfiShellProtocol->SetFilePosition(*Handle, 0);
    650   }
    651   return (EFI_SUCCESS);
    652 }
    653623
    654624/**
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellParametersProtocol.h

    r77662 r80721  
    44
    55  Copyright (c) 2009 - 2012, Intel Corporation. All rights reserved.<BR>
    6   This program and the accompanying materials
    7   are licensed and made available under the terms and conditions of the BSD License
    8   which accompanies this distribution.  The full text of the license may be found at
    9   http://opensource.org/licenses/bsd-license.php
    10 
    11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     6  SPDX-License-Identifier: BSD-2-Clause-Patent
    137
    148**/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellProtocol.c

    r77662 r80721  
    55  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
    66  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>
    7   Copyright (c) 2009 - 2017, Intel Corporation. All rights reserved.<BR>
    8   This program and the accompanying materials
    9   are licensed and made available under the terms and conditions of the BSD License
    10   which accompanies this distribution.  The full text of the license may be found at
    11   http://opensource.org/licenses/bsd-license.php
    12 
    13   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    14   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     7  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     8  SPDX-License-Identifier: BSD-2-Clause-Patent
    159
    1610**/
     
    9993}
    10094
    101 /**
    102   Internal worker debug helper function to print out maps as they are added.
    103 
    104   @param[in] Mapping        string mapping that has been added
    105   @param[in] DevicePath     pointer to device path that has been mapped.
    106 
    107   @retval EFI_SUCCESS   the operation was successful.
    108   @return other         an error ocurred
    109 
    110   @sa LocateHandle
    111   @sa OpenProtocol
    112 **/
    113 EFI_STATUS
    114 InternalShellProtocolDebugPrintMessage (
    115   IN CONST CHAR16                   *Mapping,
    116   IN CONST EFI_DEVICE_PATH_PROTOCOL *DevicePath
    117   )
    118 {
    119   EFI_STATUS                        Status;
    120   CHAR16                            *Temp;
    121 
    122   Status = EFI_SUCCESS;
    123   DEBUG_CODE_BEGIN();
    124 
    125   if (Mapping != NULL) {
    126     DEBUG((EFI_D_INFO, "Added new map item:\"%S\"\r\n", Mapping));
    127   }
    128   Temp = ConvertDevicePathToText(DevicePath, TRUE, TRUE);
    129   DEBUG((EFI_D_INFO, "DevicePath: %S\r\n", Temp));
    130   FreePool(Temp);
    131 
    132   DEBUG_CODE_END();
    133   return (Status);
    134 }
    13595
    13696/**
     
    13341294  //
    13351295  DevicePath = EfiShellGetDevicePathFromFilePath(FileName);
    1336 //  DEBUG_CODE(InternalShellProtocolDebugPrintMessage (NULL, DevicePath););
     1296
    13371297  if (DevicePath == NULL) {
    13381298    return (EFI_NOT_FOUND);
     
    22622222}
    22632223
    2264 /**
    2265   Updates a file name to be preceeded by the mapped drive name
    2266 
    2267   @param[in] BasePath      the Mapped drive name to prepend
    2268   @param[in, out] Path     pointer to pointer to the file name to update.
    2269 
    2270   @retval EFI_SUCCESS
    2271   @retval EFI_OUT_OF_RESOURCES
    2272 **/
    2273 EFI_STATUS
    2274 UpdateFileName(
    2275   IN CONST CHAR16 *BasePath,
    2276   IN OUT CHAR16   **Path
    2277   )
    2278 {
    2279   CHAR16              *Path2;
    2280   UINTN               Path2Size;
    2281 
    2282   Path2Size = 0;
    2283   Path2 = NULL;
    2284 
    2285   ASSERT(Path      != NULL);
    2286   ASSERT(*Path     != NULL);
    2287   ASSERT(BasePath  != NULL);
    2288 
    2289   //
    2290   // convert a local path to an absolute path
    2291   //
    2292   if (StrStr(*Path, L":") == NULL) {
    2293     ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
    2294     StrnCatGrow(&Path2, &Path2Size, BasePath, 0);
    2295     if (Path2 == NULL) {
    2296       return (EFI_OUT_OF_RESOURCES);
    2297     }
    2298     ASSERT((Path2 == NULL && Path2Size == 0) || (Path2 != NULL));
    2299     StrnCatGrow(&Path2, &Path2Size, (*Path)[0] == L'\\'?(*Path) + 1 :*Path, 0);
    2300     if (Path2 == NULL) {
    2301       return (EFI_OUT_OF_RESOURCES);
    2302     }
    2303   }
    2304 
    2305   FreePool(*Path);
    2306   (*Path) = Path2;
    2307 
    2308   return (EFI_SUCCESS);
    2309 }
     2224
    23102225
    23112226/**
     
    29252840  // Make sure we dont 'set' a predefined read only variable
    29262841  //
    2927   if (gUnicodeCollation->StriColl(
    2928         gUnicodeCollation,
    2929         (CHAR16*)Name,
    2930         L"cwd") == 0
    2931     ||gUnicodeCollation->StriColl(
    2932         gUnicodeCollation,
    2933         (CHAR16*)Name,
    2934         L"Lasterror") == 0
    2935     ||gUnicodeCollation->StriColl(
    2936         gUnicodeCollation,
    2937         (CHAR16*)Name,
    2938         L"profiles") == 0
    2939     ||gUnicodeCollation->StriColl(
    2940         gUnicodeCollation,
    2941         (CHAR16*)Name,
    2942         L"uefishellsupport") == 0
    2943     ||gUnicodeCollation->StriColl(
    2944         gUnicodeCollation,
    2945         (CHAR16*)Name,
    2946         L"uefishellversion") == 0
    2947     ||gUnicodeCollation->StriColl(
    2948         gUnicodeCollation,
    2949         (CHAR16*)Name,
    2950         L"uefiversion") == 0
    2951     ||(!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
    2952       gUnicodeCollation->StriColl(
    2953         gUnicodeCollation,
    2954         (CHAR16*)Name,
    2955         (CHAR16*)mNoNestingEnvVarName) == 0)
    2956        ){
     2842  if ((StrCmp (Name, L"cwd") == 0) ||
     2843      (StrCmp (Name, L"lasterror") == 0) ||
     2844      (StrCmp (Name, L"profiles") == 0) ||
     2845      (StrCmp (Name, L"uefishellsupport") == 0) ||
     2846      (StrCmp (Name, L"uefishellversion") == 0) ||
     2847      (StrCmp (Name, L"uefiversion") == 0) ||
     2848      (!ShellInfoObject.ShellInitSettings.BitUnion.Bits.NoNest &&
     2849       StrCmp (Name, mNoNestingEnvVarName) == 0)
     2850     ) {
    29572851    return (EFI_INVALID_PARAMETER);
    29582852  }
     
    33863280                                this is stored in a volatile fashion.  FALSE otherwise.
    33873281
    3388   @return                       If Alias is not NULL, it will return a pointer to
     3282  @return                        If Alias is not NULL, it will return a pointer to
    33893283                                the NULL-terminated command for that alias.
    33903284                                If Alias is NULL, ReturnedData points to a ';'
  • trunk/src/VBox/Devices/EFI/FirmwareNew/ShellPkg/Application/Shell/ShellProtocol.h

    r77662 r80721  
    44
    55  (C) Copyright 2014 Hewlett-Packard Development Company, L.P.<BR>
    6   Copyright (c) 2009 - 2016, Intel Corporation. All rights reserved.<BR>
    7   This program and the accompanying materials
    8   are licensed and made available under the terms and conditions of the BSD License
    9   which accompanies this distribution.  The full text of the license may be found at
    10   http://opensource.org/licenses/bsd-license.php
    11 
    12   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
    13   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
     6  Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
     7  SPDX-License-Identifier: BSD-2-Clause-Patent
    148
    159**/
     
    820814  @param[out] Volatile          upon return of a single command if TRUE indicates
    821815                                this is stored in a volatile fashion.  FALSE otherwise.
    822   @return                       If Alias is not NULL, it will return a pointer to
     816  @return                        If Alias is not NULL, it will return a pointer to
    823817                                the NULL-terminated command for that alias.
    824818                                If Alias is NULL, ReturnedData points to a ';'
Note: See TracChangeset for help on using the changeset viewer.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette