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