]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/StatusCode/DatahubStatusCodeHandlerDxe/DatahubStatusCodeHandlerDxe.h
Add datahub status sode handler driver.
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / StatusCode / DatahubStatusCodeHandlerDxe / DatahubStatusCodeHandlerDxe.h
diff --git a/IntelFrameworkModulePkg/Universal/StatusCode/DatahubStatusCodeHandlerDxe/DatahubStatusCodeHandlerDxe.h b/IntelFrameworkModulePkg/Universal/StatusCode/DatahubStatusCodeHandlerDxe/DatahubStatusCodeHandlerDxe.h
new file mode 100644 (file)
index 0000000..6ee58bb
--- /dev/null
@@ -0,0 +1,90 @@
+/** @file\r
+  Internal include file for Datahub Status Code Handler Driver.\r
+\r
+  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+  This program and the accompanying materials\r
+  are licensed and made available under the terms and conditions of the BSD License\r
+  which accompanies this distribution.  The full text of the license may be found at\r
+  http://opensource.org/licenses/bsd-license.php\r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+\r
+**/\r
+\r
+#ifndef __DATAHUB_STATUS_CODE_HANDLER_DXE_H__\r
+#define __DATAHUB_STATUS_CODE_HANDLER_DXE_H__\r
+\r
+#include <Protocol/ReportStatusCodeHandler.h>\r
+#include <Protocol/DataHub.h>\r
+#include <Protocol/StatusCode.h>\r
+\r
+#include <Guid/StatusCodeDataTypeId.h>\r
+#include <Guid/StatusCodeDataTypeDebug.h>\r
+#include <Guid/DataHubStatusCodeRecord.h>\r
+#include <Guid/EventGroup.h>\r
+\r
+#include <Library/BaseLib.h>\r
+#include <Library/SynchronizationLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/DebugLib.h>\r
+#include <Library/ReportStatusCodeLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/PcdLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+\r
+//\r
+// Data hub worker definition\r
+//\r
+#define DATAHUB_STATUS_CODE_SIGNATURE             SIGNATURE_32 ('B', 'D', 'H', 'S')\r
+\r
+typedef struct {\r
+  UINTN       Signature;\r
+  LIST_ENTRY  Node;\r
+  UINT8       Data[sizeof(DATA_HUB_STATUS_CODE_DATA_RECORD) + EFI_STATUS_CODE_DATA_MAX_SIZE];\r
+} DATAHUB_STATUSCODE_RECORD;\r
+\r
+/**\r
+  Report status code into DataHub.\r
+\r
+  @param  CodeType             Indicates the type of status code being reported.\r
+  @param  Value                Describes the current status of a hardware or software entity.\r
+                               This included information about the class and subclass that is used to\r
+                               classify the entity as well as an operation.\r
+  @param  Instance             The enumeration of a hardware or software entity within\r
+                               the system. Valid instance numbers start with 1.\r
+  @param  CallerId             This optional parameter may be used to identify the caller.\r
+                               This parameter allows the status code driver to apply different rules to\r
+                               different callers.\r
+  @param  Data                 This optional parameter may be used to pass additional data.\r
+\r
+  @retval EFI_SUCCESS          The function completed successfully.\r
+  @retval EFI_DEVICE_ERROR     Function is reentered.\r
+  @retval EFI_DEVICE_ERROR     Function is called at runtime.\r
+  @retval EFI_OUT_OF_RESOURCES Fail to allocate memory for free record buffer.\r
+\r
+**/\r
+EFI_STATUS\r
+DataHubStatusCodeReportWorker (\r
+  IN EFI_STATUS_CODE_TYPE     CodeType,\r
+  IN EFI_STATUS_CODE_VALUE    Value,\r
+  IN UINT32                   Instance,\r
+  IN EFI_GUID                 *CallerId,\r
+  IN EFI_STATUS_CODE_DATA     *Data OPTIONAL\r
+  );\r
+\r
+/**\r
+  Locate Data Hub Protocol and create event for logging data\r
+  as initialization for data hub status code worker.\r
+\r
+  @retval EFI_SUCCESS  Initialization is successful.\r
+\r
+**/\r
+EFI_STATUS\r
+DataHubStatusCodeInitializeWorker (\r
+  VOID\r
+  );\r
+\r
+#endif\r