Subrata Banik | 20fe24b | 2021-12-09 02:46:38 +0530 | [diff] [blame] | 1 | /** @file |
| 2 | This PPI provides registering and unregistering services to status code consumers. |
| 3 | |
| 4 | Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.<BR> |
| 5 | SPDX-License-Identifier: BSD-2-Clause-Patent |
| 6 | |
| 7 | **/ |
| 8 | |
| 9 | #ifndef __REPORT_STATUS_CODE_HANDLER_PPI_H__ |
| 10 | #define __REPORT_STATUS_CODE_HANDLER_PPI_H__ |
| 11 | |
| 12 | #define EFI_PEI_RSC_HANDLER_PPI_GUID \ |
| 13 | { \ |
| 14 | 0x65d394, 0x9951, 0x4144, {0x82, 0xa3, 0xa, 0xfc, 0x85, 0x79, 0xc2, 0x51} \ |
| 15 | } |
| 16 | |
| 17 | typedef |
| 18 | EFI_STATUS |
| 19 | (EFIAPI *EFI_PEI_RSC_HANDLER_CALLBACK)( |
| 20 | IN CONST EFI_PEI_SERVICES **PeiServices, |
| 21 | IN EFI_STATUS_CODE_TYPE Type, |
| 22 | IN EFI_STATUS_CODE_VALUE Value, |
| 23 | IN UINT32 Instance, |
| 24 | IN CONST EFI_GUID *CallerId, |
| 25 | IN CONST EFI_STATUS_CODE_DATA *Data |
| 26 | ); |
| 27 | |
| 28 | /** |
| 29 | Register the callback function for ReportStatusCode() notification. |
| 30 | |
| 31 | When this function is called the function pointer is added to an internal list and any future calls to |
| 32 | ReportStatusCode() will be forwarded to the Callback function. |
| 33 | |
| 34 | @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called |
| 35 | when a call to ReportStatusCode() occurs. |
| 36 | |
| 37 | @retval EFI_SUCCESS Function was successfully registered. |
| 38 | @retval EFI_INVALID_PARAMETER The callback function was NULL. |
| 39 | @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be |
| 40 | registered. |
| 41 | @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again. |
| 42 | |
| 43 | **/ |
| 44 | typedef |
| 45 | EFI_STATUS |
| 46 | (EFIAPI *EFI_PEI_RSC_HANDLER_REGISTER)( |
| 47 | IN EFI_PEI_RSC_HANDLER_CALLBACK Callback |
| 48 | ); |
| 49 | |
| 50 | /** |
| 51 | Remove a previously registered callback function from the notification list. |
| 52 | |
| 53 | ReportStatusCode() messages will no longer be forwarded to the Callback function. |
| 54 | |
| 55 | @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be |
| 56 | unregistered. |
| 57 | |
| 58 | @retval EFI_SUCCESS The function was successfully unregistered. |
| 59 | @retval EFI_INVALID_PARAMETER The callback function was NULL. |
| 60 | @retval EFI_NOT_FOUND The callback function was not found to be unregistered. |
| 61 | |
| 62 | **/ |
| 63 | typedef |
| 64 | EFI_STATUS |
| 65 | (EFIAPI *EFI_PEI_RSC_HANDLER_UNREGISTER)( |
| 66 | IN EFI_PEI_RSC_HANDLER_CALLBACK Callback |
| 67 | ); |
| 68 | |
| 69 | typedef struct _EFI_PEI_RSC_HANDLER_PPI { |
| 70 | EFI_PEI_RSC_HANDLER_REGISTER Register; |
| 71 | EFI_PEI_RSC_HANDLER_UNREGISTER Unregister; |
| 72 | } EFI_PEI_RSC_HANDLER_PPI; |
| 73 | |
| 74 | extern EFI_GUID gEfiPeiRscHandlerPpiGuid; |
| 75 | |
| 76 | #endif // __REPORT_STATUS_CODE_HANDLER_PPI_H__ |