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