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