2 This protocol provide registering and unregistering services to status code
3 consumers while in DXE.
5 Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol was introduced in PI Specification 1.2.
13 #ifndef __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
14 #define __REPORT_STATUS_CODE_HANDLER_PROTOCOL_H__
16 #define EFI_RSC_HANDLER_PROTOCOL_GUID \
18 0x86212936, 0xe76, 0x41c8, {0xa0, 0x3a, 0x2a, 0xf2, 0xfc, 0x1c, 0x39, 0xe2} \
23 (EFIAPI
*EFI_RSC_HANDLER_CALLBACK
)(
24 IN EFI_STATUS_CODE_TYPE CodeType
,
25 IN EFI_STATUS_CODE_VALUE Value
,
27 IN EFI_GUID
*CallerId
,
28 IN EFI_STATUS_CODE_DATA
*Data
32 Register the callback function for ReportStatusCode() notification.
34 When this function is called the function pointer is added to an internal list and any future calls to
35 ReportStatusCode() will be forwarded to the Callback function. During the bootservices,
36 this is the callback for which this service can be invoked. The report status code router
37 will create an event such that the callback function is only invoked at the TPL for which it was
38 registered. The entity that registers for the callback should also register for an event upon
39 generation of exit boot services and invoke the unregister service.
40 If the handler does not have a TPL dependency, it should register for a callback at TPL high. The
41 router infrastructure will support making callbacks at runtime, but the caller for runtime invocation
42 must meet the following criteria:
43 1. must be a runtime driver type so that its memory is not reclaimed
44 2. not unregister at exit boot services so that the router will still have its callback address
45 3. the caller must be self-contained (eg. Not call out into any boot-service interfaces) and be
46 runtime safe, in general.
48 @param[in] Callback A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is called when
49 a call to ReportStatusCode() occurs.
50 @param[in] Tpl TPL at which callback can be safely invoked.
52 @retval EFI_SUCCESS Function was successfully registered.
53 @retval EFI_INVALID_PARAMETER The callback function was NULL.
54 @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
56 @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
60 (EFIAPI
*EFI_RSC_HANDLER_REGISTER
)(
61 IN EFI_RSC_HANDLER_CALLBACK Callback
,
66 Remove a previously registered callback function from the notification list.
68 A callback function must be unregistered before it is deallocated. It is important that any registered
69 callbacks that are not runtime complaint be unregistered when ExitBootServices() is called.
71 @param[in] Callback A pointer to a function of type EFI_RSC_HANDLER_CALLBACK that is to be
74 @retval EFI_SUCCESS The function was successfully unregistered.
75 @retval EFI_INVALID_PARAMETER The callback function was NULL.
76 @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
80 (EFIAPI
*EFI_RSC_HANDLER_UNREGISTER
)(
81 IN EFI_RSC_HANDLER_CALLBACK Callback
85 EFI_RSC_HANDLER_REGISTER Register
;
86 EFI_RSC_HANDLER_UNREGISTER Unregister
;
87 } EFI_RSC_HANDLER_PROTOCOL
;
89 extern EFI_GUID gEfiRscHandlerProtocolGuid
;
91 #endif // __REPORT_STATUS_CODE_HANDLER_H__