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