VirtualBox

Ignore:
Timestamp:
Aug 14, 2024 1:16:30 PM (9 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
164367
Message:

Devices/EFI/FirmwareNew: Merge edk2-stable-202405 and make it build on aarch64, 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/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.c

    r99404 r105670  
    55
    66  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
     7  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
    78
    89  SPDX-License-Identifier: BSD-2-Clause-Patent
     
    1112
    1213#include <Uefi.h>
     14#include <Library/DebugLib.h>
    1315#include <Protocol/RestJsonStructure.h>
    1416#include "RestJsonStructureInternal.h"
     
    7375  }
    7476
     77  DEBUG ((DEBUG_MANAGEABILITY, "%a: %d REST JSON-C interpreter(s) to register for the name spaces.\n", __func__, NumberOfNS));
     78
    7579  Instance =
    7680    (REST_JSON_STRUCTURE_INSTANCE *)AllocateZeroPool (sizeof (REST_JSON_STRUCTURE_INSTANCE) + NumberOfNS * sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER));
     
    8993  for (Index = 0; Index < NumberOfNS; Index++) {
    9094    CopyMem ((VOID *)CloneSupportedInterpId, (VOID *)&ThisSupportedInterp->RestResourceInterp, sizeof (EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER));
     95    DEBUG ((DEBUG_MANAGEABILITY, "  Resource type : %a\n", ThisSupportedInterp->RestResourceInterp.NameSpace.ResourceTypeName));
     96    DEBUG ((DEBUG_MANAGEABILITY, "  Major version : %a\n", ThisSupportedInterp->RestResourceInterp.NameSpace.MajorVersion));
     97    DEBUG ((DEBUG_MANAGEABILITY, "  Minor version : %a\n", ThisSupportedInterp->RestResourceInterp.NameSpace.MinorVersion));
     98    DEBUG ((DEBUG_MANAGEABILITY, "  Errata version: %a\n\n", ThisSupportedInterp->RestResourceInterp.NameSpace.ErrataVersion));
    9199    ThisSupportedInterp = (EFI_REST_JSON_STRUCTURE_SUPPORTED *)ThisSupportedInterp->NextSupportedRsrcInterp.ForwardLink;
    92100    CloneSupportedInterpId++;
     
    125133  EFI_STATUS                              Status;
    126134  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER  *ThisSupportedRsrcTypeId;
     135
     136  DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__));
    127137
    128138  if ((This == NULL) ||
     
    147157                                    RestJSonHeader
    148158                                    );
     159    if (EFI_ERROR (Status)) {
     160      if (Status == EFI_UNSUPPORTED) {
     161        DEBUG ((
     162          DEBUG_MANAGEABILITY,
     163          "%a %a.%a.%a REST JSON to C structure interpreter has no capability to interpret the resource.\n",
     164          InterpreterInstance->SupportedRsrcIndentifier->NameSpace.ResourceTypeName,
     165          InterpreterInstance->SupportedRsrcIndentifier->NameSpace.MajorVersion,
     166          InterpreterInstance->SupportedRsrcIndentifier->NameSpace.MinorVersion,
     167          InterpreterInstance->SupportedRsrcIndentifier->NameSpace.ErrataVersion
     168          ));
     169      } else {
     170        DEBUG ((DEBUG_MANAGEABILITY, "REST JsonToStructure returns failure - %r\n", Status));
     171      }
     172    }
    149173  } else {
    150174    //
    151     // Check if the namesapce and version is supported by this interpreter.
     175    // Check if the namespace and version is supported by this interpreter.
    152176    //
    153177    ThisSupportedRsrcTypeId = InterpreterInstance->SupportedRsrcIndentifier;
     
    172196                                          RestJSonHeader
    173197                                          );
     198          if (EFI_ERROR (Status)) {
     199            DEBUG ((DEBUG_MANAGEABILITY, "Don't check version of this resource type identifier JsonToStructure returns %r\n", Status));
     200            DEBUG ((DEBUG_MANAGEABILITY, "  Supported ResourceTypeName = %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName));
     201          }
     202
    174203          break;
    175204        } else {
     
    196225                                            RestJSonHeader
    197226                                            );
     227            if (EFI_ERROR (Status)) {
     228              DEBUG ((DEBUG_MANAGEABILITY, "Check version of this resource type identifier JsonToStructure returns %r\n", Status));
     229              DEBUG ((DEBUG_MANAGEABILITY, "  Supported ResourceTypeName = %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName));
     230              DEBUG ((DEBUG_MANAGEABILITY, "  Supported MajorVersion     = %a\n", ThisSupportedRsrcTypeId->NameSpace.MajorVersion));
     231              DEBUG ((DEBUG_MANAGEABILITY, "  Supported MinorVersion     = %a\n", ThisSupportedRsrcTypeId->NameSpace.MinorVersion));
     232              DEBUG ((DEBUG_MANAGEABILITY, "  Supported ErrataVersion    = %a\n", ThisSupportedRsrcTypeId->NameSpace.ErrataVersion));
     233            }
     234
    198235            break;
    199236          }
     
    232269  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER  *ThisSupportedRsrcTypeId;
    233270  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER  *RsrcTypeIdentifier;
     271
     272  DEBUG ((DEBUG_MANAGEABILITY, "%a: Entry\n", __func__));
    234273
    235274  if ((This == NULL) ||
     
    285324                                        ResourceRaw
    286325                                        );
     326        if (EFI_ERROR (Status)) {
     327          DEBUG ((DEBUG_MANAGEABILITY, "StructureToJson returns %r\n", Status));
     328          DEBUG ((DEBUG_MANAGEABILITY, "  Supported ResourceTypeName = %a\n", ThisSupportedRsrcTypeId->NameSpace.ResourceTypeName));
     329          DEBUG ((DEBUG_MANAGEABILITY, "  Supported MajorVersion     = %a\n", ThisSupportedRsrcTypeId->NameSpace.MajorVersion));
     330          DEBUG ((DEBUG_MANAGEABILITY, "  Supported MinorVersion     = %a\n", ThisSupportedRsrcTypeId->NameSpace.MinorVersion));
     331          DEBUG ((DEBUG_MANAGEABILITY, "  Supported ErrataVersion    = %a\n", ThisSupportedRsrcTypeId->NameSpace.ErrataVersion));
     332        }
     333
    287334        break;
    288335      }
     
    417464  }
    418465
     466  if (RsrcTypeIdentifier != NULL) {
     467    DEBUG ((DEBUG_MANAGEABILITY, "%a: Looking for the REST JSON to C Structure converter:\n", __func__));
     468    if (RsrcTypeIdentifier->NameSpace.ResourceTypeName != NULL) {
     469      DEBUG ((DEBUG_MANAGEABILITY, "  ResourceType: %a\n", RsrcTypeIdentifier->NameSpace.ResourceTypeName));
     470    } else {
     471      DEBUG ((DEBUG_MANAGEABILITY, "  ResourceType: NULL"));
     472    }
     473
     474    if (RsrcTypeIdentifier->NameSpace.MajorVersion != NULL) {
     475      DEBUG ((DEBUG_MANAGEABILITY, "  MajorVersion: %a\n", RsrcTypeIdentifier->NameSpace.MajorVersion));
     476    } else {
     477      DEBUG ((DEBUG_MANAGEABILITY, "  MajorVersion: NULL"));
     478    }
     479
     480    if (RsrcTypeIdentifier->NameSpace.MinorVersion != NULL) {
     481      DEBUG ((DEBUG_MANAGEABILITY, "  MinorVersion: %a\n", RsrcTypeIdentifier->NameSpace.MinorVersion));
     482    } else {
     483      DEBUG ((DEBUG_MANAGEABILITY, "  MinorVersion: NULL"));
     484    }
     485
     486    if (RsrcTypeIdentifier->NameSpace.ErrataVersion != NULL) {
     487      DEBUG ((DEBUG_MANAGEABILITY, "  ErrataVersion: %a\n", RsrcTypeIdentifier->NameSpace.ErrataVersion));
     488    } else {
     489      DEBUG ((DEBUG_MANAGEABILITY, "  ErrataVersion: NULL"));
     490    }
     491  } else {
     492    DEBUG ((DEBUG_MANAGEABILITY, "%a: RsrcTypeIdentifier is given as NULL, go through all of the REST JSON to C structure interpreters.\n", __func__));
     493  }
     494
    419495  Status   = EFI_SUCCESS;
    420496  Instance = (REST_JSON_STRUCTURE_INSTANCE *)GetFirstNode (&mRestJsonStructureList);
     
    428504               );
    429505    if (!EFI_ERROR (Status)) {
     506      DEBUG ((DEBUG_MANAGEABILITY, "%a: REST JSON to C structure is interpreted successfully.\n", __func__));
    430507      break;
    431508    }
    432509
    433510    if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStructureInstance)) {
     511      DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter found.\n", __func__));
    434512      Status = EFI_UNSUPPORTED;
    435513      break;
     
    484562
    485563    if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStructureInstance)) {
     564      DEBUG ((DEBUG_ERROR, "%a: No REST JSON to C structure interpreter found.\n", __func__));
    486565      Status = EFI_UNSUPPORTED;
    487566      break;
     
    513592  )
    514593{
    515   EFI_STATUS                    Status;
    516   REST_JSON_STRUCTURE_INSTANCE  *Instance;
     594  EFI_STATUS                              Status;
     595  REST_JSON_STRUCTURE_INSTANCE            *Instance;
     596  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER  *RsrcTypeIdentifier;
    517597
    518598  if ((This == NULL) || (RestJSonHeader == NULL) || (ResourceRaw == NULL)) {
     
    523603    return EFI_UNSUPPORTED;
    524604  }
     605
     606  RsrcTypeIdentifier = &RestJSonHeader->JsonRsrcIdentifier;
     607  DEBUG ((DEBUG_MANAGEABILITY, "Looking for the REST C Structure to JSON resource converter:\n"));
     608  DEBUG ((DEBUG_MANAGEABILITY, "  ResourceType : %a\n", RsrcTypeIdentifier->NameSpace.ResourceTypeName));
     609  DEBUG ((DEBUG_MANAGEABILITY, "  MajorVersion : %a\n", RsrcTypeIdentifier->NameSpace.MajorVersion));
     610  DEBUG ((DEBUG_MANAGEABILITY, "  MinorVersion : %a\n", RsrcTypeIdentifier->NameSpace.MinorVersion));
     611  DEBUG ((DEBUG_MANAGEABILITY, "  ErrataVersion: %a\n", RsrcTypeIdentifier->NameSpace.ErrataVersion));
    525612
    526613  Status   = EFI_SUCCESS;
     
    538625
    539626    if (IsNodeAtEnd (&mRestJsonStructureList, &Instance->NextRestJsonStructureInstance)) {
     627      DEBUG ((DEBUG_ERROR, "%a: No REST C structure to JSON interpreter found.\n", __func__));
    540628      Status = EFI_UNSUPPORTED;
    541629      break;
     
    588676
    589677/**
    590   This is the unload handle for Redfish discover module.
     678  This is the unload handle for REST JSON to C structure module.
    591679
    592680  Disconnect the driver specified by ImageHandle from all the devices in the handle database.
  • trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RestJsonStructureDxe/RestJsonStructureDxe.inf

    r89983 r105670  
    33#
    44#  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
     5#  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
    56#  SPDX-License-Identifier: BSD-2-Clause-Patent
    67##
     
    1819  MdePkg/MdePkg.dec
    1920  MdeModulePkg/MdeModulePkg.dec
    20   RedfishPkg/RedfishPkg.dec
    2121
    2222[Sources]
     
    2727  BaseLib
    2828  BaseMemoryLib
     29  DebugLib
    2930  MemoryAllocationLib
    3031  UefiBootServicesTableLib
  • trunk/src/VBox/Devices/EFI/FirmwareNew/RedfishPkg/RestJsonStructureDxe/RestJsonStructureInternal.h

    r99404 r105670  
    44
    55  (C) Copyright 2020 Hewlett Packard Enterprise Development LP<BR>
     6  Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
    67
    78  SPDX-License-Identifier: BSD-2-Clause-Patent
     
    2627  LIST_ENTRY                                   NextRestJsonStructureInstance; ///< Next convertor instance
    2728  UINTN                                        NumberOfNameSpaceToConvert;    ///< Number of resource type this convertor supports.
    28   EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER       *SupportedRsrcIndentifier;     ///< The resource type linklist
     29  EFI_REST_JSON_RESOURCE_TYPE_IDENTIFIER       *SupportedRsrcIndentifier;     ///< The supported resource type array.
    2930  EFI_REST_JSON_STRUCTURE_TO_STRUCTURE         JsonToStructure;               ///< JSON to C structure function
    3031  EFI_REST_JSON_STRUCTURE_TO_JSON              StructureToJson;               ///< C structure to JSON function
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