]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
MdeModulePkg: Clean up source files
[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
d1102dba 4 Copyright (c) 2006 - 2018, Intel Corporation. All rights reserved.<BR>\r
848e1472 5 (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
e5eed7d3 6 This program and the accompanying materials\r
3af9b388 7 are licensed and made available under the terms and conditions of the BSD License\r
8 which accompanies this distribution. The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __STATUS_CODE_HANDLER_RUNTIME_DXE_H__\r
17#define __STATUS_CODE_HANDLER_RUNTIME_DXE_H__\r
18\r
19#include <Protocol/ReportStatusCodeHandler.h>\r
20\r
21#include <Guid/MemoryStatusCodeRecord.h>\r
22#include <Guid/StatusCodeDataTypeId.h>\r
23#include <Guid/StatusCodeDataTypeDebug.h>\r
24#include <Guid/EventGroup.h>\r
25\r
26#include <Library/SynchronizationLib.h>\r
96a25163 27#include <Library/BaseMemoryLib.h>\r
3af9b388 28#include <Library/DebugLib.h>\r
29#include <Library/ReportStatusCodeLib.h>\r
30#include <Library/PrintLib.h>\r
31#include <Library/PcdLib.h>\r
32#include <Library/HobLib.h>\r
33#include <Library/UefiDriverEntryPoint.h>\r
34#include <Library/UefiBootServicesTableLib.h>\r
35#include <Library/MemoryAllocationLib.h>\r
36#include <Library/UefiRuntimeLib.h>\r
37#include <Library/SerialPortLib.h>\r
38\r
90eaa3c1
SZ
39//\r
40// Define the maximum message length\r
41//\r
42#define MAX_DEBUG_MESSAGE_LENGTH 0x100\r
43\r
3af9b388 44extern RUNTIME_MEMORY_STATUSCODE_HEADER *mRtMemoryStatusCodeTable;\r
45\r
46/**\r
47 Locates Serial I/O Protocol as initialization for serial status code worker.\r
d1102dba 48\r
3af9b388 49 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.\r
50\r
51**/\r
52EFI_STATUS\r
53EfiSerialStatusCodeInitializeWorker (\r
54 VOID\r
55 );\r
56\r
57\r
58/**\r
59 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
848e1472 60\r
3af9b388 61 @param CodeType Indicates the type of status code being reported.\r
62 @param Value Describes the current status of a hardware or software entity.\r
63 This included information about the class and subclass that is used to\r
64 classify the entity as well as an operation.\r
65 @param Instance The enumeration of a hardware or software entity within\r
66 the system. Valid instance numbers start with 1.\r
67 @param CallerId This optional parameter may be used to identify the caller.\r
68 This parameter allows the status code driver to apply different rules to\r
69 different callers.\r
70 @param Data This optional parameter may be used to pass additional data.\r
71\r
72 @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r
73 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r
74 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r
75\r
76**/\r
77EFI_STATUS\r
e798cd87 78EFIAPI\r
3af9b388 79SerialStatusCodeReportWorker (\r
80 IN EFI_STATUS_CODE_TYPE CodeType,\r
81 IN EFI_STATUS_CODE_VALUE Value,\r
82 IN UINT32 Instance,\r
83 IN EFI_GUID *CallerId,\r
84 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
85 );\r
86\r
87/**\r
88 Initialize runtime memory status code table as initialization for runtime memory status code worker\r
d1102dba 89\r
3af9b388 90 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r
848e1472 91 @retval others Errors from gBS->InstallConfigurationTable().\r
3af9b388 92\r
93**/\r
94EFI_STATUS\r
95RtMemoryStatusCodeInitializeWorker (\r
96 VOID\r
97 );\r
98\r
99/**\r
d1102dba 100 Report status code into runtime memory. If the runtime pool is full, roll back to the\r
3af9b388 101 first record and overwrite it.\r
848e1472 102\r
3af9b388 103 @param CodeType Indicates the type of status code being reported.\r
104 @param Value Describes the current status of a hardware or software entity.\r
105 This included information about the class and subclass that is used to\r
106 classify the entity as well as an operation.\r
107 @param Instance The enumeration of a hardware or software entity within\r
108 the system. Valid instance numbers start with 1.\r
109 @param CallerId This optional parameter may be used to identify the caller.\r
110 This parameter allows the status code driver to apply different rules to\r
111 different callers.\r
112 @param Data This optional parameter may be used to pass additional data.\r
848e1472 113\r
3af9b388 114 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r
115\r
116**/\r
117EFI_STATUS\r
e798cd87 118EFIAPI\r
3af9b388 119RtMemoryStatusCodeReportWorker (\r
120 IN EFI_STATUS_CODE_TYPE CodeType,\r
121 IN EFI_STATUS_CODE_VALUE Value,\r
122 IN UINT32 Instance,\r
123 IN EFI_GUID *CallerId,\r
124 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
125 );\r
126\r
127#endif\r