Rename Protocol/FrameworkHii.h to Protocol/HiiFramework.h to follow the naming conven...
[mirror_edk2.git] / EdkNt32Pkg / RuntimeDxe / FvbServices / FwBlockService.h
CommitLineData
878ddf1f 1/*++\r
2\r
3Copyright (c) 2006, Intel Corporation \r
4All rights reserved. This program and the accompanying materials \r
5are licensed and made available under the terms and conditions of the BSD License \r
6which accompanies this distribution. The full text of the license may be found at \r
7http://opensource.org/licenses/bsd-license.php \r
8 \r
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. \r
11\r
12Module Name:\r
13\r
14 FwBlockService.h\r
15 \r
16Abstract:\r
17\r
18 Firmware volume block driver for Intel Firmware Hub (FWH) device\r
19\r
20--*/\r
21\r
22#ifndef _FW_BLOCK_SERVICE_H\r
23#define _FW_BLOCK_SERVICE_H\r
24\r
25//\r
26// BugBug: Add documentation here for data structure!!!!\r
27//\r
28#define FVB_PHYSICAL 0\r
29#define FVB_VIRTUAL 1\r
30\r
31typedef struct {\r
32 EFI_LOCK FvbDevLock;\r
33 UINTN FvBase[2];\r
34 UINTN NumOfBlocks;\r
35 EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;\r
36} EFI_FW_VOL_INSTANCE;\r
37\r
38typedef struct {\r
39 UINT32 NumFv;\r
40 EFI_FW_VOL_INSTANCE *FvInstance[2];\r
41 UINT8 *FvbScratchSpace[2];\r
42} ESAL_FWB_GLOBAL;\r
43\r
44//\r
45// Fvb Protocol instance data\r
46//\r
47#define FVB_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE, FwVolBlockInstance, FVB_DEVICE_SIGNATURE)\r
48#define FVB_EXTEND_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE, FvbExtension, FVB_DEVICE_SIGNATURE)\r
49#define FVB_DEVICE_SIGNATURE EFI_SIGNATURE_32 ('F', 'V', 'B', 'N')\r
50\r
51typedef struct {\r
52 MEMMAP_DEVICE_PATH MemMapDevPath;\r
53 EFI_DEVICE_PATH_PROTOCOL EndDevPath;\r
54} FV_DEVICE_PATH;\r
55\r
56typedef struct {\r
57 UINTN Signature;\r
58 FV_DEVICE_PATH DevicePath;\r
59 UINTN Instance;\r
60 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL FwVolBlockInstance;\r
61 EFI_FVB_EXTENSION_PROTOCOL FvbExtension;\r
62} EFI_FW_VOL_BLOCK_DEVICE;\r
63\r
64EFI_STATUS\r
65GetFvbInfo (\r
66 IN UINT64 FvLength,\r
67 OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo\r
68 )\r
69;\r
70\r
71EFI_STATUS\r
72FvbReadBlock (\r
73 IN UINTN Instance,\r
74 IN EFI_LBA Lba,\r
75 IN UINTN BlockOffset,\r
76 IN OUT UINTN *NumBytes,\r
77 IN UINT8 *Buffer,\r
78 IN ESAL_FWB_GLOBAL *Global,\r
79 IN BOOLEAN Virtual\r
80 )\r
81;\r
82\r
83EFI_STATUS\r
84FvbWriteBlock (\r
85 IN UINTN Instance,\r
86 IN EFI_LBA Lba,\r
87 IN UINTN BlockOffset,\r
88 IN OUT UINTN *NumBytes,\r
89 IN UINT8 *Buffer,\r
90 IN ESAL_FWB_GLOBAL *Global,\r
91 IN BOOLEAN Virtual\r
92 )\r
93;\r
94\r
95EFI_STATUS\r
96FvbEraseBlock (\r
97 IN UINTN Instance,\r
98 IN EFI_LBA Lba,\r
99 IN ESAL_FWB_GLOBAL *Global,\r
100 IN BOOLEAN Virtual\r
101 )\r
102;\r
103\r
104EFI_STATUS\r
105FvbSetVolumeAttributes (\r
106 IN UINTN Instance,\r
107 IN OUT EFI_FVB_ATTRIBUTES *Attributes,\r
108 IN ESAL_FWB_GLOBAL *Global,\r
109 IN BOOLEAN Virtual\r
110 )\r
111;\r
112\r
113EFI_STATUS\r
114FvbGetVolumeAttributes (\r
115 IN UINTN Instance,\r
116 OUT EFI_FVB_ATTRIBUTES *Attributes,\r
117 IN ESAL_FWB_GLOBAL *Global,\r
118 IN BOOLEAN Virtual\r
119 )\r
120;\r
121\r
122EFI_STATUS\r
123FvbGetPhysicalAddress (\r
124 IN UINTN Instance,\r
125 OUT EFI_PHYSICAL_ADDRESS *Address,\r
126 IN ESAL_FWB_GLOBAL *Global,\r
127 IN BOOLEAN Virtual\r
128 )\r
129;\r
130\r
131EFI_STATUS\r
132EFIAPI\r
133FvbInitialize (\r
134 IN EFI_HANDLE ImageHandle,\r
135 IN EFI_SYSTEM_TABLE *SystemTable\r
136 )\r
137;\r
138\r
139\r
140VOID\r
141EFIAPI\r
142FvbClassAddressChangeEvent (\r
143 IN EFI_EVENT Event,\r
144 IN VOID *Context\r
145 )\r
146;\r
147\r
148EFI_STATUS\r
149FvbGetLbaAddress (\r
150 IN UINTN Instance,\r
151 IN EFI_LBA Lba,\r
152 OUT UINTN *LbaAddress,\r
153 OUT UINTN *LbaLength,\r
154 OUT UINTN *NumOfBlocks,\r
155 IN ESAL_FWB_GLOBAL *Global,\r
156 IN BOOLEAN Virtual\r
157 )\r
158;\r
159\r
160//\r
161// Protocol APIs\r
162//\r
163EFI_STATUS\r
164EFIAPI\r
165FvbProtocolGetAttributes (\r
166 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
167 OUT EFI_FVB_ATTRIBUTES *Attributes\r
168 )\r
169;\r
170\r
171EFI_STATUS\r
172EFIAPI\r
173FvbProtocolSetAttributes (\r
174 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
175 IN OUT EFI_FVB_ATTRIBUTES *Attributes\r
176 )\r
177;\r
178\r
179EFI_STATUS\r
180EFIAPI\r
181FvbProtocolGetPhysicalAddress (\r
182 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
183 OUT EFI_PHYSICAL_ADDRESS *Address\r
184 )\r
185;\r
186\r
187EFI_STATUS\r
188EFIAPI\r
189FvbProtocolGetBlockSize (\r
190 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
191 IN EFI_LBA Lba,\r
192 OUT UINTN *BlockSize,\r
193 OUT UINTN *NumOfBlocks\r
194 )\r
195;\r
196\r
197EFI_STATUS\r
198EFIAPI\r
199FvbProtocolRead (\r
200 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
201 IN EFI_LBA Lba,\r
202 IN UINTN Offset,\r
203 IN OUT UINTN *NumBytes,\r
204 IN UINT8 *Buffer\r
205 )\r
206;\r
207\r
208EFI_STATUS\r
209EFIAPI\r
210FvbProtocolWrite (\r
211 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
212 IN EFI_LBA Lba,\r
213 IN UINTN Offset,\r
214 IN OUT UINTN *NumBytes,\r
215 IN UINT8 *Buffer\r
216 )\r
217;\r
218\r
219EFI_STATUS\r
220EFIAPI\r
221FvbProtocolEraseBlocks (\r
222 IN EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,\r
223 ...\r
224 )\r
225;\r
226\r
227EFI_STATUS\r
228EFIAPI\r
229FvbExtendProtocolEraseCustomBlockRange (\r
230 IN EFI_FVB_EXTENSION_PROTOCOL *This,\r
231 IN EFI_LBA StartLba,\r
232 IN UINTN OffsetStartLba,\r
233 IN EFI_LBA LastLba,\r
234 IN UINTN OffsetLastLba\r
235 )\r
236;\r
237\r
238#endif\r