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