]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/StatusCodeHandler/Smm/StatusCodeHandlerSmm.h
Update the copyright notice format
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / Smm / StatusCodeHandlerSmm.h
1 /** @file
2 Internal include file for Status Code Handler Driver.
3
4 Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>
5 This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef __STATUS_CODE_HANDLER_SMM_H__
16 #define __STATUS_CODE_HANDLER_SMM_H__
17
18 #include <Protocol/SmmReportStatusCodeHandler.h>
19
20 #include <Guid/MemoryStatusCodeRecord.h>
21 #include <Guid/StatusCodeDataTypeId.h>
22 #include <Guid/StatusCodeDataTypeDebug.h>
23
24 #include <Library/SynchronizationLib.h>
25 #include <Library/DebugLib.h>
26 #include <Library/ReportStatusCodeLib.h>
27 #include <Library/PrintLib.h>
28 #include <Library/PcdLib.h>
29 #include <Library/UefiDriverEntryPoint.h>
30 #include <Library/SmmServicesTableLib.h>
31 #include <Library/SerialPortLib.h>
32 #include <Library/MemoryAllocationLib.h>
33
34 //
35 // Runtime memory status code worker definition
36 //
37 typedef struct {
38 UINT32 RecordIndex;
39 UINT32 NumberOfRecords;
40 UINT32 MaxRecordsNumber;
41 } RUNTIME_MEMORY_STATUSCODE_HEADER;
42
43 extern RUNTIME_MEMORY_STATUSCODE_HEADER *mSmmMemoryStatusCodeTable;
44
45 /**
46 Locates Serial I/O Protocol as initialization for serial status code worker.
47
48 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
49
50 **/
51 EFI_STATUS
52 EfiSerialStatusCodeInitializeWorker (
53 VOID
54 );
55
56
57 /**
58 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
59
60 @param CodeType Indicates the type of status code being reported.
61 @param Value Describes the current status of a hardware or software entity.
62 This included information about the class and subclass that is used to
63 classify the entity as well as an operation.
64 @param Instance The enumeration of a hardware or software entity within
65 the system. Valid instance numbers start with 1.
66 @param CallerId This optional parameter may be used to identify the caller.
67 This parameter allows the status code driver to apply different rules to
68 different callers.
69 @param Data This optional parameter may be used to pass additional data.
70
71 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
72 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
73 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
74
75 **/
76 EFI_STATUS
77 EFIAPI
78 SerialStatusCodeReportWorker (
79 IN EFI_STATUS_CODE_TYPE CodeType,
80 IN EFI_STATUS_CODE_VALUE Value,
81 IN UINT32 Instance,
82 IN EFI_GUID *CallerId,
83 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
84 );
85
86 /**
87 Initialize runtime memory status code table as initialization for runtime memory status code worker
88
89 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
90
91 **/
92 EFI_STATUS
93 MemoryStatusCodeInitializeWorker (
94 VOID
95 );
96
97 /**
98 Report status code into runtime memory. If the runtime pool is full, roll back to the
99 first record and overwrite it.
100
101 @param CodeType Indicates the type of status code being reported.
102 @param Value Describes the current status of a hardware or software entity.
103 This included information about the class and subclass that is used to
104 classify the entity as well as an operation.
105 @param Instance The enumeration of a hardware or software entity within
106 the system. Valid instance numbers start with 1.
107 @param CallerId This optional parameter may be used to identify the caller.
108 This parameter allows the status code driver to apply different rules to
109 different callers.
110 @param Data This optional parameter may be used to pass additional data.
111
112 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
113
114 **/
115 EFI_STATUS
116 EFIAPI
117 MemoryStatusCodeReportWorker (
118 IN EFI_STATUS_CODE_TYPE CodeType,
119 IN EFI_STATUS_CODE_VALUE Value,
120 IN UINT32 Instance,
121 IN EFI_GUID *CallerId,
122 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
123 );
124
125 #endif