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