4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/** @file
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Definitions of functions for Driver Binding Protocol and Block I/O Protocol,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and other internal definitions.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This program and the accompanying materials
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync are licensed and made available under the terms and conditions of the BSD License
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync which accompanies this distribution. The full text of the license may be found at
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync http://opensource.org/licenses/bsd-license.php
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#ifndef _EFI_BLOCK_MMIO_TO_BLOCK_IO_H_
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define _EFI_BLOCK_MMIO_TO_BLOCK_IO_H_
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Uefi.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Protocol/BlockMmio.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Protocol/ComponentName.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Protocol/ComponentName2.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Protocol/CpuIo2.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Protocol/DevicePath.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Protocol/DriverBinding.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/BaseLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/DebugLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/MemoryAllocationLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/UefiBootServicesTableLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#include <Library/UefiLib.h>
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define BLOCK_MMIO_TO_BLOCK_IO_SIGNATURE SIGNATURE_32 ('B', 'M', 'I', 'O')
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#define PRIVATE_FROM_BLOCK_IO(a) \
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync CR (a, BLOCK_MMIO_TO_BLOCK_IO_DEVICE, BlockIo, BLOCK_MMIO_TO_BLOCK_IO_SIGNATURE)
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncextern EFI_COMPONENT_NAME_PROTOCOL gBlockMmioToBlockIoComponentName;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncextern EFI_COMPONENT_NAME2_PROTOCOL gBlockMmioToBlockIoComponentName2;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsynctypedef struct {
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync UINT32 Signature;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_HANDLE Controller;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync BLOCK_MMIO_PROTOCOL *BlockMmio;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_CPU_IO2_PROTOCOL *CpuIo;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_DEVICE_PATH_PROTOCOL *DevicePath;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_BLOCK_IO_PROTOCOL BlockIo;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync} BLOCK_MMIO_TO_BLOCK_IO_DEVICE;
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Functions for Driver Binding Protocol
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Check whether the controller is a supported.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This The driver binding protocol.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Controller The controller handle to check.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param RemainingDevicePath The remaining device path.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The driver supports this controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval other This device isn't supported.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoDriverBindingSupported (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_DRIVER_BINDING_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_HANDLE Controller,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Starts the BlockIo device with this driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function consumes Block MMIO Portocol and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync installs Block I/O Protocol.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This The driver binding protocol.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Controller The Block MMIO device to start on
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param RemainingDevicePath The remaining device path.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS This driver supports this device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_UNSUPPORTED This driver does not support this device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR This driver cannot be started due to device Error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_OUT_OF_RESOURCES Can't allocate memory resources.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_ALREADY_STARTED This driver has been started.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoDriverBindingStart (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_DRIVER_BINDING_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_HANDLE Controller,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Stop controlling the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This The driver binding
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Controller The device controller controlled by the driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param NumberOfChildren The number of children of this device
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ChildHandleBuffer The buffer of children handle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The driver stopped from controlling the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_UNSUPPORTED Block I/O Protocol is not installed on Controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval Others Failed to stop the driver
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoDriverBindingStop (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_DRIVER_BINDING_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_HANDLE Controller,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN NumberOfChildren,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_HANDLE *ChildHandleBuffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// Functions for Block I/O Protocol
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reset the block device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function implements EFI_BLOCK_IO_PROTOCOL.Reset().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It resets the block device hardware.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ExtendedVerification is ignored in this implementation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Indicates a pointer to the calling context.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ExtendedVerification Indicates that the driver may perform a more exhaustive
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync verification operation of the device during reset.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The block device was reset.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The block device is not functioning correctly and could not be reset.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoReset (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_BLOCK_IO_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN BOOLEAN ExtendedVerification
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Reads the requested number of blocks from the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function implements EFI_BLOCK_IO_PROTOCOL.ReadBlocks().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It reads the requested number of blocks from the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync All the blocks are read, or an error is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Indicates a pointer to the calling context.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param MediaId The media ID that the read request is for.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Lba The starting logical block address to read from on the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param BufferSize The size of the Buffer in bytes.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This must be a multiple of the intrinsic block size of the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer A pointer to the destination buffer for the data. The caller is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync responsible for either having implicit or explicit ownership of the buffer.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The data was read correctly from the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The device reported an error while attempting to perform the read operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NO_MEDIA There is no media in the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic block size of the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER The read request contains LBAs that are not valid,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync or the buffer is not on proper alignment.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoReadBlocks (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_BLOCK_IO_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 MediaId,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_LBA Lba,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN BufferSize,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT VOID *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Writes a specified number of blocks to the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function implements EFI_BLOCK_IO_PROTOCOL.WriteBlocks().
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync It writes a specified number of blocks to the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync All blocks are written, or an error is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Indicates a pointer to the calling context.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param MediaId The media ID that the write request is for.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Lba The starting logical block address to be written.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param BufferSize The size of the Buffer in bytes.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This must be a multiple of the intrinsic block size of the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Buffer Pointer to the source buffer for the data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The data were written correctly to the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_WRITE_PROTECTED The device cannot be written to.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NO_MEDIA There is no media in the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_MEDIA_CHANGED The MediaId is not for the current media.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The device reported an error while attempting to perform the write operation.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_BAD_BUFFER_SIZE The BufferSize parameter is not a multiple of the intrinsic
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync block size of the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER The write request contains LBAs that are not valid,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync or the buffer is not on proper alignment.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoWriteBlocks (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_BLOCK_IO_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINT32 MediaId,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_LBA Lba,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN UINTN BufferSize,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN VOID *Buffer
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Flushes all modified data to a physical block device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This Indicates a pointer to the calling context.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS All outstanding data were written correctly to the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_DEVICE_ERROR The device reported an error while attempting to write data.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_NO_MEDIA There is no media in the device.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockIoFlushBlocks (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_BLOCK_IO_PROTOCOL *This
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync// EFI Component Name Functions
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync//
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Retrieves a Unicode string that is the user readable name of the driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function retrieves the user readable name of a driver in the form of a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Unicode string. If the driver specified by This has a user readable name in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the language specified by Language, then a pointer to the driver name is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned in DriverName, and EFI_SUCCESS is returned. If the driver specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync by This does not support the language specified by Language,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync then EFI_UNSUPPORTED is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_COMPONENT_NAME_PROTOCOL instance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Language A pointer to a Null-terminated ASCII string
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync array indicating the language. This is the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync language of the driver name that the caller is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync requesting, and it must match one of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync languages specified in SupportedLanguages. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of languages supported by a driver is up
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to the driver writer. Language is specified
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync in RFC 4646 or ISO 639-2 language code format.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param DriverName A pointer to the Unicode string to return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This Unicode string is the name of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync driver specified by This in the language
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by Language.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The Unicode string for the Driver specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This and the language specified by Language was
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned in DriverName.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER Language is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER DriverName is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_UNSUPPORTED The driver specified by This does not support
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the language specified by Language.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockMmioToBlockIoGetDriverName (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_COMPONENT_NAME_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CHAR8 *Language,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT CHAR16 **DriverName
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync/**
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Retrieves a Unicode string that is the user readable name of the controller
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync that is being managed by a driver.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This function retrieves the user readable name of the controller specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ControllerHandle and ChildHandle in the form of a Unicode string. If the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync driver specified by This has a user readable name in the language specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Language, then a pointer to the controller name is returned in ControllerName,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync and EFI_SUCCESS is returned. If the driver specified by This is not currently
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync managing the controller specified by ControllerHandle and ChildHandle,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync then EFI_UNSUPPORTED is returned. If the driver specified by This does not
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync support the language specified by Language, then EFI_UNSUPPORTED is returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param This A pointer to the EFI_COMPONENT_NAME2_PROTOCOL or
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_COMPONENT_NAME_PROTOCOL instance.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ControllerHandle The handle of a controller that the driver
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by This is managing. This handle
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specifies the controller whose name is to be
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync returned.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ChildHandle The handle of the child controller to retrieve
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the name of. This is an optional parameter that
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync may be NULL. It will be NULL for device
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync drivers. It will also be NULL for a bus drivers
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync that wish to retrieve the name of the bus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync controller. It will not be NULL for a bus
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync driver that wishes to retrieve the name of a
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync child controller.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param Language A pointer to a Null-terminated ASCII string
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync array indicating the language. This is the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync language of the driver name that the caller is
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync requesting, and it must match one of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync languages specified in SupportedLanguages. The
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync number of languages supported by a driver is up
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync to the driver writer. Language is specified in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync RFC 4646 or ISO 639-2 language code format.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @param ControllerName A pointer to the Unicode string to return.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync This Unicode string is the name of the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync controller specified by ControllerHandle and
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ChildHandle in the language specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync Language from the point of view of the driver
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync specified by This.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_SUCCESS The Unicode string for the user readable name in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the language specified by Language for the
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync driver specified by This was returned in
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync DriverName.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync EFI_HANDLE.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER Language is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_INVALID_PARAMETER ControllerName is NULL.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_UNSUPPORTED The driver specified by This is not currently
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync managing the controller specified by
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync ControllerHandle and ChildHandle.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync @retval EFI_UNSUPPORTED The driver specified by This does not support
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync the language specified by Language.
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync**/
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFI_STATUS
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncEFIAPI
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsyncBlockMmioToBlockIoGetControllerName (
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_COMPONENT_NAME_PROTOCOL *This,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_HANDLE ControllerHandle,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN EFI_HANDLE ChildHandle OPTIONAL,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync IN CHAR8 *Language,
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync OUT CHAR16 **ControllerName
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync );
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync
4fd606d1f5abe38e1f42c38de1d2e895166bd0f4vboxsync#endif