d_free_dmamem Kernel Service

Purpose

Frees an area of memory.

Syntax

int d_free_dmamem(d_handle_t  device_handle, void * addr, size_t size)

Description

Exported, documented kernel service supported on PCI-based systems only. The d_free_dmamem kernel service frees the area of memory pointed to by the addr parameter. This area of memory must be allocated with the d_alloc_dmamem kernel service using the same device_handle, and the addr must be the address returned from the corresponding d_alloc_dmamem call. Also, the size must be the same size that was used on the corresponding d_alloc_dmamem call.

Note:
  1. Any memory allocated in a prior d_alloc_dmamem call must be explicitly freed with a d_free_dmamem call.
  2. This service can be called from the process environment only.

Parameters

Item Description
device_handle Indicates the dma handle.
size_t size Specifies size of area to free.
void * addr Specifies address of area to free.

Return Values

Item Description
0 Indicates successful completion.
–1 Indicates underlying free service (xmfree or rmalloc) failed.