• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*++
2 
3   Copyright (c) 2004  - 2014, Intel Corporation. All rights reserved.<BR>
4 
5 
6   This program and the accompanying materials are licensed and made available under
7 
8   the terms and conditions of the BSD License that accompanies this distribution.
9 
10   The full text of the license may be found at
11 
12   http://opensource.org/licenses/bsd-license.php.
13 
14 
15 
16   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
17 
18   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
19 
20 
21 
22 
23 Module Name:
24 
25   MonoStatusCode.h
26 
27 Abstract:
28 
29   Monolithic single PEIM to provide the status code functionality.
30   The PEIM is a blend of libraries that correspond to the different status code
31   listeners that a platform installs.
32 
33 --*/
34 
35 #ifndef _MONO_STATUS_CODE_H_
36 #define _MONO_STATUS_CODE_H_
37 
38 //
39 // Statements that include other files.
40 //
41 #include "PiPei.h"
42 
43 #include "Pi/PiBootMode.h"
44 
45 #include "Ppi/StatusCode.h"
46 #include "Ppi/MemoryDiscovered.h"
47 #include "Ppi/FvLoadFile.h"
48 
49 #include "Library/HobLib.h"
50 #include "Library/DebugLib.h"
51 #include "Library/IoLib.h"
52 #include "Library/SerialPortLib.h"
53 #include "Protocol/StatusCode.h"
54 
55 
56 #ifndef _STATUS_CODE_ENABLER_H_
57 #define _STATUS_CODE_ENABLER_H_
58 
59 #ifdef EFI_DEBUG
60 
61 #define EFI_STATUS_CODE_ENABLER_HOB_GUID \
62   { \
63     0x5ffc6cf3, 0x71ad, 0x46f5, 0xbd, 0x8b, 0x7e, 0x8f, 0xfe, 0x19, 0x7, 0xd7 \
64   }
65 
66 extern EFI_GUID gEfiSerialStatusCodeEnablerHobGuid;
67 
68 typedef struct _EFI_STATUS_CODE_INFO {
69   BOOLEAN    StatusCodeDisable;
70 } EFI_STATUS_CODE_INFO;
71 
72 #endif
73 #endif
74 
75 
76 
77 //
78 // Platform specific function Declarations.  These must be implemented in a
79 // subdirectory named PlatformName in a file named PlatformStatusCode.c.
80 //
81 
82 //
83 // This is the platform function to initialize the listeners desired by the
84 // platform.
85 //
86 VOID
87 PlatformInitializeStatusCode (
88   IN EFI_FFS_FILE_HEADER       *FfsHeader,
89   IN CONST EFI_PEI_SERVICES          **PeiServices
90   );
91 
92 //
93 // This is the platform function that calls all of the listeners desired by the
94 // platform.
95 //
96 EFI_STATUS
97 EFIAPI
98 PlatformReportStatusCode (
99   IN CONST EFI_PEI_SERVICES       **PeiServices,
100   IN EFI_STATUS_CODE_TYPE         CodeType,
101   IN EFI_STATUS_CODE_VALUE        Value,
102   IN UINT32                       Instance,
103   IN CONST EFI_GUID               * CallerId,
104   IN CONST EFI_STATUS_CODE_DATA   * Data OPTIONAL
105   );
106 
107 //
108 // Platform independent function Declarations
109 //
110 //
111 // Initialize the status code listeners and publish the status code PPI.
112 //
113 VOID
114 EFIAPI
115 InitializeMonoStatusCode (
116   IN EFI_FFS_FILE_HEADER       *FfsHeader,
117   IN const EFI_PEI_SERVICES    **PeiServices
118   );
119 
120 //
121 // Convert a DXE status code call into a PEI status code call.
122 //
123 EFI_STATUS
124 EFIAPI
125 TranslateDxeStatusCodeToPeiStatusCode (
126   IN EFI_STATUS_CODE_TYPE     CodeType,
127   IN EFI_STATUS_CODE_VALUE    Value,
128   IN UINT32                   Instance,
129   IN EFI_GUID                 * CallerId,
130   IN EFI_STATUS_CODE_DATA     * Data OPTIONAL
131   );
132 
133 //
134 // Publish a HOB that contains the listener to be used by DXE.
135 //
136 EFI_STATUS
137 EFIAPI
138 InitializeDxeReportStatusCode (
139   IN const EFI_PEI_SERVICES       **PeiServices
140   );
141 
142 #endif
143