Allocates and initializes resources for performing DMA with PCI and ISA devices.
#include <sys/dma.h>
struct d_handle* d_map_init (bid, flags, bus_flags, channel)
int bid;
int flags;
int bus_flags;
uint channel;
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. |
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.
The d_map_init kernel service should only be called from the process environment.
Item | Description |
---|---|
DMA_FAIL | Indicates that the resources are unavailable. No registration was completed. |
struct d_handle * | Indicates successful completion. |