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