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