]> git.proxmox.com Git - mirror_edk2.git/blob - MdePkg/Include/Ppi/ReportStatusCodeHandler.h
Add Report Status Code related PPI/Protocol from PI 1.2 specification.
[mirror_edk2.git] / MdePkg / Include / Ppi / ReportStatusCodeHandler.h
1 /** @file
2 This ppi provide registering and unregistering services to status code consumers.
3
4 Copyright (c) 2007 - 2009, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __REPORT_STATUS_CODE_HANDLER_PPI_H__
16 #define __REPORT_STATUS_CODE_HANDLER_PPI_H__
17
18 #define EFI_PEI_RSC_HANDLER_PPI_GUID \
19 { \
20 0x65d394, 0x9951, 0x4144, \
21 0x82, 0xa3, 0xa, 0xfc, 0x85, 0x79, 0xc2, 0x51 \
22 }
23
24 typedef
25 EFI_STATUS
26 (EFIAPI *EFI_PEI_RSC_HANDLER_CALLBACK)(
27 IN CONST EFI_PEI_SERVICES **PeiServices,
28 IN EFI_STATUS_CODE_TYPE Type,
29 IN EFI_STATUS_CODE_VALUE Value,
30 IN UINT32 Instance,
31 IN CONST EFI_GUID *CallerId,
32 IN CONST EFI_STATUS_CODE_DATA *Data
33 );
34
35 /**
36 Register the callback function for ReportStatusCode() notification.
37
38 When this function is called the function pointer is added to an internal list and any future calls to
39 ReportStatusCode() will be forwarded to the Callback function.
40
41 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called
42 when a call to ReportStatusCode() occurs.
43
44 @retval EFI_SUCCESS Function was successfully registered.
45 @retval EFI_INVALID_PARAMETER The callback function was NULL.
46 @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
47 registered.
48 @retval EFI_ALREADY_STARTED The function was already registered. It can’t be registered again.
49
50 **/
51 typedef
52 EFI_STATUS
53 (EFIAPI *EFI_PEI_RSC_HANDLER_REGISTER)(
54 IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
55 );
56
57 /**
58 Remove a previously registered callback function from the notification list.
59
60 ReportStatusCode() messages will no longer be forwarded to the Callback function.
61
62 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
63 unregistered.
64
65 @retval EFI_SUCCESS The function was successfully unregistered.
66 @retval EFI_INVALID_PARAMETER The callback function was NULL.
67 @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
68
69 **/
70 typedef
71 EFI_STATUS
72 (EFIAPI *EFI_PEI_RSC_HANDLER_UNREGISTER)(
73 IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
74 );
75
76 typedef struct _EFI_PEI_RSC_HANDLER_PPI {
77 EFI_PEI_RSC_HANDLER_REGISTER Register;
78 EFI_PEI_RSC_HANDLER_UNREGISTER Unregister;
79 } EFI_PEI_RSC_HANDLER_PPI;
80
81 extern EFI_GUID gEfiPeiRscHandlerPpiGuid;
82
83 #endif // __REPORT_STATUS_CODE_HANDLER_PPI_H__