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