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