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