X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FVariableAuthenticated%2FRuntimeDxe%2FVariableDxe.c;fp=SecurityPkg%2FVariableAuthenticated%2FRuntimeDxe%2FVariableDxe.c;h=f91cb5dc565228ea992a2d44e05ccbdc34e7816a;hb=2d3fb919872aaf67b8246fadc7bd20aa5d80dd43;hp=7b88f15163b52eb27561d759f605466cb563de28;hpb=45bf2c4789c71c2a65170d07b274acee17b3e374;p=mirror_edk2.git diff --git a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableDxe.c b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableDxe.c index 7b88f15163..f91cb5dc56 100644 --- a/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableDxe.c +++ b/SecurityPkg/VariableAuthenticated/RuntimeDxe/VariableDxe.c @@ -3,12 +3,12 @@ and volatile storage space and install variable architecture protocol. Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
-This program and the accompanying materials -are licensed and made available under the terms and conditions of the BSD License -which accompanies this distribution. The full text of the license may be found at +This program and the accompanying materials +are licensed and made available under the terms and conditions of the BSD License +which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php -THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, +THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/ @@ -24,7 +24,7 @@ EFI_EVENT mFtwRegistration = NULL; /** Return TRUE if ExitBootServices () has been called. - + @retval TRUE If ExitBootServices () has been called. **/ BOOLEAN @@ -39,8 +39,8 @@ AtRuntime ( /** Initializes a basic mutual exclusion lock. - This function initializes a basic mutual exclusion lock to the released state - and returns the lock. Each lock provides mutual exclusion access at its task + This function initializes a basic mutual exclusion lock to the released state + and returns the lock. Each lock provides mutual exclusion access at its task priority level. Since there is no preemption or multiprocessor support in EFI, acquiring the lock only consists of raising to the locks TPL. If Lock is NULL, then ASSERT(). @@ -131,7 +131,7 @@ GetFtwProtocol ( &gEfiFaultTolerantWriteProtocolGuid, NULL, FtwProtocol - ); + ); return Status; } @@ -145,7 +145,7 @@ GetFtwProtocol ( @retval EFI_SUCCESS The interface information for the specified protocol was returned. @retval EFI_UNSUPPORTED The device does not support the FVB protocol. @retval EFI_INVALID_PARAMETER FvBlockHandle is not a valid EFI_HANDLE or FvBlock is NULL. - + **/ EFI_STATUS GetFvbByHandle ( @@ -166,7 +166,7 @@ GetFvbByHandle ( /** Function returns an array of handles that support the FVB protocol - in a buffer allocated from pool. + in a buffer allocated from pool. @param[out] NumberHandles The number of handles returned in Buffer. @param[out] Buffer A pointer to the buffer to return the requested @@ -177,7 +177,7 @@ GetFvbByHandle ( @retval EFI_NOT_FOUND No FVB handle was found. @retval EFI_OUT_OF_RESOURCES There is not enough pool memory to store the matching results. @retval EFI_INVALID_PARAMETER NumberHandles is NULL or Buffer is NULL. - + **/ EFI_STATUS GetFvbCountAndBuffer ( @@ -233,8 +233,9 @@ VariableClassAddressChangeEvent ( EfiConvertPointer (0x0, (VOID **) &mVariableModuleGlobal->VariableGlobal.VolatileVariableBase); EfiConvertPointer (0x0, (VOID **) &mVariableModuleGlobal); EfiConvertPointer (0x0, (VOID **) &mHashCtx); - EfiConvertPointer (0x0, (VOID **) &mStorageArea); - EfiConvertPointer (0x0, (VOID **) &mNvVariableCache); + EfiConvertPointer (0x0, (VOID **) &mStorageArea); + EfiConvertPointer (0x0, (VOID **) &mSerializationRuntimeBuffer); + EfiConvertPointer (0x0, (VOID **) &mNvVariableCache); } @@ -266,12 +267,12 @@ OnReadyToBoot ( /** Fault Tolerant Write protocol notification event handler. - Non-Volatile variable write may needs FTW protocol to reclaim when + Non-Volatile variable write may needs FTW protocol to reclaim when writting variable. @param[in] Event Event whose notification function is being invoked. @param[in] Context Pointer to the notification function's context. - + **/ VOID EFIAPI @@ -297,7 +298,7 @@ FtwNotificationEvent ( if (EFI_ERROR (Status)) { return ; } - + // // Find the proper FVB protocol for variable. // @@ -333,21 +334,21 @@ FtwNotificationEvent ( DEBUG ((DEBUG_WARN, "Variable driver failed to add EFI_MEMORY_RUNTIME attribute to Flash.\n")); } } - + Status = VariableWriteServiceInitialize (); ASSERT_EFI_ERROR (Status); - + // // Install the Variable Write Architectural protocol. // Status = gBS->InstallProtocolInterface ( &mHandle, - &gEfiVariableWriteArchProtocolGuid, + &gEfiVariableWriteArchProtocolGuid, EFI_NATIVE_INTERFACE, NULL ); ASSERT_EFI_ERROR (Status); - + // // Close the notify event to avoid install gEfiVariableWriteArchProtocolGuid again. // @@ -358,13 +359,13 @@ FtwNotificationEvent ( /** Variable Driver main entry point. The Variable driver places the 4 EFI - runtime services in the EFI System Table and installs arch protocols + runtime services in the EFI System Table and installs arch protocols for variable read and write services being available. It also registers a notification function for an EVT_SIGNAL_VIRTUAL_ADDRESS_CHANGE event. - @param[in] ImageHandle The firmware allocated handle for the EFI image. + @param[in] ImageHandle The firmware allocated handle for the EFI image. @param[in] SystemTable A pointer to the EFI System Table. - + @retval EFI_SUCCESS Variable service successfully initialized. **/ @@ -376,7 +377,7 @@ VariableServiceInitialize ( ) { EFI_STATUS Status; - EFI_EVENT ReadyToBootEvent; + EFI_EVENT ReadyToBootEvent; Status = VariableCommonInitialize (); ASSERT_EFI_ERROR (Status); @@ -385,13 +386,13 @@ VariableServiceInitialize ( SystemTable->RuntimeServices->GetNextVariableName = VariableServiceGetNextVariableName; SystemTable->RuntimeServices->SetVariable = VariableServiceSetVariable; SystemTable->RuntimeServices->QueryVariableInfo = VariableServiceQueryVariableInfo; - + // // Now install the Variable Runtime Architectural protocol on a new handle. // Status = gBS->InstallProtocolInterface ( &mHandle, - &gEfiVariableArchProtocolGuid, + &gEfiVariableArchProtocolGuid, EFI_NATIVE_INTERFACE, NULL ); @@ -399,7 +400,7 @@ VariableServiceInitialize ( // // Register FtwNotificationEvent () notify function. - // + // EfiCreateProtocolNotifyEvent ( &gEfiFaultTolerantWriteProtocolGuid, TPL_CALLBACK, @@ -422,9 +423,9 @@ VariableServiceInitialize ( // Register the event handling function to reclaim variable for OS usage. // Status = EfiCreateEventReadyToBootEx ( - TPL_NOTIFY, - OnReadyToBoot, - NULL, + TPL_NOTIFY, + OnReadyToBoot, + NULL, &ReadyToBootEvent );