/** @file\r
DXE Core library services.\r
\r
-Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
-All rights reserved. This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution. The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2006 - 2008, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
\r
#include "DxeMain.h"\r
\r
-UINTN mErrorLevel = DEBUG_ERROR | DEBUG_LOAD;\r
-\r
-EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA mStatusCodeData = {\r
- {\r
- sizeof (EFI_STATUS_CODE_DATA),\r
- 0,\r
- EFI_STATUS_CODE_DXE_CORE_GUID\r
- },\r
- NULL\r
-};\r
-\r
-\r
-/**\r
- Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid,\r
- with a handle as additional information.\r
-\r
- @param Value Describes the class/subclass/operation of the\r
- hardware or software entity that the Status Code\r
- relates to.\r
- @param Handle Additional information.\r
-\r
-**/\r
-VOID\r
-CoreReportProgressCodeSpecific (\r
- IN EFI_STATUS_CODE_VALUE Value,\r
- IN EFI_HANDLE Handle\r
- )\r
-{\r
- mStatusCodeData.DataHeader.Size = sizeof (EFI_DXE_DEVICE_HANDLE_EXTENDED_DATA) - sizeof (EFI_STATUS_CODE_DATA);\r
- mStatusCodeData.Handle = Handle;\r
-\r
- if ((gStatusCode != NULL) && (gStatusCode->ReportStatusCode != NULL) ) {\r
- gStatusCode->ReportStatusCode (\r
- EFI_PROGRESS_CODE,\r
- Value,\r
- 0,\r
- &gEfiCallerIdGuid,\r
- (EFI_STATUS_CODE_DATA *) &mStatusCodeData\r
- );\r
- }\r
-}\r
-\r
-\r
-/**\r
- Report status code of type EFI_PROGRESS_CODE by caller ID gEfiCallerIdGuid.\r
-\r
- @param Value Describes the class/subclass/operation of the\r
- hardware or software entity that the Status Code\r
- relates to.\r
-\r
-**/\r
-VOID\r
-CoreReportProgressCode (\r
- IN EFI_STATUS_CODE_VALUE Value\r
- )\r
-{\r
- if ((gStatusCode != NULL) && (gStatusCode->ReportStatusCode != NULL) ) {\r
- gStatusCode->ReportStatusCode (\r
- EFI_PROGRESS_CODE,\r
- Value,\r
- 0,\r
- &gEfiCallerIdGuid,\r
- NULL\r
- );\r
- }\r
-}\r
-\r
-\r
//\r
// Lock Stuff\r
//\r
}\r
\r
\r
-/**\r
- Create a protocol notification event and return it.\r
-\r
- @param ProtocolGuid Protocol to register notification event on.\r
- @param NotifyTpl Maximum TPL to signal the NotifyFunction.\r
- @param NotifyFunction EFI notification routine.\r
- @param NotifyContext Context passed into Event when it is created.\r
- @param Registration Registration key returned from\r
- RegisterProtocolNotify().\r
- @param SignalFlag Boolean value to decide whether kick the event after\r
- register or not.\r
-\r
- @return The EFI_EVENT that has been registered to be signaled when a ProtocolGuid\r
- is added to the system.\r
-\r
-**/\r
-EFI_EVENT\r
-CoreCreateProtocolNotifyEvent (\r
- IN EFI_GUID *ProtocolGuid,\r
- IN EFI_TPL NotifyTpl,\r
- IN EFI_EVENT_NOTIFY NotifyFunction,\r
- IN VOID *NotifyContext,\r
- OUT VOID **Registration,\r
- IN BOOLEAN SignalFlag\r
- )\r
-{\r
- EFI_STATUS Status;\r
- EFI_EVENT Event;\r
-\r
- //\r
- // Create the event\r
- //\r
- Status = CoreCreateEvent (\r
- EVT_NOTIFY_SIGNAL,\r
- NotifyTpl,\r
- NotifyFunction,\r
- NotifyContext,\r
- &Event\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- //\r
- // Register for protocol notifactions on this event\r
- //\r
- Status = CoreRegisterProtocolNotify (\r
- ProtocolGuid,\r
- Event,\r
- Registration\r
- );\r
- ASSERT_EFI_ERROR (Status);\r
-\r
- if (SignalFlag) {\r
- //\r
- // Kick the event so we will perform an initial pass of\r
- // current installed drivers\r
- //\r
- CoreSignalEvent (Event);\r
- }\r
-\r
- return Event;\r
-}\r
-\r
\r