]> git.proxmox.com Git - mirror_edk2.git/blob - Nt32Pkg/FvbServicesRuntimeDxe/FwBlockService.h
Correct comments
[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 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_FW_VOL_BLOCK_DEVICE;
62
63 EFI_STATUS
64 GetFvbInfo (
65 IN UINT64 FvLength,
66 OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo
67 );
68
69 EFI_STATUS
70 FvbReadBlock (
71 IN UINTN Instance,
72 IN EFI_LBA Lba,
73 IN UINTN BlockOffset,
74 IN OUT UINTN *NumBytes,
75 IN UINT8 *Buffer,
76 IN ESAL_FWB_GLOBAL *Global,
77 IN BOOLEAN Virtual
78 );
79
80 EFI_STATUS
81 FvbWriteBlock (
82 IN UINTN Instance,
83 IN CONST EFI_LBA Lba,
84 IN CONST UINTN BlockOffset,
85 IN OUT UINTN *NumBytes,
86 IN CONST UINT8 *Buffer,
87 IN ESAL_FWB_GLOBAL *Global,
88 IN BOOLEAN Virtual
89 );
90
91 EFI_STATUS
92 FvbEraseBlock (
93 IN UINTN Instance,
94 IN EFI_LBA Lba,
95 IN ESAL_FWB_GLOBAL *Global,
96 IN BOOLEAN Virtual
97 );
98
99 EFI_STATUS
100 FvbSetVolumeAttributes (
101 IN UINTN Instance,
102 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
103 IN ESAL_FWB_GLOBAL *Global,
104 IN BOOLEAN Virtual
105 );
106
107 EFI_STATUS
108 FvbGetVolumeAttributes (
109 IN UINTN Instance,
110 OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
111 IN ESAL_FWB_GLOBAL *Global,
112 IN BOOLEAN Virtual
113 );
114
115 EFI_STATUS
116 FvbGetPhysicalAddress (
117 IN UINTN Instance,
118 OUT EFI_PHYSICAL_ADDRESS *Address,
119 IN ESAL_FWB_GLOBAL *Global,
120 IN BOOLEAN Virtual
121 );
122
123 EFI_STATUS
124 EFIAPI
125 FvbInitialize (
126 IN EFI_HANDLE ImageHandle,
127 IN EFI_SYSTEM_TABLE *SystemTable
128 );
129
130
131 VOID
132 EFIAPI
133 FvbClassAddressChangeEvent (
134 IN EFI_EVENT Event,
135 IN VOID *Context
136 );
137
138 EFI_STATUS
139 FvbGetLbaAddress (
140 IN UINTN Instance,
141 IN EFI_LBA Lba,
142 OUT UINTN *LbaAddress,
143 OUT UINTN *LbaLength,
144 OUT UINTN *NumOfBlocks,
145 IN ESAL_FWB_GLOBAL *Global,
146 IN BOOLEAN Virtual
147 );
148
149 //
150 // Protocol APIs
151 //
152 EFI_STATUS
153 EFIAPI
154 FvbProtocolGetAttributes (
155 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
156 OUT EFI_FVB_ATTRIBUTES_2 *Attributes
157 );
158
159 EFI_STATUS
160 EFIAPI
161 FvbProtocolSetAttributes (
162 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
163 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
164 );
165
166 EFI_STATUS
167 EFIAPI
168 FvbProtocolGetPhysicalAddress (
169 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
170 OUT EFI_PHYSICAL_ADDRESS *Address
171 );
172
173 EFI_STATUS
174 EFIAPI
175 FvbProtocolGetBlockSize (
176 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
177 IN CONST EFI_LBA Lba,
178 OUT UINTN *BlockSize,
179 OUT UINTN *NumOfBlocks
180 );
181
182 EFI_STATUS
183 EFIAPI
184 FvbProtocolRead (
185 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
186 IN CONST EFI_LBA Lba,
187 IN CONST UINTN Offset,
188 IN OUT UINTN *NumBytes,
189 IN UINT8 *Buffer
190 );
191
192 EFI_STATUS
193 EFIAPI
194 FvbProtocolWrite (
195 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
196 IN EFI_LBA Lba,
197 IN UINTN Offset,
198 IN OUT UINTN *NumBytes,
199 IN UINT8 *Buffer
200 );
201
202 EFI_STATUS
203 EFIAPI
204 FvbProtocolEraseBlocks (
205 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
206 ...
207 );
208
209 #endif