Adding upstream version 6.03~pre1+dfsg.
[syslinux-debian/hramrach.git] / efi64 / include / efi / protocol / efivar.h
blob92dc506a1532553773575350bd407652cc118801
1 /*++
3 Copyright (c) 1998 Intel Corporation
5 Module Name:
7 Abstract:
11 Revision History
13 --*/
18 // The variable store protocol interface is specific to the reference
19 // implementation. The initialization code adds variable store devices
20 // to the system, and the FW connects to the devices to provide the
21 // variable store interfaces through these devices.
25 // Variable Store Device protocol
28 #define VARIABLE_STORE_PROTOCOL \
29 { 0xf088cd91, 0xa046, 0x11d2, {0x8e, 0x42, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
31 INTERFACE_DECL(_EFI_VARIABLE_STORE);
33 typedef
34 EFI_STATUS
35 (EFIAPI *EFI_STORE_CLEAR) (
36 IN struct _EFI_VARIABLE_STORE *This,
37 IN UINTN BankNo,
38 IN OUT VOID *Scratch
42 typedef
43 EFI_STATUS
44 (EFIAPI *EFI_STORE_READ) (
45 IN struct _EFI_VARIABLE_STORE *This,
46 IN UINTN BankNo,
47 IN UINTN Offset,
48 IN UINTN BufferSize,
49 OUT VOID *Buffer
52 typedef
53 EFI_STATUS
54 (EFIAPI *EFI_STORE_UPDATE) (
55 IN struct _EFI_VARIABLE_STORE *This,
56 IN UINTN BankNo,
57 IN UINTN Offset,
58 IN UINTN BufferSize,
59 IN VOID *Buffer
62 typedef
63 EFI_STATUS
64 (EFIAPI *EFI_STORE_SIZE) (
65 IN struct _EFI_VARIABLE_STORE *This,
66 IN UINTN NoBanks
69 typedef
70 EFI_STATUS
71 (EFIAPI *EFI_TRANSACTION_UPDATE) (
72 IN struct _EFI_VARIABLE_STORE *This,
73 IN UINTN BankNo,
74 IN VOID *NewContents
77 typedef struct _EFI_VARIABLE_STORE {
80 // Number of banks and bank size
83 UINT32 Attributes;
84 UINT32 BankSize;
85 UINT32 NoBanks;
88 // Functions to access the storage banks
91 EFI_STORE_CLEAR ClearStore;
92 EFI_STORE_READ ReadStore;
93 EFI_STORE_UPDATE UpdateStore;
94 EFI_STORE_SIZE SizeStore OPTIONAL;
95 EFI_TRANSACTION_UPDATE TransactionUpdate OPTIONAL;
97 } EFI_VARIABLE_STORE;
102 // ClearStore() - A function to clear the requested storage bank. A cleared
103 // bank contains all "on" bits.
105 // ReadStore() - Read data from the requested store.
107 // UpdateStore() - Updates data on the requested store. The FW will only
108 // ever issue updates to clear bits in the store. Updates must be
109 // performed in LSb to MSb order of the update buffer.
111 // SizeStore() - An optional function for non-runtime stores that can be
112 // dynamically sized. The FW will only ever increase or decrease the store
113 // by 1 banksize at a time, and it is always adding or removing a bank from
114 // the end of the store.
116 // By default the FW will update variables and storage banks in an
117 // "atomic" manner by keeping 1 old copy of the data during an update,
118 // and recovering appropiately if the power is lost during the middle
119 // of an operation. To do this the FW needs to have multiple banks
120 // of storage dedicated to its use. If that's not possible, the driver
121 // can implement an atomic bank update function and the FW will allow
122 // 1 bank in this case. (It will allow any number of banks,
123 // but it won't require an "extra" bank to provide its bank transaction
124 // function).
126 // TransactionUpdate() - An optional function that can clear & update an
127 // entire bank in an "atomic" fashion. If the operation fails in the
128 // middle the driver is responsible for having either the previous copy
129 // of the bank's data or the new copy. A copy that's partially written
130 // is not valid as internal data settings may get lost. Supply this
131 // function only when needed.