]>
Commit | Line | Data |
---|---|---|
476f4780 | 1 | /** @file\r |
2 | This protocol provide registering and unregistering services to status code \r | |
3 | consumers while in DXE.\r | |
4 | \r | |
9df063a0 HT |
5 | Copyright (c) 2007 - 2009, Intel Corporation. All rights reserved.<BR>\r |
6 | This program and the accompanying materials\r | |
476f4780 | 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 | #ifndef __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r | |
17 | #define __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__\r | |
18 | \r | |
19 | #define EFI_RSC_HANDLER_PROTOCOL_GUID \\r | |
20 | { \\r | |
41d84824 | 21 | 0x86212936, 0xe76, 0x41c8, {0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2} \\r |
476f4780 | 22 | }\r |
23 | \r | |
24 | typedef\r | |
25 | EFI_STATUS\r | |
26 | (EFIAPI *EFI_RSC_HANDLER_CALLBACK)(\r | |
27 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
28 | IN EFI_STATUS_CODE_VALUE Value,\r | |
29 | IN UINT32 Instance,\r | |
30 | IN EFI_GUID *CallerId,\r | |
31 | IN EFI_STATUS_CODE_DATA *Data\r | |
32 | );\r | |
33 | \r | |
34 | /**\r | |
35 | Register the callback function for ReportStatusCode() notification.\r | |
36 | \r | |
37 | When this function is called the function pointer is added to an internal list and any future calls to\r | |
38 | ReportStatusCode() will be forwarded to the Callback function. During the bootservices,\r | |
39 | this is the callback for which this service can be invoked. The report status code router\r | |
40 | will create an event such that the callback function is only invoked at the TPL for which it was\r | |
41 | registered. The entity that registers for the callback should also register for an event upon\r | |
42 | generation of exit boot services and invoke the unregister service.\r | |
43 | If the handler does not have a TPL dependency, it should register for a callback at TPL high. The\r | |
44 | router infrastructure will support making callbacks at runtime, but the caller for runtime invocation\r | |
45 | must meet the following criteria:\r | |
46 | 1. must be a runtime driver type so that its memory is not reclaimed\r | |
47 | 2. not unregister at exit boot services so that the router will still have its callback address\r | |
48 | 3. the caller must be self-contained (eg. Not call out into any boot-service interfaces) and be\r | |
49 | runtime safe, in general.\r | |
50 | \r | |
51 | @param[in] Callback A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is called when\r | |
52 | a call to ReportStatusCode() occurs.\r | |
53 | @param[in] Tpl TPL at which callback can be safely invoked. \r | |
54 | \r | |
55 | @retval EFI_SUCCESS Function was successfully registered.\r | |
56 | @retval EFI_INVALID_PARAMETER The callback function was NULL.\r | |
57 | @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be\r | |
58 | registered.\r | |
17664848 | 59 | @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again. \r |
476f4780 | 60 | **/\r |
61 | typedef\r | |
62 | EFI_STATUS\r | |
63 | (EFIAPI *EFI_RSC_HANDLER_REGISTER)(\r | |
64 | IN EFI_RSC_HANDLER_CALLBACK Callback,\r | |
65 | IN EFI_TPL Tpl\r | |
66 | );\r | |
67 | \r | |
68 | /**\r | |
69 | Remove a previously registered callback function from the notification list.\r | |
70 | \r | |
71 | A callback function must be unregistered before it is deallocated. It is important that any registered\r | |
72 | callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.\r | |
73 | \r | |
74 | @param[in] Callback A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is to be\r | |
75 | unregistered.\r | |
76 | \r | |
77 | @retval EFI_SUCCESS The function was successfully unregistered.\r | |
78 | @retval EFI_INVALID_PARAMETER The callback function was NULL.\r | |
79 | @retval EFI_NOT_FOUND The callback function was not found to be unregistered. \r | |
80 | **/\r | |
81 | typedef\r | |
82 | EFI_STATUS\r | |
83 | (EFIAPI *EFI_RSC_HANDLER_UNREGISTER)(\r | |
84 | IN EFI_RSC_HANDLER_CALLBACK Callback\r | |
85 | );\r | |
86 | \r | |
87 | typedef struct {\r | |
88 | EFI_RSC_HANDLER_REGISTER Register;\r | |
89 | EFI_RSC_HANDLER_UNREGISTER Unregister;\r | |
90 | } EFI_RSC_HANDLER_PROTOCOL;\r | |
91 | \r | |
92 | extern EFI_GUID gEfiRscHandlerProtocolGuid;\r | |
93 | \r | |
94 | #endif // __REPORT_STATUS_CODE_HANDLER_H__\r |