]>
Commit | Line | Data |
---|---|---|
3af9b388 | 1 | /** @file\r |
2 | Internal include file for Status Code Handler Driver.\r | |
3 | \r | |
d1102dba | 4 | Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>\r |
848e1472 | 5 | (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r |
9d510e61 | 6 | SPDX-License-Identifier: BSD-2-Clause-Patent\r |
3af9b388 | 7 | \r |
8 | **/\r | |
9 | \r | |
10 | #ifndef __STATUS_CODE_HANDLER_SMM_H__\r | |
11 | #define __STATUS_CODE_HANDLER_SMM_H__\r | |
12 | \r | |
13 | #include <Protocol/SmmReportStatusCodeHandler.h>\r | |
14 | \r | |
15 | #include <Guid/MemoryStatusCodeRecord.h>\r | |
16 | #include <Guid/StatusCodeDataTypeId.h>\r | |
17 | #include <Guid/StatusCodeDataTypeDebug.h>\r | |
18 | \r | |
19 | #include <Library/SynchronizationLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | #include <Library/ReportStatusCodeLib.h>\r | |
22 | #include <Library/PrintLib.h>\r | |
23 | #include <Library/PcdLib.h>\r | |
24 | #include <Library/UefiDriverEntryPoint.h>\r | |
25 | #include <Library/SmmServicesTableLib.h>\r | |
26 | #include <Library/SerialPortLib.h>\r | |
d3308de7 | 27 | #include <Library/MemoryAllocationLib.h>\r |
96a25163 | 28 | #include <Library/BaseMemoryLib.h>\r |
3af9b388 | 29 | \r |
90eaa3c1 SZ |
30 | //\r |
31 | // Define the maximum message length\r | |
32 | //\r | |
33 | #define MAX_DEBUG_MESSAGE_LENGTH 0x100\r | |
34 | \r | |
3af9b388 | 35 | extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;\r |
36 | \r | |
37 | /**\r | |
38 | Locates Serial I/O Protocol as initialization for serial status code worker.\r | |
848e1472 | 39 | \r |
3af9b388 | 40 | @retval EFI_SUCCESS Serial I/O Protocol is successfully located.\r |
41 | \r | |
42 | **/\r | |
43 | EFI_STATUS\r | |
44 | EfiSerialStatusCodeInitializeWorker (\r | |
45 | VOID\r | |
46 | );\r | |
47 | \r | |
48 | \r | |
49 | /**\r | |
50 | Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r | |
848e1472 | 51 | \r |
3af9b388 | 52 | @param CodeType Indicates the type of status code being reported.\r |
53 | @param Value Describes the current status of a hardware or software entity.\r | |
54 | This included information about the class and subclass that is used to\r | |
55 | classify the entity as well as an operation.\r | |
56 | @param Instance The enumeration of a hardware or software entity within\r | |
57 | the system. Valid instance numbers start with 1.\r | |
58 | @param CallerId This optional parameter may be used to identify the caller.\r | |
59 | This parameter allows the status code driver to apply different rules to\r | |
60 | different callers.\r | |
61 | @param Data This optional parameter may be used to pass additional data.\r | |
62 | \r | |
63 | @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r | |
64 | @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r | |
65 | @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r | |
66 | \r | |
67 | **/\r | |
68 | EFI_STATUS\r | |
e798cd87 | 69 | EFIAPI\r |
3af9b388 | 70 | SerialStatusCodeReportWorker (\r |
71 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
72 | IN EFI_STATUS_CODE_VALUE Value,\r | |
73 | IN UINT32 Instance,\r | |
74 | IN EFI_GUID *CallerId,\r | |
75 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
76 | );\r | |
77 | \r | |
78 | /**\r | |
79 | Initialize runtime memory status code table as initialization for runtime memory status code worker\r | |
d1102dba | 80 | \r |
3af9b388 | 81 | @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r |
82 | \r | |
83 | **/\r | |
84 | EFI_STATUS\r | |
85 | MemoryStatusCodeInitializeWorker (\r | |
86 | VOID\r | |
87 | );\r | |
88 | \r | |
89 | /**\r | |
d1102dba | 90 | Report status code into runtime memory. If the runtime pool is full, roll back to the\r |
3af9b388 | 91 | first record and overwrite it.\r |
848e1472 | 92 | \r |
3af9b388 | 93 | @param CodeType Indicates the type of status code being reported.\r |
94 | @param Value Describes the current status of a hardware or software entity.\r | |
95 | This included information about the class and subclass that is used to\r | |
96 | classify the entity as well as an operation.\r | |
97 | @param Instance The enumeration of a hardware or software entity within\r | |
98 | the system. Valid instance numbers start with 1.\r | |
99 | @param CallerId This optional parameter may be used to identify the caller.\r | |
100 | This parameter allows the status code driver to apply different rules to\r | |
101 | different callers.\r | |
102 | @param Data This optional parameter may be used to pass additional data.\r | |
848e1472 | 103 | \r |
3af9b388 | 104 | @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r |
105 | \r | |
106 | **/\r | |
107 | EFI_STATUS\r | |
e798cd87 | 108 | EFIAPI\r |
3af9b388 | 109 | MemoryStatusCodeReportWorker (\r |
110 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
111 | IN EFI_STATUS_CODE_VALUE Value,\r | |
112 | IN UINT32 Instance,\r | |
113 | IN EFI_GUID *CallerId,\r | |
114 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
115 | );\r | |
116 | \r | |
117 | #endif\r |