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