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