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