d_map_init Kernel Service

Purpose

Allocates and initializes resources for performing DMA with PCI and ISA devices.

Syntax

#include <sys/dma.h>

struct d_handle* d_map_init (bid, flags, bus_flags, channel)
int bid;
int flags;
int bus_flags;
uint channel;

Parameters

Item Description
bid Specifies the bus identifier.
flags Describes the mapping.
bus_flags Specifies the target bus flags.
channel Indicates the channel assignment specific to the bus.

Description

The d_map_init kernel service allocates and initializes resources needed for managing DMA operations and returns a unique handle to be used on subsequent DMA service calls. The handle is a pointer to a d_handle structure allocated by d_map_init from the pinned heap for the device. The device driver uses the function addresses provided in the handle for accessing the DMA services specific to its host bus. The d_map_init service returns a DMA_FAIL error when resources are unavailable or cannot be allocated.

The channel parameter is the assigned channel number for the device, if any. Some devices and or buses might not have the concept of channels. For example, an ISA device driver would pass in its assigned DMA channel in the channel parameter.

Note: The possible flag values for the flags parameter can be found in /usr/include/sys/dma.h. These flags can be logically ORed together to reflect the desired characteristics.

Execution Environment

The d_map_init kernel service should only be called from the process environment.

Return Values

Item Description
DMA_FAIL Indicates that the resources are unavailable. No registration was completed.
struct d_handle * Indicates successful completion.