]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/StatusCodeHandler/RuntimeDxe/StatusCodeHandlerRuntimeDxe.h
9986f1140f8aa227534d978daf0c01e7d3d83b54
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / RuntimeDxe / StatusCodeHandlerRuntimeDxe.h
1 /** @file
2 Internal include file for Status Code Handler Driver.
3
4 Copyright (c) 2006 - 2009, Intel Corporation
5 All rights reserved. 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_RUNTIME_DXE_H__
16 #define __STATUS_CODE_HANDLER_RUNTIME_DXE_H__
17
18 #include <Protocol/ReportStatusCodeHandler.h>
19
20 #include <Guid/MemoryStatusCodeRecord.h>
21 #include <Guid/StatusCodeDataTypeId.h>
22 #include <Guid/StatusCodeDataTypeDebug.h>
23 #include <Guid/EventGroup.h>
24
25 #include <Library/SynchronizationLib.h>
26 #include <Library/DebugLib.h>
27 #include <Library/ReportStatusCodeLib.h>
28 #include <Library/PrintLib.h>
29 #include <Library/PcdLib.h>
30 #include <Library/HobLib.h>
31 #include <Library/UefiDriverEntryPoint.h>
32 #include <Library/UefiBootServicesTableLib.h>
33 #include <Library/MemoryAllocationLib.h>
34 #include <Library/UefiRuntimeLib.h>
35 #include <Library/SerialPortLib.h>
36
37 //
38 // Runtime memory status code worker definition
39 //
40 typedef struct {
41 UINT32 RecordIndex;
42 UINT32 NumberOfRecords;
43 UINT32 MaxRecordsNumber;
44 } RUNTIME_MEMORY_STATUSCODE_HEADER;
45
46 extern RUNTIME_MEMORY_STATUSCODE_HEADER *mRtMemoryStatusCodeTable;
47
48 /**
49 Locates Serial I/O Protocol as initialization for serial status code worker.
50
51 @retval EFI_SUCCESS Serial I/O Protocol is successfully located.
52
53 **/
54 EFI_STATUS
55 EfiSerialStatusCodeInitializeWorker (
56 VOID
57 );
58
59
60 /**
61 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
62
63 @param CodeType Indicates the type of status code being reported.
64 @param Value Describes the current status of a hardware or software entity.
65 This included information about the class and subclass that is used to
66 classify the entity as well as an operation.
67 @param Instance The enumeration of a hardware or software entity within
68 the system. Valid instance numbers start with 1.
69 @param CallerId This optional parameter may be used to identify the caller.
70 This parameter allows the status code driver to apply different rules to
71 different callers.
72 @param Data This optional parameter may be used to pass additional data.
73
74 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
75 @retval EFI_DEVICE_ERROR EFI serial device cannot work after ExitBootService() is called.
76 @retval EFI_DEVICE_ERROR EFI serial device cannot work with TPL higher than TPL_CALLBACK.
77
78 **/
79 EFI_STATUS
80 SerialStatusCodeReportWorker (
81 IN EFI_STATUS_CODE_TYPE CodeType,
82 IN EFI_STATUS_CODE_VALUE Value,
83 IN UINT32 Instance,
84 IN EFI_GUID *CallerId,
85 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
86 );
87
88 /**
89 Initialize runtime memory status code table as initialization for runtime memory status code worker
90
91 @retval EFI_SUCCESS Runtime memory status code table successfully initialized.
92
93 **/
94 EFI_STATUS
95 RtMemoryStatusCodeInitializeWorker (
96 VOID
97 );
98
99 /**
100 Report status code into runtime memory. If the runtime pool is full, roll back to the
101 first record and overwrite it.
102
103 @param CodeType Indicates the type of status code being reported.
104 @param Value Describes the current status of a hardware or software entity.
105 This included information about the class and subclass that is used to
106 classify the entity as well as an operation.
107 @param Instance The enumeration of a hardware or software entity within
108 the system. Valid instance numbers start with 1.
109 @param CallerId This optional parameter may be used to identify the caller.
110 This parameter allows the status code driver to apply different rules to
111 different callers.
112 @param Data This optional parameter may be used to pass additional data.
113
114 @retval EFI_SUCCESS Status code successfully recorded in runtime memory status code table.
115
116 **/
117 EFI_STATUS
118 RtMemoryStatusCodeReportWorker (
119 IN EFI_STATUS_CODE_TYPE CodeType,
120 IN EFI_STATUS_CODE_VALUE Value,
121 IN UINT32 Instance,
122 IN EFI_GUID *CallerId,
123 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
124 );
125
126 #endif