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