]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h
OvmfPkg: Apply uncrustify changes
[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
ac0a286f 15extern UINT8 *mFlashBase;\r
1767877a 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
ac0a286f
MK
29 IN EFI_LBA Lba,\r
30 IN UINTN Offset,\r
31 IN UINTN *NumBytes,\r
32 IN UINT8 *Buffer\r
a4ce9ffd
JJ
33 );\r
34\r
a4ce9ffd
JJ
35/**\r
36 Write to QEMU Flash\r
37\r
38 @param[in] Lba The starting logical block index to write to.\r
39 @param[in] Offset Offset into the block at which to begin writing.\r
40 @param[in] NumBytes On input, indicates the requested write size. On\r
41 output, indicates the actual number of bytes written\r
42 @param[in] Buffer Pointer to the data to write.\r
43\r
44**/\r
45EFI_STATUS\r
46QemuFlashWrite (\r
ac0a286f
MK
47 IN EFI_LBA Lba,\r
48 IN UINTN Offset,\r
49 IN UINTN *NumBytes,\r
50 IN UINT8 *Buffer\r
a4ce9ffd
JJ
51 );\r
52\r
a4ce9ffd
JJ
53/**\r
54 Erase a QEMU Flash block\r
55\r
56 @param Lba The logical block index to erase.\r
57\r
58**/\r
59EFI_STATUS\r
60QemuFlashEraseBlock (\r
ac0a286f 61 IN EFI_LBA Lba\r
a4ce9ffd
JJ
62 );\r
63\r
a4ce9ffd
JJ
64/**\r
65 Initializes QEMU flash memory support\r
66\r
67 @retval EFI_WRITE_PROTECTED The QEMU flash device is not present.\r
68 @retval EFI_SUCCESS The QEMU flash device is supported.\r
69\r
70**/\r
71EFI_STATUS\r
72QemuFlashInitialize (\r
73 VOID\r
74 );\r
75\r
a4ce9ffd
JJ
76VOID\r
77QemuFlashConvertPointers (\r
78 VOID\r
79 );\r
80\r
e4a1d5a7
BS
81VOID\r
82QemuFlashBeforeProbe (\r
ac0a286f
MK
83 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
84 IN UINTN FdBlockSize,\r
85 IN UINTN FdBlockCount\r
e4a1d5a7
BS
86 );\r
87\r
437eb3f7
TL
88/**\r
89 Write to QEMU Flash\r
90\r
91 @param[in] Ptr Pointer to the location to write.\r
92 @param[in] Value The value to write.\r
93\r
94**/\r
95VOID\r
96QemuFlashPtrWrite (\r
ac0a286f
MK
97 IN volatile UINT8 *Ptr,\r
98 IN UINT8 Value\r
437eb3f7
TL
99 );\r
100\r
a4ce9ffd 101#endif\r