]> git.proxmox.com Git - mirror_edk2.git/blame_incremental - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h
OvmfPkg: Apply uncrustify changes
[mirror_edk2.git] / OvmfPkg / QemuFlashFvbServicesRuntimeDxe / QemuFlash.h
... / ...
CommitLineData
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
5\r
6 SPDX-License-Identifier: BSD-2-Clause-Patent\r
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
15extern UINT8 *mFlashBase;\r
16\r
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 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
47 IN EFI_LBA Lba,\r
48 IN UINTN Offset,\r
49 IN UINTN *NumBytes,\r
50 IN UINT8 *Buffer\r
51 );\r
52\r
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
61 IN EFI_LBA Lba\r
62 );\r
63\r
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
76VOID\r
77QemuFlashConvertPointers (\r
78 VOID\r
79 );\r
80\r
81VOID\r
82QemuFlashBeforeProbe (\r
83 IN EFI_PHYSICAL_ADDRESS BaseAddress,\r
84 IN UINTN FdBlockSize,\r
85 IN UINTN FdBlockCount\r
86 );\r
87\r
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
97 IN volatile UINT8 *Ptr,\r
98 IN UINT8 Value\r
99 );\r
100\r
101#endif\r