]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/Library/DuetDxeReportStatusCodeLib/ReportStatusCodeLibInternal.h
Update Unix platform to use dynamic HII pcd to save console output mode.
[mirror_edk2.git] / DuetPkg / Library / DuetDxeReportStatusCodeLib / ReportStatusCodeLibInternal.h
1 /** @file
2 Internal Header file of Report Status Code Library for RUNTIME
3 DXE Phase.
4
5 Copyright (c) 2006 - 2007, Intel Corporation<BR>
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
10
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13
14 **/
15 #ifndef __REPORT_STATUS_CODE_LIB_INTERNAL__H
16 #define __REPORT_STATUS_CODE_LIB_INTERNAL__H
17
18 #include <FrameworkDxe.h>
19
20 #include <Library/ReportStatusCodeLib.h>
21 #include <Library/DebugLib.h>
22 #include <Library/UefiBootServicesTableLib.h>
23 #include <Library/BaseLib.h>
24 #include <Library/BaseMemoryLib.h>
25 #include <Library/PcdLib.h>
26 #include <Library/UefiRuntimeServicesTableLib.h>
27 #include <Library/DevicePathLib.h>
28 #include <Library/HobLib.h>
29 #include <Guid/StatusCodeDataTypeId.h>
30 #include <Protocol/StatusCode.h>
31
32 #include <FrameworkModuleBase.h>
33 #include <DebugInfo.h>
34
35
36 /**
37 Locate he report status code service.
38
39 @return EFI_REPORT_STATUS_CODE function point to
40 ReportStatusCode.
41 **/
42 EFI_REPORT_STATUS_CODE
43 InternalGetReportStatusCode (
44 VOID
45 );
46
47 /**
48 Internal worker function that reports a status code through the Status Code Protocol
49
50 This function checks to see if a Status Code Protocol is present in the handle
51 database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is
52 returned. If a Status Code Protocol is present, then it is cached in gStatusCode,
53 and the ReportStatusCode() service of the Status Code Protocol is called passing in
54 Type, Value, Instance, CallerId, and Data. The result of this call is returned.
55
56 @param Type Status code type.
57 @param Value Status code value.
58 @param Instance Status code instance number.
59 @param CallerId Pointer to a GUID that identifies the caller of this
60 function. This is an optional parameter that may be
61 NULL.
62 @param Data Pointer to the extended data buffer. This is an
63 optional parameter that may be NULL.
64
65 @retval EFI_SUCCESS The status code was reported.
66 @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.
67 @retval EFI_UNSUPPORTED Status Code Protocol is not available.
68
69 **/
70 EFI_STATUS
71 InternalReportStatusCode (
72 IN EFI_STATUS_CODE_TYPE Type,
73 IN EFI_STATUS_CODE_VALUE Value,
74 IN UINT32 Instance,
75 IN CONST EFI_GUID *CallerId OPTIONAL,
76 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
77 );
78
79 /**
80 Reports a status code with full parameters.
81
82 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
83 is 0, then an extended data buffer is not reported. If ExtendedData is not
84 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
85 ExtendedData is assumed not have the standard status code header, so this function
86 is responsible for allocating a buffer large enough for the standard header and
87 the extended data passed into this function. The standard header is filled in
88 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
89 GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
90 an instance specified by Instance and a caller ID specified by CallerId. If
91 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
92
93 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
94 is called while processing another any other Report Status Code Library function,
95 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
96
97 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
98 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
99
100 @param Type Status code type.
101 @param Value Status code value.
102 @param Instance Status code instance number.
103 @param CallerId Pointer to a GUID that identifies the caller of this
104 function. If this parameter is NULL, then a caller
105 ID of gEfiCallerIdGuid is used.
106 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
107 If this parameter is NULL, then a the status code
108 standard header is filled in with
109 gEfiStatusCodeSpecificDataGuid.
110 @param ExtendedData Pointer to the extended data buffer. This is an
111 optional parameter that may be NULL.
112 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
113
114 @retval EFI_SUCCESS The status code was reported.
115 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
116 the extended data section if it was specified.
117 @retval EFI_UNSUPPORTED Report status code is not supported
118
119 **/
120 EFI_STATUS
121 EFIAPI
122 InternalReportStatusCodeEx (
123 IN EFI_STATUS_CODE_TYPE Type,
124 IN EFI_STATUS_CODE_VALUE Value,
125 IN UINT32 Instance,
126 IN CONST EFI_GUID *CallerId OPTIONAL,
127 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
128 IN CONST VOID *ExtendedData OPTIONAL,
129 IN UINTN ExtendedDataSize
130 );
131
132 extern EFI_REPORT_STATUS_CODE mReportStatusCode;
133
134 #endif // __REPORT_STATUS_CODE_LIB_INTERNAL__H
135