VirtualBox

Ignore:
Timestamp:
Sep 11, 2019 8:46:37 AM (5 years ago)
Author:
vboxsync
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:
4 edited

Legend:

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

  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.inf

    r58459 r80721  
    44#  Retrieve status code and report status code in DXE phase.
    55#
    6 #  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
     6#  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
    77#
    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 #  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.
     8#  SPDX-License-Identifier: BSD-2-Clause-Patent
    149#
    1510#
     
    2318  MODULE_TYPE                    = DXE_DRIVER
    2419  VERSION_STRING                 = 1.0
    25   LIBRARY_CLASS                  = ReportStatusCodeLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SAL_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE
     20  LIBRARY_CLASS                  = ReportStatusCodeLib|DXE_CORE DXE_DRIVER DXE_RUNTIME_DRIVER DXE_SMM_DRIVER UEFI_APPLICATION UEFI_DRIVER SMM_CORE
    2621
    2722#
    2823# The following information is for reference only and not required by the build tools.
    2924#
    30 #  VALID_ARCHITECTURES           = IA32 X64 IPF EBC
     25#  VALID_ARCHITECTURES           = IA32 X64 EBC
    3126#
    3227
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/DxeReportStatusCodeLib/DxeReportStatusCodeLib.uni

    r77662 r80721  
    66// Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>
    77//
    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 // 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.
     8// SPDX-License-Identifier: BSD-2-Clause-Patent
    149//
    1510// **/
  • trunk/src/VBox/Devices/EFI/FirmwareNew/MdeModulePkg/Library/DxeReportStatusCodeLib/ReportStatusCodeLib.c

    r58466 r80721  
    22  Report Status Code Library for DXE Phase.
    33
    4   Copyright (c) 2006 - 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.
     4  Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>
     5  SPDX-License-Identifier: BSD-2-Clause-Patent
    126
    137**/
     
    497491  ASSERT (!((ExtendedData != NULL) && (ExtendedDataSize == 0)));
    498492
    499   if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {
    500     return EFI_UNSUPPORTED;
    501   }
    502 
    503   //
    504   // Retrieve the current TPL
    505   //
    506   Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
    507   gBS->RestoreTPL (Tpl);
    508 
    509   StatusCodeData = NULL;
    510   if (Tpl <= TPL_NOTIFY) {
    511     //
    512     // Allocate space for the Status Code Header and its buffer
    513     //
    514     gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);
    515   }
    516 
    517   if (StatusCodeData == NULL) {
    518     //
    519     // If a buffer could not be allocated, then see if the local variable Buffer can be used
    520     //
    521     if (ExtendedDataSize > (MAX_EXTENDED_DATA_SIZE - sizeof (EFI_STATUS_CODE_DATA))) {
    522       //
    523       // The local variable Buffer not large enough to hold the extended data associated
    524       // with the status code being reported.
    525       //
    526       DEBUG ((EFI_D_ERROR, "Status code extended data is too large to be reported!\n"));
     493  if (ExtendedDataSize <= (MAX_EXTENDED_DATA_SIZE - sizeof (EFI_STATUS_CODE_DATA))) {
     494    //
     495    // Use Buffer instead of allocating if possible.
     496    //
     497    StatusCodeData = (EFI_STATUS_CODE_DATA *)Buffer;
     498  } else {
     499    if (gBS == NULL || gBS->AllocatePool == NULL || gBS->FreePool == NULL) {
     500      return EFI_UNSUPPORTED;
     501    }
     502
     503    //
     504    // Retrieve the current TPL
     505    //
     506    Tpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
     507    gBS->RestoreTPL (Tpl);
     508
     509    if (Tpl > TPL_NOTIFY) {
    527510      return EFI_OUT_OF_RESOURCES;
    528511    }
    529     StatusCodeData = (EFI_STATUS_CODE_DATA  *)Buffer;
     512
     513    //
     514    // Allocate space for the Status Code Header and its buffer
     515    //
     516    StatusCodeData = NULL;
     517    gBS->AllocatePool (EfiBootServicesData, sizeof (EFI_STATUS_CODE_DATA) + ExtendedDataSize, (VOID **)&StatusCodeData);
     518    if (StatusCodeData == NULL) {
     519      return EFI_OUT_OF_RESOURCES;
     520    }
    530521  }
    531522
Note: See TracChangeset for help on using the changeset viewer.

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