]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/ReportStatusCodeRouter/Pei/ReportStatusCodeRouterPei.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / ReportStatusCodeRouter / Pei / ReportStatusCodeRouterPei.h
1 /** @file
2 Internal include file for Report Status Code Router PEIM.
3
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __PEI_REPORT_STATUS_CODE_ROUTER_H__
10 #define __PEI_REPORT_STATUS_CODE_ROUTER_H__
11
12
13 #include <Ppi/ReportStatusCodeHandler.h>
14 #include <Ppi/StatusCode.h>
15
16 #include <Guid/StatusCodeCallbackGuid.h>
17
18 #include <Library/DebugLib.h>
19 #include <Library/HobLib.h>
20 #include <Library/PeiServicesLib.h>
21 #include <Library/PeimEntryPoint.h>
22
23 /**
24 Register the callback function for ReportStatusCode() notification.
25
26 When this function is called the function pointer is added to an internal list and any future calls to
27 ReportStatusCode() will be forwarded to the Callback function.
28
29 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called
30 when a call to ReportStatusCode() occurs.
31
32 @retval EFI_SUCCESS Function was successfully registered.
33 @retval EFI_INVALID_PARAMETER The callback function was NULL.
34 @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
35 registered.
36 @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
37
38 **/
39 EFI_STATUS
40 EFIAPI
41 Register (
42 IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
43 );
44
45 /**
46 Remove a previously registered callback function from the notification list.
47
48 ReportStatusCode() messages will no longer be forwarded to the Callback function.
49
50 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
51 unregistered.
52
53 @retval EFI_SUCCESS The function was successfully unregistered.
54 @retval EFI_INVALID_PARAMETER The callback function was NULL.
55 @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
56
57 **/
58 EFI_STATUS
59 EFIAPI
60 Unregister (
61 IN EFI_PEI_RSC_HANDLER_CALLBACK Callback
62 );
63
64 /**
65 Publishes an interface that allows PEIMs to report status codes.
66
67 This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().
68 It publishes an interface that allows PEIMs to report status codes.
69
70 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
71 @param CodeType Indicates the type of status code being reported.
72 @param Value Describes the current status of a hardware or
73 software entity. This includes information about the class and
74 subclass that is used to classify the entity as well as an operation.
75 For progress codes, the operation is the current activity.
76 For error codes, it is the exception.For debug codes,it is not defined at this time.
77 @param Instance The enumeration of a hardware or software entity within
78 the system. A system may contain multiple entities that match a class/subclass
79 pairing. The instance differentiates between them. An instance of 0 indicates
80 that instance information is unavailable, not meaningful, or not relevant.
81 Valid instance numbers start with 1.
82 @param CallerId This optional parameter may be used to identify the caller.
83 This parameter allows the status code driver to apply different rules to
84 different callers.
85 @param Data This optional parameter may be used to pass additional data.
86
87 @retval EFI_SUCCESS The function completed successfully.
88
89 **/
90 EFI_STATUS
91 EFIAPI
92 ReportDispatcher (
93 IN CONST EFI_PEI_SERVICES **PeiServices,
94 IN EFI_STATUS_CODE_TYPE CodeType,
95 IN EFI_STATUS_CODE_VALUE Value,
96 IN UINT32 Instance,
97 IN CONST EFI_GUID *CallerId OPTIONAL,
98 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
99 );
100
101 #endif
102
103