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