Efi_io_operation_type, Is de, Related definitions – Intel Extensible Firmware Interface User Manual

Page 769: Description, Status codes returned

Advertising
background image

Protocols

— Device I/O Protocol

Version 1.10

12/01/02

18-9

Related Definitions

//*******************************************************
// EFI_IO_OPERATION_TYPE
//*******************************************************

typedef enum {

EfiBusMasterRead,

EfiBusMasterWrite,

EfiBusMasterCommonBuffer

} EFI_IO_OPERATION_TYPE;

EfiBusMasterRead

A read operation from system memory by a bus master.

EfiBusMasterWrite

A write operation to system memory by a bus master.

EfiBusMasterCommonBuffer

Provides both read and write access to system memory
by both the processor and a bus master. The buffer is
coherent from both the processor’s and the bus master’s
point of view.

Description

The

DEVICE_IO.Map()

function provides the device specific addresses needed to access system

memory. This function is used to map system memory for bus master DMA accesses.

All bus master accesses must be performed through their mapped addresses and such mappings
must be freed with

Unmap()

when complete. If the bus master access is a single read or write data

transfer, then

EfiBusMasterRead

or

EfiBusMasterWrite

is used and the range is

unmapped to complete the operation. If performing an

EfiBusMasterRead

operation, all the

data must be present in system memory before the

Map()

is performed. Similarly, if performing

an

EfiBusMasterWrite

, the data cannot be properly accessed in system memory until the

Unmap()

is performed.

Bus master operations that require both read and write access or require multiple host device
interactions within the same mapped region must use

EfiBusMasterCommonBuffer

.

However, only memory allocated via the

DEVICE_IO.AllocateBuffer()

interface is

guaranteed to be able to be mapped for this operation type.

In all mapping requests the resulting

NumberOfBytes

actually mapped may be less than

requested.

Status Codes Returned

EFI_SUCCESS

The range was mapped for the returned

NumberOfBytes

.

EFI_INVALID_PARAMETER

The

Operation

or

HostAddress

is undefined.

EFI_UNSUPPORTED

The

HostAddress

cannot be mapped as a common buffer.

EFI_DEVICE_ERROR

The system hardware could not map the requested address.

EFI_OUT_OF_RESOURCES

The request could not be completed due to a lack of resources.

Advertising