]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
Handle gEfiStatusCodeDataTypeStringGuid in status code handler drivers.
[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
e5eed7d3
HT
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
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_SMM_H__\r
16#define __STATUS_CODE_HANDLER_SMM_H__\r
17\r
18#include <Protocol/SmmReportStatusCodeHandler.h>\r
19\r
20#include <Guid/MemoryStatusCodeRecord.h>\r
21#include <Guid/StatusCodeDataTypeId.h>\r
22#include <Guid/StatusCodeDataTypeDebug.h>\r
23\r
24#include <Library/SynchronizationLib.h>\r
25#include <Library/DebugLib.h>\r
26#include <Library/ReportStatusCodeLib.h>\r
27#include <Library/PrintLib.h>\r
28#include <Library/PcdLib.h>\r
29#include <Library/UefiDriverEntryPoint.h>\r
30#include <Library/SmmServicesTableLib.h>\r
31#include <Library/SerialPortLib.h>\r
d3308de7 32#include <Library/MemoryAllocationLib.h>\r
96a25163 33#include <Library/BaseMemoryLib.h>\r
3af9b388 34\r
35//\r
36// Runtime memory status code worker definition\r
37//\r
38typedef struct {\r
39 UINT32 RecordIndex;\r
40 UINT32 NumberOfRecords;\r
41 UINT32 MaxRecordsNumber;\r
42} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
43\r
44extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;\r
45\r
46/**\r
47 Locates Serial I/O Protocol as initialization for serial status code worker.\r
48 \r
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
60 \r
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
89 \r
90 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r
91\r
92**/\r
93EFI_STATUS\r
94MemoryStatusCodeInitializeWorker (\r
95 VOID\r
96 );\r
97\r
98/**\r
99 Report status code into runtime memory. If the runtime pool is full, roll back to the \r
100 first record and overwrite it.\r
101 \r
102 @param CodeType Indicates the type of status code being reported.\r
103 @param Value Describes the current status of a hardware or software entity.\r
104 This included information about the class and subclass that is used to\r
105 classify the entity as well as an operation.\r
106 @param Instance The enumeration of a hardware or software entity within\r
107 the system. Valid instance numbers start with 1.\r
108 @param CallerId This optional parameter may be used to identify the caller.\r
109 This parameter allows the status code driver to apply different rules to\r
110 different callers.\r
111 @param Data This optional parameter may be used to pass additional data.\r
112 \r
113 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r
114\r
115**/\r
116EFI_STATUS\r
e798cd87 117EFIAPI\r
3af9b388 118MemoryStatusCodeReportWorker (\r
119 IN EFI_STATUS_CODE_TYPE CodeType,\r
120 IN EFI_STATUS_CODE_VALUE Value,\r
121 IN UINT32 Instance,\r
122 IN EFI_GUID *CallerId,\r
123 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
124 );\r
125\r
126#endif\r