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