]>
Commit | Line | Data |
---|---|---|
6dacb8cd | 1 | /** @file\r |
2 | Internal Header file of Report Status Code Library.\r | |
3 | \r | |
4 | Copyright (c) 2009, Intel Corporation<BR>\r | |
5 | All rights reserved. This program and the accompanying materials\r | |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
12 | \r | |
13 | **/\r | |
14 | #ifndef __REPORT_STATUS_CODE_LIB_INTERNAL_H__\r | |
15 | #define __REPORT_STATUS_CODE_LIB_INTERNAL_H__\r | |
16 | \r | |
17 | #include <FrameworkDxe.h>\r | |
18 | \r | |
19 | #include <Library/ReportStatusCodeLib.h>\r | |
20 | #include <Library/DebugLib.h>\r | |
21 | #include <Library/UefiBootServicesTableLib.h>\r | |
22 | #include <Library/BaseLib.h>\r | |
23 | #include <Library/BaseMemoryLib.h>\r | |
24 | #include <Library/PcdLib.h>\r | |
25 | #include <Library/DevicePathLib.h>\r | |
26 | #include <Library/HobLib.h>\r | |
27 | \r | |
28 | #include <Guid/StatusCodeDataTypeId.h>\r | |
fd894392 | 29 | #include <Guid/StatusCodeDataTypeDebug.h>\r |
6dacb8cd | 30 | #include <Protocol/StatusCode.h>\r |
31 | \r | |
6dacb8cd | 32 | /**\r |
33 | Internal worker function that reports a status code through the Status Code Protocol\r | |
34 | \r | |
35 | This function checks to see if a Status Code Protocol is present in the handle\r | |
36 | database. If a Status Code Protocol is not present, then EFI_UNSUPPORTED is\r | |
37 | returned. If a Status Code Protocol is present, then it is cached in gStatusCode,\r | |
38 | and the ReportStatusCode() service of the Status Code Protocol is called passing in\r | |
39 | Type, Value, Instance, CallerId, and Data. The result of this call is returned.\r | |
40 | \r | |
41 | @param Type Status code type.\r | |
42 | @param Value Status code value.\r | |
43 | @param Instance Status code instance number.\r | |
44 | @param CallerId Pointer to a GUID that identifies the caller of this\r | |
45 | function. This is an optional parameter that may be\r | |
46 | NULL.\r | |
47 | @param Data Pointer to the extended data buffer. This is an\r | |
48 | optional parameter that may be NULL.\r | |
49 | \r | |
50 | @retval EFI_SUCCESS The status code was reported.\r | |
51 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to report the status code.\r | |
52 | @retval EFI_UNSUPPORTED Status Code Protocol is not available.\r | |
53 | \r | |
54 | **/\r | |
55 | EFI_STATUS\r | |
56 | InternalReportStatusCode (\r | |
57 | IN EFI_STATUS_CODE_TYPE Type,\r | |
58 | IN EFI_STATUS_CODE_VALUE Value,\r | |
59 | IN UINT32 Instance,\r | |
60 | IN CONST EFI_GUID *CallerId OPTIONAL,\r | |
61 | IN EFI_STATUS_CODE_DATA *Data OPTIONAL\r | |
62 | );\r | |
63 | \r | |
64 | /**\r | |
65 | Reports a status code with full parameters.\r | |
66 | \r | |
67 | The function reports a status code. If ExtendedData is NULL and ExtendedDataSize\r | |
68 | is 0, then an extended data buffer is not reported. If ExtendedData is not\r | |
69 | NULL and ExtendedDataSize is not 0, then an extended data buffer is allocated.\r | |
70 | ExtendedData is assumed not have the standard status code header, so this function\r | |
71 | is responsible for allocating a buffer large enough for the standard header and\r | |
72 | the extended data passed into this function. The standard header is filled in\r | |
73 | with a GUID specified by ExtendedDataGuid. If ExtendedDataGuid is NULL, then a\r | |
74 | GUID of gEfiStatusCodeSpecificDatauid is used. The status code is reported with\r | |
75 | an instance specified by Instance and a caller ID specified by CallerId. If\r | |
76 | CallerId is NULL, then a caller ID of gEfiCallerIdGuid is used.\r | |
77 | \r | |
78 | ReportStatusCodeEx()must actively prevent recursion. If ReportStatusCodeEx()\r | |
79 | is called while processing another any other Report Status Code Library function,\r | |
80 | then ReportStatusCodeEx() must return EFI_DEVICE_ERROR immediately.\r | |
81 | \r | |
82 | If ExtendedData is NULL and ExtendedDataSize is not zero, then ASSERT().\r | |
83 | If ExtendedData is not NULL and ExtendedDataSize is zero, then ASSERT().\r | |
84 | \r | |
85 | @param Type Status code type.\r | |
86 | @param Value Status code value.\r | |
87 | @param Instance Status code instance number.\r | |
88 | @param CallerId Pointer to a GUID that identifies the caller of this\r | |
89 | function. If this parameter is NULL, then a caller\r | |
90 | ID of gEfiCallerIdGuid is used.\r | |
91 | @param ExtendedDataGuid Pointer to the GUID for the extended data buffer.\r | |
92 | If this parameter is NULL, then a the status code\r | |
93 | standard header is filled in with\r | |
94 | gEfiStatusCodeSpecificDataGuid.\r | |
95 | @param ExtendedData Pointer to the extended data buffer. This is an\r | |
96 | optional parameter that may be NULL.\r | |
97 | @param ExtendedDataSize The size, in bytes, of the extended data buffer.\r | |
98 | \r | |
99 | @retval EFI_SUCCESS The status code was reported.\r | |
100 | @retval EFI_OUT_OF_RESOURCES There were not enough resources to allocate\r | |
101 | the extended data section if it was specified.\r | |
102 | @retval EFI_UNSUPPORTED Report status code is not supported\r | |
103 | \r | |
104 | **/\r | |
105 | EFI_STATUS\r | |
106 | EFIAPI\r | |
107 | InternalReportStatusCodeEx (\r | |
108 | IN EFI_STATUS_CODE_TYPE Type,\r | |
109 | IN EFI_STATUS_CODE_VALUE Value,\r | |
110 | IN UINT32 Instance,\r | |
111 | IN CONST EFI_GUID *CallerId OPTIONAL,\r | |
112 | IN CONST EFI_GUID *ExtendedDataGuid OPTIONAL,\r | |
113 | IN CONST VOID *ExtendedData OPTIONAL,\r | |
114 | IN UINTN ExtendedDataSize\r | |
115 | );\r | |
116 | \r | |
117 | extern EFI_STATUS_CODE_PROTOCOL mStatusProtocol;\r | |
118 | \r | |
119 | #endif // __REPORT_STATUS_CODE_LIB_INTERNAL__H\r | |
120 | \r |