]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/ReportStatusCodeRouter/Smm/ReportStatusCodeRouterSmm.h
MdeModulePkg: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / MdeModulePkg / Universal / ReportStatusCodeRouter / Smm / ReportStatusCodeRouterSmm.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_SMM_H__
10 #define __REPORT_STATUS_CODE_ROUTER_SMM_H__
11
12
13 #include <Protocol/SmmReportStatusCodeHandler.h>
14 #include <Protocol/SmmStatusCode.h>
15
16 #include <Library/BaseLib.h>
17 #include <Library/SynchronizationLib.h>
18 #include <Library/DebugLib.h>
19 #include <Library/PcdLib.h>
20 #include <Library/UefiDriverEntryPoint.h>
21 #include <Library/SmmServicesTableLib.h>
22 #include <Library/MemoryAllocationLib.h>
23
24 #define SMM_RSC_HANDLER_CALLBACK_ENTRY_SIGNATURE SIGNATURE_32 ('s', 'h', 'c', 'e')
25
26 typedef struct {
27 UINTN Signature;
28 EFI_SMM_RSC_HANDLER_CALLBACK RscHandlerCallback;
29 LIST_ENTRY Node;
30 } SMM_RSC_HANDLER_CALLBACK_ENTRY;
31
32 /**
33 Register the callback function for ReportStatusCode() notification.
34
35 When this function is called the function pointer is added to an internal list and any future calls to
36 ReportStatusCode() will be forwarded to the Callback function.
37
38 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is called
39 when a call to ReportStatusCode() occurs.
40
41 @retval EFI_SUCCESS Function was successfully registered.
42 @retval EFI_INVALID_PARAMETER The callback function was NULL.
43 @retval EFI_OUT_OF_RESOURCES The internal buffer ran out of space. No more functions can be
44 registered.
45 @retval EFI_ALREADY_STARTED The function was already registered. It can't be registered again.
46
47 **/
48 EFI_STATUS
49 EFIAPI
50 Register (
51 IN EFI_SMM_RSC_HANDLER_CALLBACK Callback
52 );
53
54 /**
55 Remove a previously registered callback function from the notification list.
56
57 ReportStatusCode() messages will no longer be forwarded to the Callback function.
58
59 @param[in] Callback A pointer to a function of type EFI_PEI_RSC_HANDLER_CALLBACK that is to be
60 unregistered.
61
62 @retval EFI_SUCCESS The function was successfully unregistered.
63 @retval EFI_INVALID_PARAMETER The callback function was NULL.
64 @retval EFI_NOT_FOUND The callback function was not found to be unregistered.
65
66 **/
67 EFI_STATUS
68 EFIAPI
69 Unregister (
70 IN EFI_SMM_RSC_HANDLER_CALLBACK Callback
71 );
72
73 /**
74 Provides an interface that a software module can call to report a status code.
75
76 @param This EFI_SMM_STATUS_CODE_PROTOCOL instance.
77 @param Type Indicates the type of status code being reported.
78 @param Value Describes the current status of a hardware or software entity.
79 This included information about the class and subclass that is used to
80 classify the entity as well as an operation.
81 @param Instance The enumeration of a hardware or software entity within
82 the system. Valid instance numbers start with 1.
83 @param CallerId This optional parameter may be used to identify the caller.
84 This parameter allows the status code driver to apply different rules to
85 different callers.
86 @param Data This optional parameter may be used to pass additional data.
87
88 @retval EFI_SUCCESS The function completed successfully
89 @retval EFI_DEVICE_ERROR The function should not be completed due to a device error.
90
91 **/
92 EFI_STATUS
93 EFIAPI
94 ReportDispatcher (
95 IN CONST EFI_SMM_STATUS_CODE_PROTOCOL *This,
96 IN EFI_STATUS_CODE_TYPE Type,
97 IN EFI_STATUS_CODE_VALUE Value,
98 IN UINT32 Instance,
99 IN CONST EFI_GUID *CallerId OPTIONAL,
100 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
101 );
102
103 #endif