]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / Nt32Pkg / FvbServicesRuntimeDxe / FwBlockService.h
1 /**@file
2
3 Copyright (c) 2006, Intel Corporation
4 All rights reserved. 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 FwBlockService.h
15
16 Abstract:
17
18 Firmware volume block driver for Intel Firmware Hub (FWH) device
19
20 **/
21
22 #ifndef _FW_BLOCK_SERVICE_H
23 #define _FW_BLOCK_SERVICE_H
24
25 //
26 // BugBug: Add documentation here for data structure!!!!
27 //
28 #define FVB_PHYSICAL 0
29 #define FVB_VIRTUAL 1
30
31 typedef struct {
32 EFI_LOCK FvbDevLock;
33 UINTN FvBase[2];
34 UINTN NumOfBlocks;
35 EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;
36 } EFI_FW_VOL_INSTANCE;
37
38 typedef struct {
39 UINT32 NumFv;
40 EFI_FW_VOL_INSTANCE *FvInstance[2];
41 UINT8 *FvbScratchSpace[2];
42 } ESAL_FWB_GLOBAL;
43
44 //
45 // Fvb Protocol instance data
46 //
47 #define FVB_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)
48 #define FVB_EXTEND_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE, FvbExtension, FVB_DEVICE_SIGNATURE)
49 #define FVB_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('F', 'V', 'B', 'N')
50
51 typedef struct {
52 MEMMAP_DEVICE_PATH MemMapDevPath;
53 EFI_DEVICE_PATH_PROTOCOL EndDevPath;
54 } FV_DEVICE_PATH;
55
56 typedef struct {
57 UINTN Signature;
58 FV_DEVICE_PATH DevicePath;
59 UINTN Instance;
60 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL FwVolBlockInstance;
61 EFI_FVB_EXTENSION_PROTOCOL FvbExtension;
62 } EFI_FW_VOL_BLOCK_DEVICE;
63
64 EFI_STATUS
65 GetFvbInfo (
66 IN UINT64 FvLength,
67 OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo
68 );
69
70 EFI_STATUS
71 FvbReadBlock (
72 IN UINTN Instance,
73 IN EFI_LBA Lba,
74 IN UINTN BlockOffset,
75 IN OUT UINTN *NumBytes,
76 IN UINT8 *Buffer,
77 IN ESAL_FWB_GLOBAL *Global,
78 IN BOOLEAN Virtual
79 );
80
81 EFI_STATUS
82 FvbWriteBlock (
83 IN UINTN Instance,
84 IN CONST EFI_LBA Lba,
85 IN CONST UINTN BlockOffset,
86 IN OUT UINTN *NumBytes,
87 IN CONST UINT8 *Buffer,
88 IN ESAL_FWB_GLOBAL *Global,
89 IN BOOLEAN Virtual
90 );
91
92 EFI_STATUS
93 FvbEraseBlock (
94 IN UINTN Instance,
95 IN EFI_LBA Lba,
96 IN ESAL_FWB_GLOBAL *Global,
97 IN BOOLEAN Virtual
98 );
99
100 EFI_STATUS
101 FvbSetVolumeAttributes (
102 IN UINTN Instance,
103 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
104 IN ESAL_FWB_GLOBAL *Global,
105 IN BOOLEAN Virtual
106 );
107
108 EFI_STATUS
109 FvbGetVolumeAttributes (
110 IN UINTN Instance,
111 OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
112 IN ESAL_FWB_GLOBAL *Global,
113 IN BOOLEAN Virtual
114 );
115
116 EFI_STATUS
117 FvbGetPhysicalAddress (
118 IN UINTN Instance,
119 OUT EFI_PHYSICAL_ADDRESS *Address,
120 IN ESAL_FWB_GLOBAL *Global,
121 IN BOOLEAN Virtual
122 );
123
124 EFI_STATUS
125 EFIAPI
126 FvbInitialize (
127 IN EFI_HANDLE ImageHandle,
128 IN EFI_SYSTEM_TABLE *SystemTable
129 );
130
131
132 VOID
133 EFIAPI
134 FvbClassAddressChangeEvent (
135 IN EFI_EVENT Event,
136 IN VOID *Context
137 );
138
139 EFI_STATUS
140 FvbGetLbaAddress (
141 IN UINTN Instance,
142 IN EFI_LBA Lba,
143 OUT UINTN *LbaAddress,
144 OUT UINTN *LbaLength,
145 OUT UINTN *NumOfBlocks,
146 IN ESAL_FWB_GLOBAL *Global,
147 IN BOOLEAN Virtual
148 );
149
150 //
151 // Protocol APIs
152 //
153 EFI_STATUS
154 EFIAPI
155 FvbProtocolGetAttributes (
156 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
157 OUT EFI_FVB_ATTRIBUTES_2 *Attributes
158 );
159
160 EFI_STATUS
161 EFIAPI
162 FvbProtocolSetAttributes (
163 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
164 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
165 );
166
167 EFI_STATUS
168 EFIAPI
169 FvbProtocolGetPhysicalAddress (
170 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
171 OUT EFI_PHYSICAL_ADDRESS *Address
172 );
173
174 EFI_STATUS
175 EFIAPI
176 FvbProtocolGetBlockSize (
177 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
178 IN CONST EFI_LBA Lba,
179 OUT UINTN *BlockSize,
180 OUT UINTN *NumOfBlocks
181 );
182
183 EFI_STATUS
184 EFIAPI
185 FvbProtocolRead (
186 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
187 IN CONST EFI_LBA Lba,
188 IN CONST UINTN Offset,
189 IN OUT UINTN *NumBytes,
190 IN UINT8 *Buffer
191 );
192
193 EFI_STATUS
194 EFIAPI
195 FvbProtocolWrite (
196 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
197 IN CONST EFI_LBA Lba,
198 IN CONST UINTN Offset,
199 IN OUT UINTN *NumBytes,
200 IN CONST UINT8 *Buffer
201 );
202
203 EFI_STATUS
204 EFIAPI
205 FvbProtocolEraseBlocks (
206 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
207 ...
208 );
209
210 EFI_STATUS
211 EFIAPI
212 FvbExtendProtocolEraseCustomBlockRange (
213 IN EFI_FVB_EXTENSION_PROTOCOL *This,
214 IN EFI_LBA StartLba,
215 IN UINTN OffsetStartLba,
216 IN EFI_LBA LastLba,
217 IN UINTN OffsetLastLba
218 );
219
220 #endif