• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /** @file
2   Internal include file for Status Code PEIM.
3 
4   Copyright (c) 2006 - 2009, 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 __PEI_STATUS_CODE_H__
16 #define __PEI_STATUS_CODE_H__
17 
18 #include <FrameworkPei.h>
19 
20 #include <Guid/MemoryStatusCodeRecord.h>
21 #include <Guid/StatusCodeDataTypeId.h>
22 #include <Guid/StatusCodeDataTypeDebug.h>
23 #include <Ppi/StatusCode.h>
24 
25 #include <Library/BaseLib.h>
26 #include <Library/BaseMemoryLib.h>
27 #include <Library/DebugLib.h>
28 #include <Library/PrintLib.h>
29 #include <Library/ReportStatusCodeLib.h>
30 #include <Library/SerialPortLib.h>
31 #include <Library/HobLib.h>
32 #include <Library/PcdLib.h>
33 #include <Library/PeiServicesLib.h>
34 #include <Library/OemHookStatusCodeLib.h>
35 #include <Library/PeimEntryPoint.h>
36 
37 /**
38   Convert status code value and extended data to readable ASCII string, send string to serial I/O device.
39 
40   @param  CodeType         Indicates the type of status code being reported.
41   @param  Value            Describes the current status of a hardware or
42                            software entity. This includes information about the class and
43                            subclass that is used to classify the entity as well as an operation.
44                            For progress codes, the operation is the current activity.
45                            For error codes, it is the exception.For debug codes,it is not defined at this time.
46   @param  Instance         The enumeration of a hardware or software entity within
47                            the system. A system may contain multiple entities that match a class/subclass
48                            pairing. The instance differentiates between them. An instance of 0 indicates
49                            that instance information is unavailable, not meaningful, or not relevant.
50                            Valid instance numbers start with 1.
51   @param  CallerId         This optional parameter may be used to identify the caller.
52                            This parameter allows the status code driver to apply different rules to
53                            different callers.
54   @param  Data             This optional parameter may be used to pass additional data.
55 
56   @retval EFI_SUCCESS      Status code reported to serial I/O successfully.
57 
58 **/
59 EFI_STATUS
60 SerialStatusCodeReportWorker (
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  CodeType         Indicates the type of status code being reported.
87   @param  Value            Describes the current status of a hardware or
88                            software entity. This includes information about the class and
89                            subclass that is used to classify the entity as well as an operation.
90                            For progress codes, the operation is the current activity.
91                            For error codes, it is the exception.For debug codes,it is not defined at this time.
92   @param  Instance         The enumeration of a hardware or software entity within
93                            the system. A system may contain multiple entities that match a class/subclass
94                            pairing. The instance differentiates between them. An instance of 0 indicates
95                            that instance information is unavailable, not meaningful, or not relevant.
96                            Valid instance numbers start with 1.
97 
98   @retval EFI_SUCCESS      The function always return EFI_SUCCESS.
99 
100 **/
101 EFI_STATUS
102 MemoryStatusCodeReportWorker (
103   IN EFI_STATUS_CODE_TYPE     CodeType,
104   IN EFI_STATUS_CODE_VALUE    Value,
105   IN UINT32                   Instance
106   );
107 
108 /**
109   Publishes an interface that allows PEIMs to report status codes.
110 
111   This function implements EFI_PEI_PROGRESS_CODE_PPI.ReportStatusCode().
112   It publishes an interface that allows PEIMs to report status codes.
113 
114   @param  PeiServices      An indirect pointer to the EFI_PEI_SERVICES table published by the PEI Foundation.
115   @param  CodeType         Indicates the type of status code being reported.
116   @param  Value            Describes the current status of a hardware or
117                            software entity. This includes information about the class and
118                            subclass that is used to classify the entity as well as an operation.
119                            For progress codes, the operation is the current activity.
120                            For error codes, it is the exception.For debug codes,it is not defined at this time.
121   @param  Instance         The enumeration of a hardware or software entity within
122                            the system. A system may contain multiple entities that match a class/subclass
123                            pairing. The instance differentiates between them. An instance of 0 indicates
124                            that instance information is unavailable, not meaningful, or not relevant.
125                            Valid instance numbers start with 1.
126   @param  CallerId         This optional parameter may be used to identify the caller.
127                            This parameter allows the status code driver to apply different rules to
128                            different callers.
129   @param  Data             This optional parameter may be used to pass additional data.
130 
131   @retval EFI_SUCCESS      The function completed successfully.
132 
133 **/
134 EFI_STATUS
135 EFIAPI
136 ReportDispatcher (
137   IN CONST EFI_PEI_SERVICES         **PeiServices,
138   IN EFI_STATUS_CODE_TYPE           CodeType,
139   IN EFI_STATUS_CODE_VALUE          Value,
140   IN UINT32                         Instance,
141   IN CONST EFI_GUID                 *CallerId OPTIONAL,
142   IN CONST EFI_STATUS_CODE_DATA     *Data OPTIONAL
143   );
144 
145 #endif
146 
147 
148