]>
Commit | Line | Data |
---|---|---|
28a94112 | 1 | /** @file\r |
2 | Status Code Handler Driver which produces datahub handler and hook it\r | |
3 | onto the DXE status code router.\r | |
4 | \r | |
5 | Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #include "DatahubStatusCodeHandlerDxe.h"\r | |
17 | \r | |
18 | EFI_EVENT mExitBootServicesEvent = NULL;\r | |
19 | EFI_RSC_HANDLER_PROTOCOL *mRscHandlerProtocol = NULL;\r | |
20 | \r | |
21 | /**\r | |
22 | Unregister status code callback functions only available at boot time from\r | |
23 | report status code router when exiting boot services.\r | |
24 | \r | |
25 | @param Event Event whose notification function is being invoked.\r | |
26 | @param Context Pointer to the notification function's context, which is\r | |
27 | always zero in current implementation.\r | |
28 | \r | |
29 | **/\r | |
30 | VOID\r | |
31 | EFIAPI\r | |
32 | UnregisterBootTimeHandlers (\r | |
33 | IN EFI_EVENT Event,\r | |
34 | IN VOID *Context\r | |
35 | )\r | |
36 | {\r | |
37 | mRscHandlerProtocol->Unregister (DataHubStatusCodeReportWorker);\r | |
38 | }\r | |
39 | \r | |
40 | /**\r | |
41 | Entry point of DXE Status Code Driver.\r | |
42 | \r | |
43 | This function is the entry point of this DXE Status Code Driver.\r | |
44 | It initializes registers status code handlers, and registers event for EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE.\r | |
45 | \r | |
46 | @param ImageHandle The firmware allocated handle for the EFI image.\r | |
47 | @param SystemTable A pointer to the EFI System Table.\r | |
48 | \r | |
49 | @retval EFI_SUCCESS The entry point is executed successfully.\r | |
50 | \r | |
51 | **/\r | |
52 | EFI_STATUS\r | |
53 | EFIAPI\r | |
54 | DatahubStatusCodeHandlerDxeEntry (\r | |
55 | IN EFI_HANDLE ImageHandle,\r | |
56 | IN EFI_SYSTEM_TABLE *SystemTable\r | |
57 | )\r | |
58 | {\r | |
59 | EFI_STATUS Status;\r | |
60 | \r | |
61 | if (FeaturePcdGet (PcdStatusCodeUseDataHub)) {\r | |
62 | Status = gBS->LocateProtocol (\r | |
63 | &gEfiRscHandlerProtocolGuid,\r | |
64 | NULL,\r | |
65 | (VOID **) &mRscHandlerProtocol\r | |
66 | );\r | |
67 | ASSERT_EFI_ERROR (Status);\r | |
68 | \r | |
69 | //\r | |
70 | // Dispatch initialization request to supported devices\r | |
71 | //\r | |
72 | DataHubStatusCodeInitializeWorker ();\r | |
73 | \r | |
74 | mRscHandlerProtocol->Register (DataHubStatusCodeReportWorker, TPL_HIGH_LEVEL);\r | |
75 | \r | |
76 | Status = gBS->CreateEventEx (\r | |
77 | EVT_NOTIFY_SIGNAL,\r | |
78 | TPL_NOTIFY,\r | |
79 | UnregisterBootTimeHandlers,\r | |
80 | NULL,\r | |
81 | &gEfiEventExitBootServicesGuid,\r | |
82 | &mExitBootServicesEvent\r | |
83 | );\r | |
84 | ASSERT_EFI_ERROR (Status);\r | |
85 | }\r | |
86 | \r | |
87 | return EFI_SUCCESS;\r | |
88 | }\r |