]> git.proxmox.com Git - mirror_edk2.git/blame - OvmfPkg/QemuFlashFvbServicesRuntimeDxe/QemuFlash.h
OvmfPkg/QemuVideoDxe/VbeShim: handle PAM1 register on Q35 correctly
[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
LE
5\r
6 This program and the accompanying materials are licensed and made available\r
7 under the terms and conditions of the BSD License which accompanies this\r
8 distribution. The full text of the license may be found at\r
a4ce9ffd
JJ
9 http://opensource.org/licenses/bsd-license.php\r
10\r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14**/\r
15\r
16#ifndef __QEMU_FLASH_H__\r
17#define __QEMU_FLASH_H__\r
18\r
19#include <Protocol/FirmwareVolumeBlock.h>\r
20\r
1767877a
LE
21extern UINT8 *mFlashBase;\r
22\r
a4ce9ffd
JJ
23/**\r
24 Read from QEMU Flash\r
25\r
26 @param[in] Lba The starting logical block index to read from.\r
27 @param[in] Offset Offset into the block at which to begin reading.\r
28 @param[in] NumBytes On input, indicates the requested read size. On\r
29 output, indicates the actual number of bytes read\r
30 @param[in] Buffer Pointer to the buffer to read into.\r
31\r
32**/\r
33EFI_STATUS\r
34QemuFlashRead (\r
35 IN EFI_LBA Lba,\r
36 IN UINTN Offset,\r
37 IN UINTN *NumBytes,\r
38 IN UINT8 *Buffer\r
39 );\r
40\r
41\r
42/**\r
43 Write to QEMU Flash\r
44\r
45 @param[in] Lba The starting logical block index to write to.\r
46 @param[in] Offset Offset into the block at which to begin writing.\r
47 @param[in] NumBytes On input, indicates the requested write size. On\r
48 output, indicates the actual number of bytes written\r
49 @param[in] Buffer Pointer to the data to write.\r
50\r
51**/\r
52EFI_STATUS\r
53QemuFlashWrite (\r
54 IN EFI_LBA Lba,\r
55 IN UINTN Offset,\r
56 IN UINTN *NumBytes,\r
57 IN UINT8 *Buffer\r
58 );\r
59\r
60\r
61/**\r
62 Erase a QEMU Flash block\r
63\r
64 @param Lba The logical block index to erase.\r
65\r
66**/\r
67EFI_STATUS\r
68QemuFlashEraseBlock (\r
69 IN EFI_LBA Lba\r
70 );\r
71\r
72\r
73/**\r
74 Initializes QEMU flash memory support\r
75\r
76 @retval EFI_WRITE_PROTECTED The QEMU flash device is not present.\r
77 @retval EFI_SUCCESS The QEMU flash device is supported.\r
78\r
79**/\r
80EFI_STATUS\r
81QemuFlashInitialize (\r
82 VOID\r
83 );\r
84\r
85\r
86VOID\r
87QemuFlashConvertPointers (\r
88 VOID\r
89 );\r
90\r
91#endif\r
92\r