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