]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFrameworkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.h
Add DataHub & DataHubStdErr modules
[mirror_edk2.git] / IntelFrameworkModulePkg / Universal / DataHub / DataHub / Dxe / DataHub.h
diff --git a/IntelFrameworkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.h b/IntelFrameworkModulePkg/Universal/DataHub/DataHub/Dxe/DataHub.h
new file mode 100644 (file)
index 0000000..8f90e99
--- /dev/null
@@ -0,0 +1,141 @@
+/*++\r
+\r
+Copyright (c) 2006, Intel Corporation                                                         \r
+All rights reserved. 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
+Module Name:\r
+\r
+  DataHub.h\r
+\r
+Abstract:\r
+  This code supports a the private implementation \r
+  of the Data Hub protocol\r
+\r
+--*/\r
+\r
+#ifndef _DATA_HUB_H_\r
+#define _DATA_HUB_H_\r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <PiDxe.h>\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Protocol/DataHub.h>\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiLib.h>\r
+#include <Library/BaseLib.h>\r
+#include <Library/BaseMemoryLib.h>\r
+#include <Library/MemoryAllocationLib.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/UefiRuntimeServicesTableLib.h>\r
+\r
+#define DATA_HUB_INSTANCE_SIGNATURE EFI_SIGNATURE_32 ('D', 'H', 'u', 'b')\r
+typedef struct {\r
+  UINT32                Signature;\r
+\r
+  EFI_HANDLE            Handle;\r
+\r
+  //\r
+  // Produced protocol(s)\r
+  //\r
+  EFI_DATA_HUB_PROTOCOL DataHub;\r
+\r
+  //\r
+  // Private Data\r
+  //\r
+  //\r
+  // Updates to GlobalMonotonicCount, LogListHead, and FilterDriverListHead\r
+  //  must be locked.\r
+  //\r
+  EFI_LOCK              DataLock;\r
+\r
+  //\r
+  // Runing Monotonic Count to use for each error record.\r
+  //  Increment AFTER use in an error record.\r
+  //\r
+  UINT64                GlobalMonotonicCount;\r
+\r
+  //\r
+  // List of EFI_DATA_ENTRY structures. This is the data log! The list\r
+  //  must be in assending order of LogMonotonicCount.\r
+  //\r
+  LIST_ENTRY            DataListHead;\r
+\r
+  //\r
+  // List of EFI_DATA_HUB_FILTER_DRIVER structures. Represents all\r
+  //  the registered filter drivers.\r
+  //\r
+  LIST_ENTRY            FilterDriverListHead;\r
+\r
+} DATA_HUB_INSTANCE;\r
+\r
+#define DATA_HUB_INSTANCE_FROM_THIS(this) CR (this, DATA_HUB_INSTANCE, DataHub, DATA_HUB_INSTANCE_SIGNATURE)\r
+\r
+//\r
+// Private data structure to contain the data log. One record per\r
+//  structure. Head pointer to the list is the Log member of\r
+//  EFI_DATA_ENTRY. Record is a copy of the data passed in.\r
+//\r
+#define EFI_DATA_ENTRY_SIGNATURE  EFI_SIGNATURE_32 ('D', 'r', 'e', 'c')\r
+typedef struct {\r
+  UINT32                  Signature;\r
+  LIST_ENTRY              Link;\r
+\r
+  EFI_DATA_RECORD_HEADER  *Record;\r
+\r
+  UINTN                   RecordSize;\r
+\r
+} EFI_DATA_ENTRY;\r
+\r
+#define DATA_ENTRY_FROM_LINK(link)  CR (link, EFI_DATA_ENTRY, Link, EFI_DATA_ENTRY_SIGNATURE)\r
+\r
+//\r
+// Private data to contain the filter driver Event and it's\r
+//  associated EFI_TPL.\r
+//\r
+#define EFI_DATA_HUB_FILTER_DRIVER_SIGNATURE  EFI_SIGNATURE_32 ('D', 'h', 'F', 'd')\r
+\r
+typedef struct {\r
+  UINT32          Signature;\r
+  LIST_ENTRY      Link;\r
+\r
+  //\r
+  // Store Filter Driver Event and Tpl level it can be Signaled at.\r
+  //\r
+  EFI_EVENT       Event;\r
+  EFI_TPL         Tpl;\r
+\r
+  //\r
+  // Monotonic count on the get next operation for Event.\r
+  //  Zero indicates get next has not been called for this event yet.\r
+  //\r
+  UINT64          GetNextMonotonicCount;\r
+\r
+  //\r
+  // Filter driver will register what class filter should be used.\r
+  //\r
+  UINT64          ClassFilter;\r
+\r
+  //\r
+  // Filter driver will register what record guid filter should be used.\r
+  //\r
+  EFI_GUID        FilterDataRecordGuid;\r
+\r
+} DATA_HUB_FILTER_DRIVER;\r
+\r
+#define FILTER_ENTRY_FROM_LINK(link)  CR (link, DATA_HUB_FILTER_DRIVER, Link, EFI_DATA_HUB_FILTER_DRIVER_SIGNATURE)\r
+\r
+#endif\r