]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerMm.h
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / Smm / StatusCodeHandlerMm.h
CommitLineData
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
8a09cdd7
KQ
10#ifndef __STATUS_CODE_HANDLER_MM_H__\r
11#define __STATUS_CODE_HANDLER_MM_H__\r
3af9b388 12\r
8a09cdd7 13#include <Protocol/MmReportStatusCodeHandler.h>\r
3af9b388 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
8a09cdd7 25#include <Library/MmServicesTableLib.h>\r
3af9b388 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
1436aea4 33#define MAX_DEBUG_MESSAGE_LENGTH 0x100\r
90eaa3c1 34\r
8a09cdd7 35extern RUNTIME_MEMORY_STATUSCODE_HEADER *mMmMemoryStatusCodeTable;\r
3af9b388 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
43EFI_STATUS\r
44EfiSerialStatusCodeInitializeWorker (\r
45 VOID\r
46 );\r
47\r
3af9b388 48/**\r
49 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
848e1472 50\r
3af9b388 51 @param CodeType Indicates the type of status code being reported.\r
52 @param Value Describes the current status of a hardware or software entity.\r
53 This included information about the class and subclass that is used to\r
54 classify the entity as well as an operation.\r
55 @param Instance The enumeration of a hardware or software entity within\r
56 the system. Valid instance numbers start with 1.\r
57 @param CallerId This optional parameter may be used to identify the caller.\r
58 This parameter allows the status code driver to apply different rules to\r
59 different callers.\r
60 @param Data This optional parameter may be used to pass additional data.\r
61\r
62 @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r
63 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r
64 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r
65\r
66**/\r
67EFI_STATUS\r
e798cd87 68EFIAPI\r
3af9b388 69SerialStatusCodeReportWorker (\r
1436aea4
MK
70 IN EFI_STATUS_CODE_TYPE CodeType,\r
71 IN EFI_STATUS_CODE_VALUE Value,\r
72 IN UINT32 Instance,\r
73 IN EFI_GUID *CallerId,\r
74 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
3af9b388 75 );\r
76\r
77/**\r
78 Initialize runtime memory status code table as initialization for runtime memory status code worker\r
d1102dba 79\r
3af9b388 80 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r
81\r
82**/\r
83EFI_STATUS\r
84MemoryStatusCodeInitializeWorker (\r
85 VOID\r
86 );\r
87\r
88/**\r
d1102dba 89 Report status code into runtime memory. If the runtime pool is full, roll back to the\r
3af9b388 90 first record and overwrite it.\r
848e1472 91\r
3af9b388 92 @param CodeType Indicates the type of status code being reported.\r
93 @param Value Describes the current status of a hardware or software entity.\r
94 This included information about the class and subclass that is used to\r
95 classify the entity as well as an operation.\r
96 @param Instance The enumeration of a hardware or software entity within\r
97 the system. Valid instance numbers start with 1.\r
98 @param CallerId This optional parameter may be used to identify the caller.\r
99 This parameter allows the status code driver to apply different rules to\r
100 different callers.\r
101 @param Data This optional parameter may be used to pass additional data.\r
848e1472 102\r
3af9b388 103 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r
104\r
105**/\r
106EFI_STATUS\r
e798cd87 107EFIAPI\r
3af9b388 108MemoryStatusCodeReportWorker (\r
1436aea4
MK
109 IN EFI_STATUS_CODE_TYPE CodeType,\r
110 IN EFI_STATUS_CODE_VALUE Value,\r
111 IN UINT32 Instance,\r
112 IN EFI_GUID *CallerId,\r
113 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
3af9b388 114 );\r
115\r
8a09cdd7
KQ
116/**\r
117 Entry point of Common MM Status Code Driver.\r
118\r
119 This function is the entry point of MM Status Code Driver.\r
120\r
121 @retval EFI_SUCCESS The entry point is executed successfully.\r
122\r
123**/\r
124EFI_STATUS\r
125StatusCodeHandlerCommonEntry (\r
126 VOID\r
127 );\r
128\r
3af9b388 129#endif\r