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