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