]> git.proxmox.com Git - mirror_edk2.git/blobdiff - EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/Thunk.c
EdkCompatibilityPkg: Remove EdkCompatibilityPkg
[mirror_edk2.git] / EdkCompatibilityPkg / Compatibility / PiSmbiosRecordOnDataHubSmbiosRecordThunk / Thunk.c
diff --git a/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/Thunk.c b/EdkCompatibilityPkg/Compatibility/PiSmbiosRecordOnDataHubSmbiosRecordThunk/Thunk.c
deleted file mode 100644 (file)
index 2c395f2..0000000
+++ /dev/null
@@ -1,160 +0,0 @@
-/** @file\r
-  Thunk driver's entry that install filter for DataRecord.\r
-  \r
-Copyright (c) 2009 - 2016, 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
-#include "Thunk.h"\r
-\r
-//\r
-// Global variables\r
-//\r
-LIST_ENTRY  mStructureList;\r
-\r
-/**\r
-  Entry Point of thunk driver.\r
-\r
-  @param[in] ImageHandle  Image handle of this driver.\r
-  @param[in] SystemTable  Pointer to EFI system table.\r
-\r
-  @retval EFI_SUCCESS          The event handlers were registered.\r
-  @retval EFI_DEVICE_ERROR     Failed to register the event handlers\r
-**/  \r
-EFI_STATUS\r
-EFIAPI\r
-ThunkEntry (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-{\r
-  EFI_STATUS            Status;\r
-  EFI_DATA_HUB_PROTOCOL *DataHub;\r
-  EFI_EVENT             FilterEvent;\r
-    \r
-  Status = gBS->LocateProtocol (&gEfiDataHubProtocolGuid, NULL, (VOID**) &DataHub);\r
-  ASSERT_EFI_ERROR (Status);\r
-  ASSERT (DataHub != NULL);\r
-\r
-  InitializeListHead (&mStructureList);\r
-\r
-  //\r
-  // Register SmBios Data Filter Function.\r
-  // This function is notified at TPL_CALLBACK.\r
-  //\r
-  Status = gBS->CreateEvent (\r
-                  EVT_NOTIFY_SIGNAL,\r
-                  TPL_CALLBACK,\r
-                  SmbiosDataFilter,\r
-                  NULL,\r
-                  &FilterEvent\r
-                  );\r
-  if (EFI_ERROR (Status)) {\r
-    return Status;\r
-  }\r
-\r
-  Status = DataHub->RegisterFilterDriver (\r
-                      DataHub,\r
-                      FilterEvent,\r
-                      TPL_APPLICATION,\r
-                      EFI_DATA_RECORD_CLASS_DATA,\r
-                      NULL\r
-                      );\r
-  if (EFI_ERROR (Status)) {\r
-    gBS->CloseEvent (FilterEvent);\r
-    return Status;\r
-  }\r
-\r
-  return Status;\r
-\r
-} \r
-\r
-/**\r
-  Smbios data filter function. This function is invoked when there is data records\r
-  available in the Data Hub. \r
-\r
-  @param Event         The event that is signaled.\r
-  @param Context       not used here.\r
-**/\r
-VOID\r
-EFIAPI\r
-SmbiosDataFilter (\r
-  IN EFI_EVENT    Event,\r
-  IN VOID         *Context\r
-  )\r
-{\r
-  EFI_STATUS              Status;\r
-  EFI_DATA_HUB_PROTOCOL   *DataHub;\r
-  EFI_HANDLE              DataHubHandle;\r
-  UINTN                   HandleSize;\r
-  UINT64                  MonotonicCount;\r
-  EFI_DATA_RECORD_HEADER  *Record;\r
-\r
-  Status  = EFI_SUCCESS;\r
-  DataHub = NULL;\r
-\r
-  //\r
-  // Get the Data Hub Protocol. Assume only one instance\r
-  // of Data Hub Protocol is available in the system.\r
-  //\r
-  HandleSize = sizeof (EFI_HANDLE);\r
-\r
-  Status = gBS->LocateHandle (\r
-                  ByProtocol,\r
-                  &gEfiDataHubProtocolGuid,\r
-                  NULL,\r
-                  &HandleSize,\r
-                  &DataHubHandle\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-\r
-  Status = gBS->HandleProtocol (\r
-                  DataHubHandle,\r
-                  &gEfiDataHubProtocolGuid,\r
-                  (VOID **) &DataHub\r
-                  );\r
-\r
-  if (EFI_ERROR (Status)) {\r
-    goto Done;\r
-  }\r
-  //\r
-  // Get all available data records from data hub\r
-  //\r
-  MonotonicCount  = 0;\r
-  Record          = NULL;\r
-\r
-  do {\r
-\r
-    Status = DataHub->GetNextRecord (\r
-                        DataHub,\r
-                        &MonotonicCount,\r
-                        &Event,\r
-                        &Record\r
-                        );\r
-\r
-    if (!EFI_ERROR (Status)) {\r
-      if (Record->DataRecordClass == EFI_DATA_RECORD_CLASS_DATA) {\r
-      \r
-        //\r
-        // It's of expected Data Type. Process it.\r
-        //\r
-        SmbiosProcessDataRecord (Record);\r
-      }\r
-    }\r
-  } while (!EFI_ERROR (Status) && (MonotonicCount != 0));\r
-\r
-Done:\r
-\r
-  return ;\r
-\r
-}\r