/*++\r
\r
-Copyright (c) 2006, Intel Corporation \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, Intel Corporation\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
\r
Module Name:\r
\r
\r
Abstract:\r
\r
- This file deals with Architecture Protocol (AP) registration in \r
- the Dxe Core. The mArchProtocols[] array represents a list of \r
+ This file deals with Architecture Protocol (AP) registration in\r
+ the Dxe Core. The mArchProtocols[] array represents a list of\r
events that represent the Architectural Protocols.\r
\r
--*/\r
{ &gEfiRuntimeArchProtocolGuid, (VOID **)&gRuntime, NULL, NULL, FALSE },\r
{ &gEfiVariableArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },\r
{ &gEfiVariableWriteArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },\r
+#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+#ifndef MDE_CPU_IPF\r
+ //\r
+ // UEFI 2.0 added support for Capsule services. DXE CIS ??? Added support for this AP\r
+ //\r
+ { &gEfiCapsuleArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE},\r
+#endif\r
+#endif\r
{ &gEfiMonotonicCounterArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },\r
{ &gEfiResetArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },\r
-// { &gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode, NULL, NULL, FALSE },\r
+#if ((EDK_RELEASE_VERSION != 0) && (EFI_SPECIFICATION_VERSION < 0x00020000))\r
+ //\r
+ // The ReportStatusCode Runtime service is in conflict with the UEFI 2.0 specificaiton\r
+ // Thus gEfiStatusCodeRuntimeProtocolGuid becomes a normal protocol in UEFI 2.0 systems\r
+ // It is only included if the EFI 1.10 with Tiano extensions is enabled for backward\r
+ // compatability\r
+ //\r
+ { &gEfiStatusCodeRuntimeProtocolGuid, (VOID **)&gStatusCode, NULL, NULL, FALSE },\r
+#endif\r
{ &gEfiRealTimeClockArchProtocolGuid, (VOID **)NULL, NULL, NULL, FALSE },\r
{ NULL, (VOID **)NULL, NULL, NULL, FALSE }\r
};\r
\r
Returns:\r
EFI_SUCCESS - All AP services are available\r
- EFI_NOT_FOUND - At least one AP service is not available \r
+ EFI_NOT_FOUND - At least one AP service is not available\r
\r
--*/\r
{\r
Routine Description:\r
Notification event handler registered by CoreNotifyOnArchProtocolInstallation ().\r
This notify function is registered for every architectural protocol. This handler\r
- updates mArchProtocol[] array entry with protocol instance data and sets it's \r
- present flag to TRUE. If any constructor is required it is executed. The EFI \r
+ updates mArchProtocol[] array entry with protocol instance data and sets it's\r
+ present flag to TRUE. If any constructor is required it is executed. The EFI\r
System Table headers are updated.\r
\r
Arguments:\r
\r
Event - The Event that is being processed, not used.\r
- \r
+\r
Context - Event Context, not used.\r
\r
Returns:\r
ARCHITECTURAL_PROTOCOL_ENTRY *Entry;\r
VOID *Protocol;\r
BOOLEAN Found;\r
- \r
+ LIST_ENTRY *Link;\r
+ LIST_ENTRY TempLinkNode;\r
+\r
Found = FALSE;\r
for (Entry = mArchProtocols; Entry->ProtocolGuid != NULL; Entry++) {\r
- \r
+\r
Status = CoreLocateProtocol (Entry->ProtocolGuid, Entry->Registration, &Protocol);\r
if (EFI_ERROR (Status)) {\r
continue;\r
- } \r
- \r
+ }\r
+\r
Found = TRUE;\r
Entry->Present = TRUE;\r
- \r
+\r
//\r
// Update protocol global variable if one exists. Entry->Protocol points to a global variable\r
- // if one exists in the DXE core for this Architectural Protocol \r
+ // if one exists in the DXE core for this Architectural Protocol\r
//\r
if (Entry->Protocol != NULL) {\r
*(Entry->Protocol) = Protocol;\r
// When runtime architectural protocol is available, updates CRC32 in the Debug Table\r
//\r
CoreUpdateDebugTableCrc32 ();\r
+\r
+ //\r
+ // Update the Runtime Architectural protocol with the template that the core was\r
+ // using so there would not need to be a dependency on the Runtime AP\r
+ //\r
+\r
+ //\r
+ // Copy all the registered Image to new gRuntime protocol\r
+ //\r
+ for (Link = gRuntimeTemplate.ImageHead.ForwardLink; Link != &gRuntimeTemplate.ImageHead; Link = TempLinkNode.ForwardLink) {\r
+ CopyMem (&TempLinkNode, Link, sizeof(LIST_ENTRY));\r
+ InsertTailList (&gRuntime->ImageHead, Link);\r
+ }\r
+ //\r
+ // Copy all the registered Event to new gRuntime protocol\r
+ //\r
+ for (Link = gRuntimeTemplate.EventHead.ForwardLink; Link != &gRuntimeTemplate.EventHead; Link = TempLinkNode.ForwardLink) {\r
+ CopyMem (&TempLinkNode, Link, sizeof(LIST_ENTRY));\r
+ InsertTailList (&gRuntime->EventHead, Link);\r
+ }\r
+ \r
+ //\r
+ // Clean up gRuntimeTemplate\r
+ //\r
+ gRuntimeTemplate.ImageHead.ForwardLink = &gRuntimeTemplate.ImageHead;\r
+ gRuntimeTemplate.ImageHead.BackLink = &gRuntimeTemplate.ImageHead;\r
+ gRuntimeTemplate.EventHead.ForwardLink = &gRuntimeTemplate.EventHead;\r
+ gRuntimeTemplate.EventHead.BackLink = &gRuntimeTemplate.EventHead;\r
}\r
}\r
\r
ARCHITECTURAL_PROTOCOL_ENTRY *Entry;\r
\r
for (Entry = mArchProtocols; Entry->ProtocolGuid != NULL; Entry++) {\r
- \r
+\r
//\r
// Create the event\r
//\r
// Register for protocol notifactions on this event\r
//\r
Status = CoreRegisterProtocolNotify (\r
- Entry->ProtocolGuid, \r
- Entry->Event, \r
+ Entry->ProtocolGuid,\r
+ Entry->Event,\r
&Entry->Registration\r
);\r
ASSERT_EFI_ERROR(Status);\r
{ &gEfiRuntimeArchProtocolGuid, (CHAR16 *)L"Runtime" },\r
{ &gEfiVariableArchProtocolGuid, (CHAR16 *)L"Variable" },\r
{ &gEfiVariableWriteArchProtocolGuid, (CHAR16 *)L"Variable Write" },\r
+ #if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
+ { &gEfiCapsuleArchProtocolGuid, (CHAR16 *)L"Capsule" },\r
+ #endif\r
{ &gEfiMonotonicCounterArchProtocolGuid, (CHAR16 *)L"Monotonic Counter" },\r
{ &gEfiResetArchProtocolGuid, (CHAR16 *)L"Reset" },\r
// { &gEfiStatusCodeRuntimeProtocolGuid, (CHAR16 *)L"Status Code" },\r
}\r
}\r
}\r
- } \r
+ }\r
}\r