]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c
Enable Report Status Code Router introduced in PI 1.2 for PEI and DXE.
[mirror_edk2.git] / Nt32Pkg / WinNtOemHookStatusCodeHandlerDxe / WinNtOemHookStatusCodeHandlerDxe.c
diff --git a/Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c b/Nt32Pkg/WinNtOemHookStatusCodeHandlerDxe/WinNtOemHookStatusCodeHandlerDxe.c
new file mode 100644 (file)
index 0000000..dce9f96
--- /dev/null
@@ -0,0 +1,68 @@
+/** @file\r
+  OEM hook status code handler driver which produces general handler and hook it\r
+  onto the DXE status code router.\r
+\r
+  Copyright (c) 2006 - 2009, 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
+**/\r
+\r
+//\r
+// The package level header files this module uses\r
+//\r
+#include <WinNtDxe.h>\r
+\r
+//\r
+// The protocols, PPI and GUID defintions for this module\r
+//\r
+#include <Protocol/ReportStatusCodeHandler.h>\r
+\r
+//\r
+// The Library classes this module consumes\r
+//\r
+#include <Library/DebugLib.h>\r
+#include <Library/UefiDriverEntryPoint.h>\r
+#include <Library/UefiBootServicesTableLib.h>\r
+#include <Library/OemHookStatusCodeLib.h>\r
+\r
+/**\r
+  Entry point of OEM hook status code handler driver.\r
+\r
+  This function is the entry point of this OEM hook status code handler driver.\r
+  It initializes registers OEM status code handler.\r
+\r
+  @param  ImageHandle       The firmware allocated handle for the EFI image.\r
+  @param  SystemTable       A pointer to the EFI System Table.\r
+  \r
+  @retval EFI_SUCCESS       The entry point is executed successfully.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+WinNtOemHookStatusCodeHandlerDxeEntry (\r
+  IN EFI_HANDLE         ImageHandle,\r
+  IN EFI_SYSTEM_TABLE   *SystemTable\r
+  )\r
+{\r
+  EFI_STATUS                Status;\r
+  EFI_RSC_HANDLER_PROTOCOL  *RscHandlerProtocol;\r
+\r
+  Status = gBS->LocateProtocol (\r
+                  &gEfiRscHandlerProtocolGuid,\r
+                  NULL,\r
+                  (VOID **) &RscHandlerProtocol\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
+  OemHookStatusCodeInitialize ();\r
+\r
+  RscHandlerProtocol->Register (OemHookStatusCodeReport, TPL_HIGH_LEVEL);\r
+\r
+  return EFI_SUCCESS;\r
+}\r