]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
MdeModulePkg: INF/DEC file updates to EDK II packages
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / RuntimeDxe / StatusCodeHandlerRuntimeDxe.h
CommitLineData
3af9b388 1/** @file\r
2 Internal include file for Status Code Handler Driver.\r
3\r
90eaa3c1 4 Copyright (c) 2006 - 2012, 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
90eaa3c1
SZ
38//\r
39// Define the maximum message length\r
40//\r
41#define MAX_DEBUG_MESSAGE_LENGTH 0x100\r
42\r
3af9b388 43//\r
44// Runtime memory status code worker definition\r
45//\r
46typedef struct {\r
47 UINT32 RecordIndex;\r
48 UINT32 NumberOfRecords;\r
49 UINT32 MaxRecordsNumber;\r
50} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
51\r
52extern RUNTIME_MEMORY_STATUSCODE_HEADER *mRtMemoryStatusCodeTable;\r
53\r
54/**\r
55 Locates Serial I/O Protocol as initialization for serial status code worker.\r
56 \r
57 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.\r
58\r
59**/\r
60EFI_STATUS\r
61EfiSerialStatusCodeInitializeWorker (\r
62 VOID\r
63 );\r
64\r
65\r
66/**\r
67 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
68 \r
69 @param CodeType Indicates the type of status code being reported.\r
70 @param Value Describes the current status of a hardware or software entity.\r
71 This included information about the class and subclass that is used to\r
72 classify the entity as well as an operation.\r
73 @param Instance The enumeration of a hardware or software entity within\r
74 the system. Valid instance numbers start with 1.\r
75 @param CallerId This optional parameter may be used to identify the caller.\r
76 This parameter allows the status code driver to apply different rules to\r
77 different callers.\r
78 @param Data This optional parameter may be used to pass additional data.\r
79\r
80 @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r
81 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r
82 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r
83\r
84**/\r
85EFI_STATUS\r
e798cd87 86EFIAPI\r
3af9b388 87SerialStatusCodeReportWorker (\r
88 IN EFI_STATUS_CODE_TYPE CodeType,\r
89 IN EFI_STATUS_CODE_VALUE Value,\r
90 IN UINT32 Instance,\r
91 IN EFI_GUID *CallerId,\r
92 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
93 );\r
94\r
95/**\r
96 Initialize runtime memory status code table as initialization for runtime memory status code worker\r
97 \r
98 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r
99\r
100**/\r
101EFI_STATUS\r
102RtMemoryStatusCodeInitializeWorker (\r
103 VOID\r
104 );\r
105\r
106/**\r
107 Report status code into runtime memory. If the runtime pool is full, roll back to the \r
108 first record and overwrite it.\r
109 \r
110 @param CodeType Indicates the type of status code being reported.\r
111 @param Value Describes the current status of a hardware or software entity.\r
112 This included information about the class and subclass that is used to\r
113 classify the entity as well as an operation.\r
114 @param Instance The enumeration of a hardware or software entity within\r
115 the system. Valid instance numbers start with 1.\r
116 @param CallerId This optional parameter may be used to identify the caller.\r
117 This parameter allows the status code driver to apply different rules to\r
118 different callers.\r
119 @param Data This optional parameter may be used to pass additional data.\r
120 \r
121 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r
122\r
123**/\r
124EFI_STATUS\r
e798cd87 125EFIAPI\r
3af9b388 126RtMemoryStatusCodeReportWorker (\r
127 IN EFI_STATUS_CODE_TYPE CodeType,\r
128 IN EFI_STATUS_CODE_VALUE Value,\r
129 IN UINT32 Instance,\r
130 IN EFI_GUID *CallerId,\r
131 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
132 );\r
133\r
134#endif\r