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