X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=MdeModulePkg%2FInclude%2FProtocol%2FSwapAddressRange.h;h=3ca87a0e6e55efedb877f7c5adf39fafb3663570;hb=b0609e4f02fc1af93b849e48b225ca5e2c315fc0;hp=0aff5835a464ae9da46f219a77fe1315eb19dda7;hpb=85e923a52851b242f8fc9f937c1fad7ce51246ee;p=mirror_edk2.git diff --git a/MdeModulePkg/Include/Protocol/SwapAddressRange.h b/MdeModulePkg/Include/Protocol/SwapAddressRange.h index 0aff5835a4..3ca87a0e6e 100644 --- a/MdeModulePkg/Include/Protocol/SwapAddressRange.h +++ b/MdeModulePkg/Include/Protocol/SwapAddressRange.h @@ -1,16 +1,16 @@ /** @file The EFI_SWAP_ADDRESS_RANGE_PROTOCOL is used to abstract the swap operation of boot block -and backup block of FV. This swap is especially needed when updating the boot block of FV. If any -power failure happens during updating boot block, the swapped backup block (now is the boot block) -can boot the machine with old boot block backuped in it. The swap operation is platform dependent, so -other protocols such as FTW (Fault Tolerant Write) should use this protocol instead of handling hardward directly. - -Copyright (c) 2009, 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 -http://opensource.org/licenses/bsd-license.php - +and backup block of FV. This swap is especially needed when updating the boot block of FV. If a +power failure happens during the boot block update, the swapped backup block (now the boot block) +can boot the machine with the old boot block backed up in it. The swap operation is platform dependent, so +other protocols such as FTW (Fault Tolerant Write) should use this protocol instead of handling hardware directly. + +Copyright (c) 2009 - 2010, 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 that 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, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. @@ -36,134 +36,126 @@ typedef struct _EFI_SWAP_ADDRESS_RANGE_PROTOCOL EFI_SWAP_ADDRESS_RANGE_PROTOCOL typedef UINT8 EFI_SWAP_LOCK_CAPABILITY; // -// Protocl APIs +// Protocol APIs // /** - This service gets the address range location of boot block and backup block. - The EFI_GET_RANGE_LOCATION service allows caller to get the range location of + This function gets the address range location of boot block and backup block. - @param This Indicates the calling context. - @param BootBlockBase Base address of current boot block. - @param BootBlockSize Size (in bytes) of current boot block. - @param BackupBlockBase Base address of current backup block. - @param BackupBlockSize Size (in bytes) of current backup block. + @param This Indicates the calling context. + @param BootBlockBase The base address of current boot block. + @param BootBlockSize The size (in bytes) of current boot block. + @param BackupBlockBase The base address of current backup block. + @param BackupBlockSize The size (in bytes) of current backup block. - @retval EFI_SUCCESS The call was successful. + @retval EFI_SUCCESS The call was successful. **/ typedef EFI_STATUS -(EFIAPI *EFI_GET_RANGE_LOCATION) ( - IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, - OUT EFI_PHYSICAL_ADDRESS * BootBlockBase, +(EFIAPI *EFI_GET_RANGE_LOCATION)( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL *This, + OUT EFI_PHYSICAL_ADDRESS *BootBlockBase, OUT UINTN *BootBlockSize, - OUT EFI_PHYSICAL_ADDRESS * BackupBlockBase, + OUT EFI_PHYSICAL_ADDRESS *BackupBlockBase, OUT UINTN *BackupBlockSize ); /** This service checks if the boot block and backup block has been swapped. - The EFI_GET_SWAP_STATE service allows caller to get current swap state of boot block and backup block. - - @param This Indicates the calling context. - @param SwapState True if the boot block and backup block has been swapped. - False if the boot block and backup block has not been swapped. + @param This Indicates the calling context. + @param SwapState True if the boot block and backup block has been swapped. + False if the boot block and backup block has not been swapped. - @retval EFI_SUCCESS The call was successful. + @retval EFI_SUCCESS The call was successful. **/ typedef EFI_STATUS -(EFIAPI *EFI_GET_SWAP_STATE) ( - IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, +(EFIAPI *EFI_GET_SWAP_STATE)( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL *This, OUT BOOLEAN *SwapState ); /** This service swaps the boot block and backup block, or swaps them back. - The EFI_SET_SWAP_STATE service allows caller to set the swap state of boot block and backup block. - It also acquires and releases software swap lock during operation. Note the setting of new swap state + It also acquires and releases software swap lock during operation. The setting of the new swap state is not affected by the old swap state. - @param This Indicates the calling context. - @param NewSwapState True to swap real boot block and backup block , False to swap them back.. + @param This Indicates the calling context. + @param NewSwapState True to swap real boot block and backup block, False to swap them back. - @retval EFI_SUCCESS The call was successful. - @retval EFI_ABORTED Set swap state error + @retval EFI_SUCCESS The call was successful. + @retval EFI_ABORTED Set swap state error. **/ typedef EFI_STATUS -(EFIAPI *EFI_SET_SWAP_STATE) ( - IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, +(EFIAPI *EFI_SET_SWAP_STATE)( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL *This, IN BOOLEAN NewSwapState ); /** - This service checks if a RTC (Real Time Clock) power failure happened. + This service checks if a Real Time Clock (RTC) power failure happened. - The EFI_GET_RTC_POWER_STATUS service allows caller to get Real Time Clock power failure status. - If parameter RtcPowerFailed is true after function returns, the trickle current (from the main battery or trickle supply) - has been removed or failed, this means the swap status was lost in some platform (such as IA32). - So it is recommended to check RTC power status before calling GetSwapState(). + If parameter RtcPowerFailed is true after the function returns, RTC power supply failed or was removed. + It is recommended to check RTC power status before calling GetSwapState(). - @param This Indicates the calling context. - @param RtcPowerFailed True if a RTC (Real Time Clock) power failure has happened. + @param This Indicates the calling context. + @param RtcPowerFailed True if the RTC (Real Time Clock) power failed or was removed. @retval EFI_SUCCESS The call was successful. **/ typedef EFI_STATUS -(EFIAPI *EFI_GET_RTC_POWER_STATUS) ( - IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, +(EFIAPI *EFI_GET_RTC_POWER_STATUS)( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL *This, OUT BOOLEAN *RtcPowerFailed ); /** - This service returns supported lock methods for swap operation in current platform. Could be software lock, hardware lock, or unsupport lock. - - The EFI_GET_SWAP_LOCK_CAPABILITY service allows caller to get supported lock method for swap operation in current platform. - Note that software and hardware lock mothod can be used simultaneously. + This service returns all lock methods for swap operations that the current platform + supports. Could be software lock, hardware lock, or unsupport lock. + Note that software and hardware lock methods can be used simultaneously. - @param This Indicates the calling context. - @param LockCapability Current lock method for swap operation. + @param This Indicates the calling context. + @param LockCapability The current lock method for swap operations. @retval EFI_SUCCESS The call was successful. **/ typedef EFI_STATUS -(EFIAPI *EFI_GET_SWAP_LOCK_CAPABILITY) ( - IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, - OUT EFI_SWAP_LOCK_CAPABILITY * LockCapability +(EFIAPI *EFI_GET_SWAP_LOCK_CAPABILITY)( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL *This, + OUT EFI_SWAP_LOCK_CAPABILITY *LockCapability ); /** - This service is used to acquire or release appointed kind of lock for Swap Address Range operation. + This service is used to acquire or release appointed kind of lock for Swap Address Range operations. - The EFI_GET_SWAP_LOCK_CAPABILITY service allows caller to get supported lock method for swap operation in current platform. Note that software and hardware lock mothod can be used simultaneously. - @param This Indicates the calling context. + @param This Indicates the calling context. @param LockCapability Indicates which lock to acquire or release. - @param NewLockState True to acquire lock, False to release lock. + @param NewLockState True to acquire lock; False to release lock. @retval EFI_SUCCESS The call was successful. **/ typedef EFI_STATUS -(EFIAPI *EFI_SET_SWAP_LOCK) ( - IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, +(EFIAPI *EFI_SET_SWAP_LOCK)( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL *This, IN EFI_SWAP_LOCK_CAPABILITY LockCapability, IN BOOLEAN NewLockState );