]>
Commit | Line | Data |
---|---|---|
3af9b388 | 1 | /** @file\r |
2 | Internal include file for Status Code Handler Driver.\r | |
3 | \r | |
96a25163 | 4 | Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r |
e5eed7d3 | 5 | This program and the accompanying materials\r |
3af9b388 | 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 __STATUS_CODE_HANDLER_RUNTIME_DXE_H__\r | |
16 | #define __STATUS_CODE_HANDLER_RUNTIME_DXE_H__\r | |
17 | \r | |
18 | #include <Protocol/ReportStatusCodeHandler.h>\r | |
19 | \r | |
20 | #include <Guid/MemoryStatusCodeRecord.h>\r | |
21 | #include <Guid/StatusCodeDataTypeId.h>\r | |
22 | #include <Guid/StatusCodeDataTypeDebug.h>\r | |
23 | #include <Guid/EventGroup.h>\r | |
24 | \r | |
25 | #include <Library/SynchronizationLib.h>\r | |
96a25163 | 26 | #include <Library/BaseMemoryLib.h>\r |
3af9b388 | 27 | #include <Library/DebugLib.h>\r |
28 | #include <Library/ReportStatusCodeLib.h>\r | |
29 | #include <Library/PrintLib.h>\r | |
30 | #include <Library/PcdLib.h>\r | |
31 | #include <Library/HobLib.h>\r | |
32 | #include <Library/UefiDriverEntryPoint.h>\r | |
33 | #include <Library/UefiBootServicesTableLib.h>\r | |
34 | #include <Library/MemoryAllocationLib.h>\r | |
35 | #include <Library/UefiRuntimeLib.h>\r | |
36 | #include <Library/SerialPortLib.h>\r | |
37 | \r | |
38 | //\r | |
39 | // Runtime memory status code worker definition\r | |
40 | //\r | |
41 | typedef struct {\r | |
42 | UINT32 RecordIndex;\r | |
43 | UINT32 NumberOfRecords;\r | |
44 | UINT32 MaxRecordsNumber;\r | |
45 | } RUNTIME_MEMORY_STATUSCODE_HEADER;\r | |
46 | \r | |
47 | extern RUNTIME_MEMORY_STATUSCODE_HEADER *mRtMemoryStatusCodeTable;\r | |
48 | \r | |
49 | /**\r | |
50 | Locates Serial I/O Protocol as initialization for serial status code worker.\r | |
51 | \r | |
52 | @retval EFI_SUCCESS Serial I/O Protocol is successfully located.\r | |
53 | \r | |
54 | **/\r | |
55 | EFI_STATUS\r | |
56 | EfiSerialStatusCodeInitializeWorker (\r | |
57 | VOID\r | |
58 | );\r | |
59 | \r | |
60 | \r | |
61 | /**\r | |
62 | Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r | |
63 | \r | |
64 | @param CodeType Indicates the type of status code being reported.\r | |
65 | @param Value Describes the current status of a hardware or software entity.\r | |
66 | This included information about the class and subclass that is used to\r | |
67 | classify the entity as well as an operation.\r | |
68 | @param Instance The enumeration of a hardware or software entity within\r | |
69 | the system. Valid instance numbers start with 1.\r | |
70 | @param CallerId This optional parameter may be used to identify the caller.\r | |
71 | This parameter allows the status code driver to apply different rules to\r | |
72 | different callers.\r | |
73 | @param Data This optional parameter may be used to pass additional data.\r | |
74 | \r | |
75 | @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r | |
76 | @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r | |
77 | @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r | |
78 | \r | |
79 | **/\r | |
80 | EFI_STATUS\r | |
e798cd87 | 81 | EFIAPI\r |
3af9b388 | 82 | SerialStatusCodeReportWorker (\r |
83 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
84 | IN EFI_STATUS_CODE_VALUE Value,\r | |
85 | IN UINT32 Instance,\r | |
86 | IN EFI_GUID *CallerId,\r | |
87 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
88 | );\r | |
89 | \r | |
90 | /**\r | |
91 | Initialize runtime memory status code table as initialization for runtime memory status code worker\r | |
92 | \r | |
93 | @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r | |
94 | \r | |
95 | **/\r | |
96 | EFI_STATUS\r | |
97 | RtMemoryStatusCodeInitializeWorker (\r | |
98 | VOID\r | |
99 | );\r | |
100 | \r | |
101 | /**\r | |
102 | Report status code into runtime memory. If the runtime pool is full, roll back to the \r | |
103 | first record and overwrite it.\r | |
104 | \r | |
105 | @param CodeType Indicates the type of status code being reported.\r | |
106 | @param Value Describes the current status of a hardware or software entity.\r | |
107 | This included information about the class and subclass that is used to\r | |
108 | classify the entity as well as an operation.\r | |
109 | @param Instance The enumeration of a hardware or software entity within\r | |
110 | the system. Valid instance numbers start with 1.\r | |
111 | @param CallerId This optional parameter may be used to identify the caller.\r | |
112 | This parameter allows the status code driver to apply different rules to\r | |
113 | different callers.\r | |
114 | @param Data This optional parameter may be used to pass additional data.\r | |
115 | \r | |
116 | @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r | |
117 | \r | |
118 | **/\r | |
119 | EFI_STATUS\r | |
e798cd87 | 120 | EFIAPI\r |
3af9b388 | 121 | RtMemoryStatusCodeReportWorker (\r |
122 | IN EFI_STATUS_CODE_TYPE CodeType,\r | |
123 | IN EFI_STATUS_CODE_VALUE Value,\r | |
124 | IN UINT32 Instance,\r | |
125 | IN EFI_GUID *CallerId,\r | |
126 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
127 | );\r | |
128 | \r | |
129 | #endif\r |