diff options
Diffstat (limited to 'Protocol/SwapAddressRange')
-rw-r--r-- | Protocol/SwapAddressRange/SwapAddressRange.c | 33 | ||||
-rw-r--r-- | Protocol/SwapAddressRange/SwapAddressRange.h | 106 |
2 files changed, 139 insertions, 0 deletions
diff --git a/Protocol/SwapAddressRange/SwapAddressRange.c b/Protocol/SwapAddressRange/SwapAddressRange.c new file mode 100644 index 0000000..1b95129 --- /dev/null +++ b/Protocol/SwapAddressRange/SwapAddressRange.c @@ -0,0 +1,33 @@ +/*++ + This file contains 'Framework Code' and is licensed as such + under the terms of your license agreement with Intel or your + vendor. This file may not be modified, except as allowed by + additional terms of your license agreement. +--*/ +/*++ + +Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + + SwapAddressRange.c + +Abstract: + + +--*/ + +#include "Tiano.h" +#include EFI_PROTOCOL_DEFINITION (SwapAddressRange) + +EFI_GUID gEfiSwapAddressRangeProtocolGuid = EFI_SWAP_ADDRESS_RANGE_PROTOCOL_GUID; + +EFI_GUID_STRING(&gEfiSwapAddressRangeProtocolGuid, "SwapAddressRange Protocol", "Swap Address Range protocol"); diff --git a/Protocol/SwapAddressRange/SwapAddressRange.h b/Protocol/SwapAddressRange/SwapAddressRange.h new file mode 100644 index 0000000..62e0be8 --- /dev/null +++ b/Protocol/SwapAddressRange/SwapAddressRange.h @@ -0,0 +1,106 @@ +// +// This file contains 'Framework Code' and is licensed as such +// under the terms of your license agreement with Intel or your +// vendor. This file may not be modified, except as allowed by +// additional terms of your license agreement. +// +/*++ + +Copyright (c) 1999 - 2002 Intel Corporation. All rights reserved +This software and associated documentation (if any) is furnished +under a license and may only be used or copied in accordance +with the terms of the license. Except as permitted by such +license, no part of this software or documentation may be +reproduced, stored in a retrieval system, or transmitted in any +form or by any means without the express written consent of +Intel Corporation. + + +Module Name: + + SwapAddressRange.h + +Abstract: + +--*/ + +#ifndef _EFI_SWAP_ADDRESS_RANGE_PROTOCOL_H_ +#define _EFI_SWAP_ADDRESS_RANGE_PROTOCOL_H_ + +#define EFI_SWAP_ADDRESS_RANGE_PROTOCOL_GUID \ + { \ + 0x1259f60d, 0xb754, 0x468e, 0xa7, 0x89, 0x4d, 0xb8, 0x5d, 0x55, 0xe8, 0x7e \ + } + +// +// Forward reference for pure ANSI compatability +// +EFI_FORWARD_DECLARATION (EFI_SWAP_ADDRESS_RANGE_PROTOCOL); + +#define EFI_UNSUPPORT_LOCK 0 +#define EFI_SOFTWARE_LOCK 1 +#define EFI_HARDWARE_LOCK 2 + +typedef UINT8 EFI_SWAP_LOCK_CAPABILITY; + +// +// Protocl APIs +// +typedef +EFI_STATUS +(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 UINTN *BackupBlockSize + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_GET_SWAP_STATE) ( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, + OUT BOOLEAN *SwapState + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_SET_SWAP_STATE) ( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, + IN BOOLEAN NewSwapState + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_GET_RTC_POWER_STATUS) ( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, + OUT BOOLEAN *RtcPowerFailed + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_GET_SWAP_LOCK_CAPABILITY) ( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, + OUT EFI_SWAP_LOCK_CAPABILITY * LockCapability + ); + +typedef +EFI_STATUS +(EFIAPI *EFI_SET_SWAP_LOCK) ( + IN EFI_SWAP_ADDRESS_RANGE_PROTOCOL * This, + IN EFI_SWAP_LOCK_CAPABILITY LockCapability, + IN BOOLEAN NewLockState + ); + +typedef struct _EFI_SWAP_ADDRESS_RANGE_PROTOCOL { + EFI_GET_RANGE_LOCATION GetRangeLocation; // has output parameters for base and length + EFI_GET_SWAP_STATE GetSwapState; // are ranges swapped or not + EFI_SET_SWAP_STATE SetSwapState; // swap or unswap ranges + EFI_GET_RTC_POWER_STATUS GetRtcPowerStatus; // checks RTC battery, or whatever... + EFI_GET_SWAP_LOCK_CAPABILITY GetSwapLockCapability; // Get TOP_SWAP lock capability, + EFI_SET_SWAP_LOCK SetSwapLock; // Set TOP_SWAP lock state +} EFI_SWAP_ADDRESS_RANGE_PROTOCOL; + +extern EFI_GUID gEfiSwapAddressRangeProtocolGuid; + +#endif |