VirtualBox

source: vbox/trunk/src/VBox/Devices/EFI/Firmware/OvmfPkg/QemuFlashFvbServicesRuntimeDxe/FwBlockService.h@ 61497

Last change on this file since 61497 was 58466, checked in by vboxsync, 9 years ago

EFI/Firmware: Merged in the svn:eol-style, svn:mime-type and trailing whitespace cleanup that was done after the initial UDK2014.SP1 import: svn merge /vendor/edk2/UDK2014.SP1 /vendor/edk2/current .

  • Property svn:eol-style set to native
File size: 5.0 KB
Line 
1/**@file
2
3Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4This program and the accompanying materials
5are licensed and made available under the terms and conditions of the BSD License
6which accompanies this distribution. The full text of the license may be found at
7http://opensource.org/licenses/bsd-license.php
8
9THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
11
12Module Name:
13
14 FwBlockService.h
15
16Abstract:
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
31typedef struct {
32 EFI_LOCK FvbDevLock;
33 UINTN FvBase[2];
34 UINTN NumOfBlocks;
35 EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;
36} EFI_FW_VOL_INSTANCE;
37
38typedef 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
51typedef struct {
52 MEDIA_FW_VOL_DEVICE_PATH FvDevPath;
53 EFI_DEVICE_PATH_PROTOCOL EndDevPath;
54} FV_PIWG_DEVICE_PATH;
55
56typedef struct {
57 MEMMAP_DEVICE_PATH MemMapDevPath;
58 EFI_DEVICE_PATH_PROTOCOL EndDevPath;
59} FV_MEMMAP_DEVICE_PATH;
60
61typedef struct {
62 UINTN Signature;
63 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
64 UINTN Instance;
65 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL FwVolBlockInstance;
66} EFI_FW_VOL_BLOCK_DEVICE;
67
68EFI_STATUS
69GetFvbInfo (
70 IN UINT64 FvLength,
71 OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo
72 );
73
74EFI_STATUS
75FvbSetVolumeAttributes (
76 IN UINTN Instance,
77 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
78 IN ESAL_FWB_GLOBAL *Global,
79 IN BOOLEAN Virtual
80 );
81
82EFI_STATUS
83FvbGetVolumeAttributes (
84 IN UINTN Instance,
85 OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
86 IN ESAL_FWB_GLOBAL *Global,
87 IN BOOLEAN Virtual
88 );
89
90EFI_STATUS
91FvbGetPhysicalAddress (
92 IN UINTN Instance,
93 OUT EFI_PHYSICAL_ADDRESS *Address,
94 IN ESAL_FWB_GLOBAL *Global,
95 IN BOOLEAN Virtual
96 );
97
98EFI_STATUS
99EFIAPI
100FvbInitialize (
101 IN EFI_HANDLE ImageHandle,
102 IN EFI_SYSTEM_TABLE *SystemTable
103 );
104
105
106VOID
107EFIAPI
108FvbClassAddressChangeEvent (
109 IN EFI_EVENT Event,
110 IN VOID *Context
111 );
112
113EFI_STATUS
114FvbGetLbaAddress (
115 IN UINTN Instance,
116 IN EFI_LBA Lba,
117 OUT UINTN *LbaAddress,
118 OUT UINTN *LbaLength,
119 OUT UINTN *NumOfBlocks,
120 IN ESAL_FWB_GLOBAL *Global,
121 IN BOOLEAN Virtual
122 );
123
124//
125// Protocol APIs
126//
127EFI_STATUS
128EFIAPI
129FvbProtocolGetAttributes (
130 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
131 OUT EFI_FVB_ATTRIBUTES_2 *Attributes
132 );
133
134EFI_STATUS
135EFIAPI
136FvbProtocolSetAttributes (
137 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
138 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
139 );
140
141EFI_STATUS
142EFIAPI
143FvbProtocolGetPhysicalAddress (
144 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
145 OUT EFI_PHYSICAL_ADDRESS *Address
146 );
147
148EFI_STATUS
149EFIAPI
150FvbProtocolGetBlockSize (
151 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
152 IN CONST EFI_LBA Lba,
153 OUT UINTN *BlockSize,
154 OUT UINTN *NumOfBlocks
155 );
156
157EFI_STATUS
158EFIAPI
159FvbProtocolRead (
160 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
161 IN CONST EFI_LBA Lba,
162 IN CONST UINTN Offset,
163 IN OUT UINTN *NumBytes,
164 IN UINT8 *Buffer
165 );
166
167EFI_STATUS
168EFIAPI
169FvbProtocolWrite (
170 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
171 IN EFI_LBA Lba,
172 IN UINTN Offset,
173 IN OUT UINTN *NumBytes,
174 IN UINT8 *Buffer
175 );
176
177EFI_STATUS
178EFIAPI
179FvbProtocolEraseBlocks (
180 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
181 ...
182 );
183
184#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette