RedfishPkg/RedfishPlatformConfigDxe:Add RefishDebugLib support

Add RedfishPlatformConfigDxe debug capability that aligns
with edk2 Redfish debug mechanism.

- PcdRedfishPlatformConfigDebugProperty, add PCD to control
  RedfishPlatformConfigDxe subordinate of Redfish debug
  capabilities.
- PcdRedfishPlatformConfigFeatureProperty, add PCD to
  manage RedfishPlatformConfigDxe features.

Signed-off-by: Abner Chang <abner.chang@amd.com>
Co-authored-by: Nickle Wang <nicklew@nvidia.com>
Cc: Igor Kulchytskyy <igork@ami.com>
Reviewed-by: Nickle Wang <nicklew@nvidia.com>
Reviewed-by: Igor Kulchytskyy <igork@ami.com>
This commit is contained in:
Abner Chang
2024-03-18 11:18:32 +08:00
committed by mergify[bot]
parent b0be42516e
commit c8f56800fd
7 changed files with 262 additions and 59 deletions

View File

@@ -3,6 +3,7 @@
(C) Copyright 2021 Hewlett Packard Enterprise Development LP<BR>
Copyright (c) 2022-2023, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Copyright (C) 2024 Advanced Micro Devices, Inc. All rights reserved.<BR>
SPDX-License-Identifier: BSD-2-Clause-Patent
@@ -20,7 +21,9 @@
#include <Library/BaseMemoryLib.h>
#include <Library/DebugLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/PcdLib.h>
#include <Library/PrintLib.h>
#include <Library/RedfishDebugLib.h>
#include <Library/UefiLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/UefiDriverEntryPoint.h>
@@ -37,6 +40,41 @@
//
#include <Protocol/EdkIIRedfishPlatformConfig.h>
//
// Debug message in DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE scope.
// To enable the debug message for this module, below PCDs must be set.
//
// 1. DEBUG_MANAGEABILITY must be set PcdDebugPrintErrorLevel.
//
// 2 RedfishPlatformConfigDxe debug enablement must be set in
// PcdRedfishDebugCategory (defined in RedfishPkg.dec)
//
// 3. The suborinate debug enablement for RedfishPlatformConfigDxe
// must be set in PcdRedfishPlatformConfigDebugPropert (defined
// in RedfishPkg.dec).
//
#define DEBUG_REDFISH_THIS_MODULE(DebugSubordinate, ...) \
while (RedfishPlatformConfigDebugProp (DebugSubordinate)) { \
DEBUG_REDFISH(DEBUG_REDFISH_COMPONENT_PLATFORM_CONFIG_DXE, ##__VA_ARGS__); \
break; \
}
#define DEBUG_REDFISH_THIS_MODULE_CODE_BEGIN(DebugSubordinate) \
if (RedfishPlatformConfigDebugProp (DebugSubordinate)) {
#define DEBUG_REDFISH_THIS_MODULE_CODE_END() }
#define DEBUG_REDFISH_THIS_MODULE_CODE(DebugSubordinate, Expression) \
DEBUG_REDFISH_THIS_MODULE_CODE_BEGIN(DebugSubordinate) \
Expression \
DEBUG_REDFISH_THIS_MODULE_CODE_END()
// Subordinate debug property for DEBUG_REDFISH_PLATFORM_CONFIG_DXE
#define REDFISH_PLATFORM_CONFIG_DEBUG_STRING_DATABASE 0x00000001
#define REDFISH_PLATFORM_CONFIG_DEBUG_DUMP_FORMSET 0x00000002
#define REDFISH_PLATFORM_CONFIG_DEBUG_CONFIG_LANG_SEARCH 0x00000004
#define REDFISH_PLATFORM_CONFIG_DEBUG_CONFIG_LANG_REGEX 0x00000008
///
/// Definition of EDKII_REDFISH_PLATFORM_CONFIG_NOTIFY.
///
@@ -75,8 +113,12 @@ typedef struct {
#define REGULAR_EXPRESSION_INCLUDE_ALL L".*"
#define CONFIGURE_LANGUAGE_PREFIX "x-uefi-redfish-"
#define REDFISH_PLATFORM_CONFIG_VERSION 0x00010000
#define REDFISH_PLATFORM_CONFIG_DEBUG DEBUG_MANAGEABILITY
#define REDFISH_MENU_PATH_SIZE 8
#define REDFISH_MENU_PATH_SIZE 8
// Definitions of Redfish platform config capbility
#define REDFISH_PLATFORM_CONFIG_BUILD_MENU_PATH 0x000000001
#define REDFISH_PLATFORM_CONFIG_ALLOW_SUPPRESSED 0x000000002
/**
Convert input unicode string to ascii string. It's caller's