1 /*++
2 
3 Copyright (c) 2004, Intel Corporation. All rights reserved.<BR>
4 This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution.  The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
8 
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11 
12 Module Name:
13 
14   VariableStore.h
15 
16 Abstract:
17 
18 Revision History
19 
20 --*/
21 
22 #ifndef _VARIABLE_STORE_H
23 #define _VARIABLE_STORE_H
24 
25 //
26 // The variable store protocol interface is specific to the reference
27 // implementation. The initialization code adds variable store devices
28 // to the system, and the FW connects to the devices to provide the
29 // variable store interfaces through these devices.
30 //
31 
32 //
33 // Variable Store Device protocol
34 //
35 #define EFI_VARIABLE_STORE_PROTOCOL_GUID    \
36   { 0xf088cd91, 0xa046, 0x11d2, {0x8e, 0x42, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
37 
38 EFI_FORWARD_DECLARATION (EFI_VARIABLE_STORE_PROTOCOL);
39 
40 typedef
41 EFI_STATUS
42 (EFIAPI *EFI_CLEAR_STORE) (
43   IN EFI_VARIABLE_STORE_PROTOCOL   *This,
44   IN OUT VOID                              *Scratch
45   );
46 
47 typedef
48 EFI_STATUS
49 (EFIAPI *EFI_READ_STORE) (
50   IN EFI_VARIABLE_STORE_PROTOCOL   *This,
51   IN UINTN                                 Offset,
52   IN UINTN                                 BufferSize,
53   OUT VOID                                 *Buffer
54   );
55 
56 typedef
57 EFI_STATUS
58 (EFIAPI *EFI_UPDATE_STORE) (
59   IN EFI_VARIABLE_STORE_PROTOCOL   *This,
60   IN UINTN                                 Offset,
61   IN UINTN                                 BufferSize,
62   IN VOID                                  *Buffer
63   );
64 
65 typedef
66 EFI_STATUS
67 (EFIAPI *EFI_CLEANUP_STORE) (
68   IN EFI_VARIABLE_STORE_PROTOCOL   *This
69   );
70 
71 struct _EFI_VARIABLE_STORE_PROTOCOL {
72 
73   //
74   // Number of banks and bank size
75   //
76   UINT32                      Attributes;
77   UINT32                      BankSize;
78 
79   //
80   // Functions to access the storage banks
81   //
82   EFI_CLEAR_STORE             ClearStore;
83   EFI_READ_STORE              ReadStore;
84   EFI_UPDATE_STORE            UpdateStore;
85   EFI_CLEANUP_STORE           CleanupStore;
86 
87 };
88 
89 //
90 //
91 //  ClearStore()        - A function to clear the requested storage bank.  A cleared
92 //                        bank contains all "on" bits.
93 //
94 //  ReadStore()         - Read data from the requested store.
95 //
96 //  UpdateStore()       - Updates data on the requested store. The FW will only
97 //                        ever issue updates to clear bits in the store. Updates must
98 //                        be performed in LSb to MSb order of the update buffer.
99 //
100 //  CleanupStore()      - Do garbage collection and reclaim operation.
101 //
102 
103 extern EFI_GUID gEfiVariableStoreProtocolGuid;
104 
105 #endif // _VARIABLE_STORE_H
106