]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
Move Status Code Handler modules for PI implementation to MdeModulePkg.
[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
4 Copyright (c) 2009, Intel Corporation\r
5 All rights reserved. This program and the accompanying materials\r
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
32\r
33//\r
34// Runtime memory status code worker definition\r
35//\r
36typedef struct {\r
37 UINT32 RecordIndex;\r
38 UINT32 NumberOfRecords;\r
39 UINT32 MaxRecordsNumber;\r
40} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
41\r
42extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;\r
43\r
44/**\r
45 Locates Serial I/O Protocol as initialization for serial status code worker.\r
46 \r
47 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.\r
48\r
49**/\r
50EFI_STATUS\r
51EfiSerialStatusCodeInitializeWorker (\r
52 VOID\r
53 );\r
54\r
55\r
56/**\r
57 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
58 \r
59 @param CodeType Indicates the type of status code being reported.\r
60 @param Value Describes the current status of a hardware or software entity.\r
61 This included information about the class and subclass that is used to\r
62 classify the entity as well as an operation.\r
63 @param Instance The enumeration of a hardware or software entity within\r
64 the system. Valid instance numbers start with 1.\r
65 @param CallerId This optional parameter may be used to identify the caller.\r
66 This parameter allows the status code driver to apply different rules to\r
67 different callers.\r
68 @param Data This optional parameter may be used to pass additional data.\r
69\r
70 @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r
71 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r
72 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r
73\r
74**/\r
75EFI_STATUS\r
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
86 \r
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
96 Report status code into runtime memory. If the runtime pool is full, roll back to the \r
97 first record and overwrite it.\r
98 \r
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
109 \r
110 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r
111\r
112**/\r
113EFI_STATUS\r
114MemoryStatusCodeReportWorker (\r
115 IN EFI_STATUS_CODE_TYPE CodeType,\r
116 IN EFI_STATUS_CODE_VALUE Value,\r
117 IN UINT32 Instance,\r
118 IN EFI_GUID *CallerId,\r
119 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
120 );\r
121\r
122#endif\r