]> git.proxmox.com Git - mirror_edk2.git/blob - DuetPkg/Library/DxeCoreReportStatusCodeLibFromHob/ReportStatusCodeLibInternal.h
40c41570d15f487c07825679feedfa327f2eda27
[mirror_edk2.git] / DuetPkg / Library / DxeCoreReportStatusCodeLibFromHob / ReportStatusCodeLibInternal.h
1 /** @file
2 Internal Header file of Report Status Code Library.
3
4 Copyright (c) 2009, Intel Corporation<BR>
5 All rights reserved. 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 #ifndef __REPORT_STATUS_CODE_LIB_INTERNAL_H__
15 #define __REPORT_STATUS_CODE_LIB_INTERNAL_H__
16
17 #include <FrameworkDxe.h>
18
19 #include <Library/ReportStatusCodeLib.h>
20 #include <Library/DebugLib.h>
21 #include <Library/UefiBootServicesTableLib.h>
22 #include <Library/BaseLib.h>
23 #include <Library/BaseMemoryLib.h>
24 #include <Library/PcdLib.h>
25 #include <Library/DevicePathLib.h>
26 #include <Library/HobLib.h>
27
28 #include <Guid/StatusCodeDataTypeId.h>
29 #include <Guid/StatusCodeDataTypeDebug.h>
30 #include <Protocol/StatusCode.h>
31
32 #include <FrameworkModuleBase.h>
33
34
35 /**
36 Internal worker function that reports a status code through the Status Code Protocol
37
38 This function checks to see if a Status Code Protocol is present in the handle
39 database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is
40 returned. If a Status Code Protocol is present, then it is cached in gStatusCode,
41 and the ReportStatusCode() service of the Status Code Protocol is called passing in
42 Type, Value, Instance, CallerId, and Data. The result of this call is returned.
43
44 @param Type Status code type.
45 @param Value Status code value.
46 @param Instance Status code instance number.
47 @param CallerId Pointer to a GUID that identifies the caller of this
48 function. This is an optional parameter that may be
49 NULL.
50 @param Data Pointer to the extended data buffer. This is an
51 optional parameter that may be NULL.
52
53 @retval EFI_SUCCESS The status code was reported.
54 @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.
55 @retval EFI_UNSUPPORTED Status Code Protocol is not available.
56
57 **/
58 EFI_STATUS
59 InternalReportStatusCode (
60 IN EFI_STATUS_CODE_TYPE Type,
61 IN EFI_STATUS_CODE_VALUE Value,
62 IN UINT32 Instance,
63 IN CONST EFI_GUID *CallerId OPTIONAL,
64 IN EFI_STATUS_CODE_DATA *Data OPTIONAL
65 );
66
67 /**
68 Reports a status code with full parameters.
69
70 The function reports a status code. If ExtendedData is NULL and ExtendedDataSize
71 is 0, then an extended data buffer is not reported. If ExtendedData is not
72 NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.
73 ExtendedData is assumed not have the standard status code header, so this function
74 is responsible for allocating a buffer large enough for the standard header and
75 the extended data passed into this function. The standard header is filled in
76 with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a
77 GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with
78 an instance specified by Instance and a caller ID specified by CallerId. If
79 CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.
80
81 ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()
82 is called while processing another any other Report Status Code Library function,
83 then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.
84
85 If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().
86 If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().
87
88 @param Type Status code type.
89 @param Value Status code value.
90 @param Instance Status code instance number.
91 @param CallerId Pointer to a GUID that identifies the caller of this
92 function. If this parameter is NULL, then a caller
93 ID of gEfiCallerIdGuid is used.
94 @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.
95 If this parameter is NULL, then a the status code
96 standard header is filled in with
97 gEfiStatusCodeSpecificDataGuid.
98 @param ExtendedData Pointer to the extended data buffer. This is an
99 optional parameter that may be NULL.
100 @param ExtendedDataSize The size, in bytes, of the extended data buffer.
101
102 @retval EFI_SUCCESS The status code was reported.
103 @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate
104 the extended data section if it was specified.
105 @retval EFI_UNSUPPORTED Report status code is not supported
106
107 **/
108 EFI_STATUS
109 EFIAPI
110 InternalReportStatusCodeEx (
111 IN EFI_STATUS_CODE_TYPE Type,
112 IN EFI_STATUS_CODE_VALUE Value,
113 IN UINT32 Instance,
114 IN CONST EFI_GUID *CallerId OPTIONAL,
115 IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,
116 IN CONST VOID *ExtendedData OPTIONAL,
117 IN UINTN ExtendedDataSize
118 );
119
120 extern EFI_STATUS_CODE_PROTOCOL mStatusProtocol;
121
122 #endif // __REPORT_STATUS_CODE_LIB_INTERNAL__H
123