VirtualBox

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

Last change on this file since 105381 was 99404, checked in by vboxsync, 20 months ago

Devices/EFI/FirmwareNew: Update to edk2-stable202302 and make it build, bugref:4643

  • Property svn:eol-style set to native
File size: 4.5 KB
Line 
1/**@file
2
3 Copyright (c) 2006, Intel Corporation. All rights reserved.<BR>
4
5 SPDX-License-Identifier: BSD-2-Clause-Patent
6
7 Module Name:
8
9 FwBlockService.h
10
11 Abstract:
12
13 Firmware volume block driver for Intel Firmware Hub (FWH) device
14
15**/
16
17#ifndef _FW_BLOCK_SERVICE_H
18#define _FW_BLOCK_SERVICE_H
19
20typedef struct {
21 UINTN FvBase;
22 UINTN NumOfBlocks;
23 EFI_FIRMWARE_VOLUME_HEADER VolumeHeader;
24} EFI_FW_VOL_INSTANCE;
25
26typedef struct {
27 UINT32 NumFv;
28 EFI_FW_VOL_INSTANCE *FvInstance;
29} ESAL_FWB_GLOBAL;
30
31extern ESAL_FWB_GLOBAL *mFvbModuleGlobal;
32
33//
34// Fvb Protocol instance data
35//
36#define FVB_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE,\
37 FwVolBlockInstance, FVB_DEVICE_SIGNATURE)
38
39#define FVB_EXTEND_DEVICE_FROM_THIS(a) CR (a, EFI_FW_VOL_BLOCK_DEVICE,\
40 FvbExtension, FVB_DEVICE_SIGNATURE)
41
42#define FVB_DEVICE_SIGNATURE SIGNATURE_32 ('F', 'V', 'B', 'N')
43
44typedef struct {
45 MEDIA_FW_VOL_DEVICE_PATH FvDevPath;
46 EFI_DEVICE_PATH_PROTOCOL EndDevPath;
47} FV_PIWG_DEVICE_PATH;
48
49typedef struct {
50 MEMMAP_DEVICE_PATH MemMapDevPath;
51 EFI_DEVICE_PATH_PROTOCOL EndDevPath;
52} FV_MEMMAP_DEVICE_PATH;
53
54typedef struct {
55 UINTN Signature;
56 EFI_DEVICE_PATH_PROTOCOL *DevicePath;
57 UINTN Instance;
58 EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL FwVolBlockInstance;
59} EFI_FW_VOL_BLOCK_DEVICE;
60
61EFI_STATUS
62GetFvbInfo (
63 IN UINT64 FvLength,
64 OUT EFI_FIRMWARE_VOLUME_HEADER **FvbInfo
65 );
66
67EFI_STATUS
68FvbSetVolumeAttributes (
69 IN UINTN Instance,
70 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
71 IN ESAL_FWB_GLOBAL *Global
72 );
73
74EFI_STATUS
75FvbGetVolumeAttributes (
76 IN UINTN Instance,
77 OUT EFI_FVB_ATTRIBUTES_2 *Attributes,
78 IN ESAL_FWB_GLOBAL *Global
79 );
80
81EFI_STATUS
82FvbGetPhysicalAddress (
83 IN UINTN Instance,
84 OUT EFI_PHYSICAL_ADDRESS *Address,
85 IN ESAL_FWB_GLOBAL *Global
86 );
87
88EFI_STATUS
89EFIAPI
90FvbInitialize (
91 IN EFI_HANDLE ImageHandle,
92 IN EFI_SYSTEM_TABLE *SystemTable
93 );
94
95VOID
96EFIAPI
97FvbClassAddressChangeEvent (
98 IN EFI_EVENT Event,
99 IN VOID *Context
100 );
101
102EFI_STATUS
103FvbGetLbaAddress (
104 IN UINTN Instance,
105 IN EFI_LBA Lba,
106 OUT UINTN *LbaAddress,
107 OUT UINTN *LbaLength,
108 OUT UINTN *NumOfBlocks,
109 IN ESAL_FWB_GLOBAL *Global
110 );
111
112//
113// Protocol APIs
114//
115EFI_STATUS
116EFIAPI
117FvbProtocolGetAttributes (
118 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
119 OUT EFI_FVB_ATTRIBUTES_2 *Attributes
120 );
121
122EFI_STATUS
123EFIAPI
124FvbProtocolSetAttributes (
125 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
126 IN OUT EFI_FVB_ATTRIBUTES_2 *Attributes
127 );
128
129EFI_STATUS
130EFIAPI
131FvbProtocolGetPhysicalAddress (
132 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
133 OUT EFI_PHYSICAL_ADDRESS *Address
134 );
135
136EFI_STATUS
137EFIAPI
138FvbProtocolGetBlockSize (
139 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
140 IN CONST EFI_LBA Lba,
141 OUT UINTN *BlockSize,
142 OUT UINTN *NumOfBlocks
143 );
144
145EFI_STATUS
146EFIAPI
147FvbProtocolRead (
148 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
149 IN CONST EFI_LBA Lba,
150 IN CONST UINTN Offset,
151 IN OUT UINTN *NumBytes,
152 IN UINT8 *Buffer
153 );
154
155EFI_STATUS
156EFIAPI
157FvbProtocolWrite (
158 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
159 IN EFI_LBA Lba,
160 IN UINTN Offset,
161 IN OUT UINTN *NumBytes,
162 IN UINT8 *Buffer
163 );
164
165EFI_STATUS
166EFIAPI
167FvbProtocolEraseBlocks (
168 IN CONST EFI_FIRMWARE_VOLUME_BLOCK_PROTOCOL *This,
169 ...
170 );
171
172//
173// The following functions have different implementations dependent on the
174// module type chosen for building this driver.
175//
176VOID
177InstallProtocolInterfaces (
178 IN EFI_FW_VOL_BLOCK_DEVICE *FvbDevice
179 );
180
181VOID
182InstallVirtualAddressChangeHandler (
183 VOID
184 );
185
186EFI_STATUS
187MarkIoMemoryRangeForRuntimeAccess (
188 IN EFI_PHYSICAL_ADDRESS BaseAddress,
189 IN UINTN Length
190 );
191
192VOID
193SetPcdFlashNvStorageBaseAddresses (
194 VOID
195 );
196
197#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