]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h
NetworkPkg: Move Network library header file from MdeModulePkg to NetworkPkg
[mirror_edk2.git] / OvmfPkg / QemuFlashFvbServicesRuntimeDxe / QemuFlash.h
CommitLineData
a4ce9ffd
JJ
1/** @file\r
2 OVMF support for QEMU system firmware flash device\r
3\r
4 Copyright (c) 2009 - 2013, Intel Corporation. All rights reserved.<BR>\r
ea0d111e 5\r
b26f0cf9 6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
a4ce9ffd
JJ
7\r
8**/\r
9\r
10#ifndef __QEMU_FLASH_H__\r
11#define __QEMU_FLASH_H__\r
12\r
13#include <Protocol/FirmwareVolumeBlock.h>\r
14\r
1767877a
LE
15extern UINT8 *mFlashBase;\r
16\r
a4ce9ffd
JJ
17/**\r
18 Read from QEMU Flash\r
19\r
20 @param[in] Lba The starting logical block index to read from.\r
21 @param[in] Offset Offset into the block at which to begin reading.\r
22 @param[in] NumBytes On input, indicates the requested read size. On\r
23 output, indicates the actual number of bytes read\r
24 @param[in] Buffer Pointer to the buffer to read into.\r
25\r
26**/\r
27EFI_STATUS\r
28QemuFlashRead (\r
29 IN EFI_LBA Lba,\r
30 IN UINTN Offset,\r
31 IN UINTN *NumBytes,\r
32 IN UINT8 *Buffer\r
33 );\r
34\r
35\r
36/**\r
37 Write to QEMU Flash\r
38\r
39 @param[in] Lba The starting logical block index to write to.\r
40 @param[in] Offset Offset into the block at which to begin writing.\r
41 @param[in] NumBytes On input, indicates the requested write size. On\r
42 output, indicates the actual number of bytes written\r
43 @param[in] Buffer Pointer to the data to write.\r
44\r
45**/\r
46EFI_STATUS\r
47QemuFlashWrite (\r
48 IN EFI_LBA Lba,\r
49 IN UINTN Offset,\r
50 IN UINTN *NumBytes,\r
51 IN UINT8 *Buffer\r
52 );\r
53\r
54\r
55/**\r
56 Erase a QEMU Flash block\r
57\r
58 @param Lba The logical block index to erase.\r
59\r
60**/\r
61EFI_STATUS\r
62QemuFlashEraseBlock (\r
63 IN EFI_LBA Lba\r
64 );\r
65\r
66\r
67/**\r
68 Initializes QEMU flash memory support\r
69\r
70 @retval EFI_WRITE_PROTECTED The QEMU flash device is not present.\r
71 @retval EFI_SUCCESS The QEMU flash device is supported.\r
72\r
73**/\r
74EFI_STATUS\r
75QemuFlashInitialize (\r
76 VOID\r
77 );\r
78\r
79\r
80VOID\r
81QemuFlashConvertPointers (\r
82 VOID\r
83 );\r
84\r
e4a1d5a7
BS
85VOID\r
86QemuFlashBeforeProbe (\r
87 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
88 IN UINTN FdBlockSize,\r
89 IN UINTN FdBlockCount\r
90 );\r
91\r
a4ce9ffd
JJ
92#endif\r
93\r