d_map_attr Kernel Service

Purpose

Changes the attributes associated with a DMA handle.

Syntax

#include <sys/dma.h>
kerrno_t d_map_attr (handle, cmd, attr, attr_size)
d_handle_t handle;
ulong cmd;
void * attr;
size_t attr_size;

Parameters

Item Description
handle Indicates the unique handle returned by the d_map_init_ext kernel service.
cmd Specifies one of the following flags:
D_ATTR_SET_MIN_MAPMEM
Sets the minimum amount of I/O mappable memory. This is the logical memory change and not the DMA bus memory change.
D_ATTR_SET_DES_MAPMEM
Sets the desired amount of I/O mappable memory. This is the logical memory change and not the DMA bus memory change.
attr You must set this parameter to the value of size64_t *. This parameter sets the minimum or the desired amount of I/O mappable memory depending on the specified value of the cmd parameter.
attr_size You must set this parameter to the value of sizeof(size64_t). This parameter sets the minimum or the desired amount of I/O mappable memory depending on the specified value of the cmd parameter.

Description

The d_map_attr kernel service can change certain attributes of the d_handle_t structure in case the needs of a device driver change during runtime. For example, if a device driver needs more DMA space at runtime, it can call the d_map_attr kernel service to request an increase in the map space. The d_map_attr kernel service is not an exported kernel service, but a bus specific utility routine determined by the d_map_init_ext kernel service and provided to the caller through the d_handle structure.

Execution Environment

The d_map_attr kernel service can be called from the process environment at INTBASE. Serialization with other DMA services like the d_map_page service and the d_unmap_page service is the caller’s responsibility.

Return Values

Item Description
DMA_SUCC Indicates a successful completion.
EINVAL_D_MAP_ATTR Indicates that the specified cmd parameter is not valid.
ENOMEM_D_MAP_ATTR Indicates that it is unable to change the minimum or desired I/O mappable memory.