]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterCommon.h
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / ReportStatusCodeRouter / Smm / ReportStatusCodeRouterCommon.h
1 /** @file
2 Internal include file for Report Status Code Router Driver.
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 __REPORT_STATUS_CODE_ROUTER_COMMON_H__
10 #define __REPORT_STATUS_CODE_ROUTER_COMMON_H__
11
12 #include <Protocol/MmReportStatusCodeHandler.h>
13 #include <Protocol/MmStatusCode.h>
14
15 #include <Library/BaseLib.h>
16 #include <Library/SynchronizationLib.h>
17 #include <Library/DebugLib.h>
18 #include <Library/PcdLib.h>
19 #include <Library/MmServicesTableLib.h>
20 #include <Library/MemoryAllocationLib.h>
21
22 #define MM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE SIGNATURE_32 ('s', 'h', 'c', 'e')
23
24 typedef struct {
25 UINTN Signature;
26 EFI_MM_RSC_HANDLER_CALLBACK RscHandlerCallback;
27 LIST_ENTRY Node;
28 } MM_RSC_HANDLER_CALLBACK_ENTRY;
29
30 /**
31 Register the callback function for ReportStatusCode() notification.
32
33 When this function is called the function pointer is added to an internal list and any future calls to
34 ReportStatusCode() will be forwarded to the Callback function.
35
36 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called
37 when a call to ReportStatusCode() occurs.
38
39 @retval EFI_SUCCESS Function was successfully registered.
40 @retval EFI_INVALID_PARAMETER The callback function was NULL.
41 @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
42 registered.
43 @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
44
45 **/
46 EFI_STATUS
47 EFIAPI
48 Register (
49 IN EFI_MM_RSC_HANDLER_CALLBACK Callback
50 );
51
52 /**
53 Remove a previously registered callback function from the notification list.
54
55 ReportStatusCode() messages will no longer be forwarded to the Callback function.
56
57 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
58 unregistered.
59
60 @retval EFI_SUCCESS The function was successfully unregistered.
61 @retval EFI_INVALID_PARAMETER The callback function was NULL.
62 @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
63
64 **/
65 EFI_STATUS
66 EFIAPI
67 Unregister (
68 IN EFI_MM_RSC_HANDLER_CALLBACK Callback
69 );
70
71 /**
72 Provides an interface that a software module can call to report a status code.
73
74 @param This EFI_MM_STATUS_CODE_PROTOCOL instance.
75 @param CodeType Indicates the type of status code being reported.
76 @param Value Describes the current status of a hardware or software entity.
77 This included information about the class and subclass that is used to
78 classify the entity as well as an operation.
79 @param Instance The enumeration of a hardware or software entity within
80 the system. 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 @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
88
89 **/
90 EFI_STATUS
91 EFIAPI
92 ReportDispatcher (
93 IN CONST EFI_MM_STATUS_CODE_PROTOCOL *This,
94 IN EFI_STATUS_CODE_TYPE CodeType,
95 IN EFI_STATUS_CODE_VALUE Value,
96 IN UINT32 Instance,
97 IN CONST EFI_GUID *CallerId,
98 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
99 );
100
101 /**
102 Entry point of Generic Status Code Driver.
103
104 This function is the common entry point of MM Status Code Router.
105 It produces MM Report Status Code Handler and Status Code protocol.
106
107 @retval EFI_SUCCESS The entry point is executed successfully.
108
109 **/
110 EFI_STATUS
111 GenericStatusCodeCommonEntry (
112 VOID
113 );
114
115 #endif