]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
Update the copyright notice format
[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
3af9b388 33\r
34//\r
35// Runtime memory status code worker definition\r
36//\r
37typedef struct {\r
38 UINT32 RecordIndex;\r
39 UINT32 NumberOfRecords;\r
40 UINT32 MaxRecordsNumber;\r
41} RUNTIME_MEMORY_STATUSCODE_HEADER;\r
42\r
43extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;\r
44\r
45/**\r
46 Locates Serial I/O Protocol as initialization for serial status code worker.\r
47 \r
48 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.\r
49\r
50**/\r
51EFI_STATUS\r
52EfiSerialStatusCodeInitializeWorker (\r
53 VOID\r
54 );\r
55\r
56\r
57/**\r
58 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.\r
59 \r
60 @param CodeType Indicates the type of status code being reported.\r
61 @param Value Describes the current status of a hardware or software entity.\r
62 This included information about the class and subclass that is used to\r
63 classify the entity as well as an operation.\r
64 @param Instance The enumeration of a hardware or software entity within\r
65 the system. Valid instance numbers start with 1.\r
66 @param CallerId This optional parameter may be used to identify the caller.\r
67 This parameter allows the status code driver to apply different rules to\r
68 different callers.\r
69 @param Data This optional parameter may be used to pass additional data.\r
70\r
71 @retval EFI_SUCCESS Status code reported to serial I/O successfully.\r
72 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.\r
73 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.\r
74\r
75**/\r
76EFI_STATUS\r
e798cd87 77EFIAPI\r
3af9b388 78SerialStatusCodeReportWorker (\r
79 IN EFI_STATUS_CODE_TYPE CodeType,\r
80 IN EFI_STATUS_CODE_VALUE Value,\r
81 IN UINT32 Instance,\r
82 IN EFI_GUID *CallerId,\r
83 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
84 );\r
85\r
86/**\r
87 Initialize runtime memory status code table as initialization for runtime memory status code worker\r
88 \r
89 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.\r
90\r
91**/\r
92EFI_STATUS\r
93MemoryStatusCodeInitializeWorker (\r
94 VOID\r
95 );\r
96\r
97/**\r
98 Report status code into runtime memory. If the runtime pool is full, roll back to the \r
99 first record and overwrite it.\r
100 \r
101 @param CodeType Indicates the type of status code being reported.\r
102 @param Value Describes the current status of a hardware or software entity.\r
103 This included information about the class and subclass that is used to\r
104 classify the entity as well as an operation.\r
105 @param Instance The enumeration of a hardware or software entity within\r
106 the system. Valid instance numbers start with 1.\r
107 @param CallerId This optional parameter may be used to identify the caller.\r
108 This parameter allows the status code driver to apply different rules to\r
109 different callers.\r
110 @param Data This optional parameter may be used to pass additional data.\r
111 \r
112 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.\r
113\r
114**/\r
115EFI_STATUS\r
e798cd87 116EFIAPI\r
3af9b388 117MemoryStatusCodeReportWorker (\r
118 IN EFI_STATUS_CODE_TYPE CodeType,\r
119 IN EFI_STATUS_CODE_VALUE Value,\r
120 IN UINT32 Instance,\r
121 IN EFI_GUID *CallerId,\r
122 IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r
123 );\r
124\r
125#endif\r