From 045f4521f2dffa1f788ea12f2952782f3db627de Mon Sep 17 00:00:00 2001 From: davidhuang Date: Thu, 6 Jul 2006 06:42:48 +0000 Subject: 1)Add a new module CapsuleRuntime under EdkModulePkg\Universal\Capsule\RuntimeDxe.And add the module into Nt32.fpd 2)Modify the related files to fit for the runtime services UpdateCapsule/QueryCapsuleCapabilities defined in UEFI2.0 spec 3)Modify the related files to fit for the runtime services QueryVariableInfo defined in UEFI2.0 spec git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@790 6f19259b-4bc3-4df7-8a09-765794883524 --- EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c') diff --git a/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c b/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c index 5a21d49..d2428ea 100644 --- a/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c +++ b/EdkModulePkg/Universal/Runtime/RuntimeDxe/Runtime.c @@ -92,6 +92,9 @@ UINTN mVirtualMapMaxIndex; EFI_LOADED_IMAGE_PROTOCOL *mMyLoadedImage; +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) +STATIC EFI_GUID mEfiCapsuleHeaderGuid = EFI_CAPSULE_GUID; +#endif // // Worker Functions // @@ -356,6 +359,9 @@ RuntimeDriverSetVirtualAddressMap ( UINTN Index1; EFI_DRIVER_OS_HANDOFF_HEADER *DriverOsHandoffHeader; EFI_DRIVER_OS_HANDOFF *DriverOsHandoff; +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + EFI_CAPSULE_TABLE *CapsuleTable; +#endif // // Can only switch to virtual addresses once the memory map is locked down, @@ -464,6 +470,11 @@ RuntimeDriverSetVirtualAddressMap ( RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetVariable); RuntimeDriverConvertInternalPointer ((VOID **) &gRT->SetVariable); RuntimeDriverConvertInternalPointer ((VOID **) &gRT->GetNextVariableName); +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + RuntimeDriverConvertInternalPointer ((VOID **) &gRT->QueryVariableInfo); + RuntimeDriverConvertInternalPointer ((VOID **) &gRT->UpdateCapsule); + RuntimeDriverConvertInternalPointer ((VOID **) &gRT->QueryCapsuleCapabilities); +#endif RuntimeDriverCalculateEfiHdrCrc (&gRT->Hdr); // @@ -486,6 +497,15 @@ RuntimeDriverSetVirtualAddressMap ( RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &(gST->ConfigurationTable[Index].VendorTable)); } +#if (EFI_SPECIFICATION_VERSION >= 0x00020000) + if (CompareGuid (&mEfiCapsuleHeaderGuid, &(gST->ConfigurationTable[Index].VendorGuid))) { + CapsuleTable = gST->ConfigurationTable[Index].VendorTable; + for (Index1 = 0; Index1 < CapsuleTable->CapsuleArrayNumber; Index1++) { + RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &CapsuleTable->CapsulePtr[Index1]); + } + RuntimeDriverConvertPointer (EFI_OPTIONAL_POINTER, (VOID **) &(gST->ConfigurationTable[Index].VendorTable)); + } +#endif } // // Convert the runtime fields of the EFI System Table and recompute the CRC-32 -- cgit v1.1