summaryrefslogtreecommitdiff
path: root/Protocol/SwapAddressRange/SwapAddressRange.h
blob: 62e0be85f27388d3131572f52b8f8737f2e351ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
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