]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/StatusCodeHandler/Pei/StatusCodeHandlerPei.h
MdeModulePkg: Apply uncrustify changes
[mirror_edk2.git] / MdeModulePkg / Universal / StatusCodeHandler / Pei / StatusCodeHandlerPei.h
1 /** @file
2 Internal include file for Status Code Handler PEIM.
3
4 Copyright (c) 2006 - 2012, Intel Corporation. All rights reserved.<BR>
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 **/
8
9 #ifndef __STATUS_CODE_HANDLER_PEI_H__
10 #define __STATUS_CODE_HANDLER_PEI_H__
11
12 #include <Ppi/ReportStatusCodeHandler.h>
13
14 #include <Guid/MemoryStatusCodeRecord.h>
15 #include <Guid/StatusCodeDataTypeId.h>
16 #include <Guid/StatusCodeDataTypeDebug.h>
17
18 #include <Library/DebugLib.h>
19 #include <Library/PrintLib.h>
20 #include <Library/ReportStatusCodeLib.h>
21 #include <Library/SerialPortLib.h>
22 #include <Library/HobLib.h>
23 #include <Library/PcdLib.h>
24 #include <Library/PeiServicesLib.h>
25 #include <Library/PeimEntryPoint.h>
26 #include <Library/BaseMemoryLib.h>
27
28 //
29 // Define the maximum message length
30 //
31 #define MAX_DEBUG_MESSAGE_LENGTH 0x100
32
33 /**
34 Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
35
36 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
37 @param CodeType Indicates the type of status code being reported.
38 @param Value Describes the current status of a hardware or
39 software entity. This includes information about the class and
40 subclass that is used to classify the entity as well as an operation.
41 For progress codes, the operation is the current activity.
42 For error codes, it is the exception.For debug codes,it is not defined at this time.
43 @param Instance The enumeration of a hardware or software entity within
44 the system. A system may contain multiple entities that match a class/subclass
45 pairing. The instance differentiates between them. An instance of 0 indicates
46 that instance information is unavailable, not meaningful, or not relevant.
47 Valid instance numbers start with 1.
48 @param CallerId This optional parameter may be used to identify the caller.
49 This parameter allows the status code driver to apply different rules to
50 different callers.
51 @param Data This optional parameter may be used to pass additional data.
52
53 @retval EFI_SUCCESS Status code reported to serial I/O successfully.
54
55 **/
56 EFI_STATUS
57 EFIAPI
58 SerialStatusCodeReportWorker (
59 IN CONST EFI_PEI_SERVICES **PeiServices,
60 IN EFI_STATUS_CODE_TYPE CodeType,
61 IN EFI_STATUS_CODE_VALUE Value,
62 IN UINT32 Instance,
63 IN CONST EFI_GUID *CallerId,
64 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
65 );
66
67 /**
68 Create the first memory status code GUID'ed HOB as initialization for memory status code worker.
69
70 @retval EFI_SUCCESS The GUID'ed HOB is created successfully.
71
72 **/
73 EFI_STATUS
74 MemoryStatusCodeInitializeWorker (
75 VOID
76 );
77
78 /**
79 Report status code into GUID'ed HOB.
80
81 This function reports status code into GUID'ed HOB. If not all packets are full, then
82 write status code into available entry. Otherwise, create a new packet for it.
83
84 @param PeiServices An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
85 @param CodeType Indicates the type of status code being reported.
86 @param Value Describes the current status of a hardware or
87 software entity. This includes information about the class and
88 subclass that is used to classify the entity as well as an operation.
89 For progress codes, the operation is the current activity.
90 For error codes, it is the exception.For debug codes,it is not defined at this time.
91 @param Instance The enumeration of a hardware or software entity within
92 the system. A system may contain multiple entities that match a class/subclass
93 pairing. The instance differentiates between them. An instance of 0 indicates
94 that instance information is unavailable, not meaningful, or not relevant.
95 Valid instance numbers start with 1.
96 @param CallerId This optional parameter may be used to identify the caller.
97 This parameter allows the status code driver to apply different rules to
98 different callers.
99 @param Data This optional parameter may be used to pass additional data.
100
101 @retval EFI_SUCCESS The function always return EFI_SUCCESS.
102
103 **/
104 EFI_STATUS
105 EFIAPI
106 MemoryStatusCodeReportWorker (
107 IN CONST EFI_PEI_SERVICES **PeiServices,
108 IN EFI_STATUS_CODE_TYPE CodeType,
109 IN EFI_STATUS_CODE_VALUE Value,
110 IN UINT32 Instance,
111 IN CONST EFI_GUID *CallerId,
112 IN CONST EFI_STATUS_CODE_DATA *Data OPTIONAL
113 );
114
115 #endif