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