Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Globals   Related Pages  

dma.h File Reference

DMA (Direct Memory Access) driver header. More...

Go to the source code of this file.

Data Structures

struct  dma_channel
 A structure used to store hardware definition of DMA channels. More...


Typedefs

typedef dma_channel dma_channel_t
 A structure used to store hardware definition of DMA channels.


Functions

void dma_xfer (unsigned channel, addr_t physaddr, size_t length, bool read)
 Set up a DMA transfer between a device and memory.
Parameters:
channel  The 8-bit channel number (0..3).
physaddr  The physical address of the buffer.
length  The size of the buffer.
read  If it is TRUE the transfer will be from memory to device, otherwise will be from device to memory.


void dma_alloc_init ()
 Initialize the DMA memory allocator.

void * dma_phys_alloc (size_t len)
 Return a pointer of len contiguous bytes into the DMA address space.
Parameters:
len  The size of the buffer we want to allocate.
Returns:
A pointer to the allocated buffer.
Note:
The pointer is the physical address of the buffer and not the virtual address!!!
Exceptions:
NULL  Out of DMA memory area!


bool dma_phys_free (size_t dma_start, size_t len)
 Free the DMA memory area from dma_start to dma_start+len address.
Parameters:
dma_start  The beginning of the area to free.
len  The size of the buffer to free.
Returns:
Note:
The dma_start address is the physical address of the buffer to free and not the virtual address!!!



Detailed Description

DMA (Direct Memory Access) driver header.

Author:
Andrea Righi <drizzt@inwind.it>
Date:
Last update: 2003-11-08
Note:
Copyright (©) 2003 Andrea Righi

Definition in file dma.h.


Typedef Documentation

typedef struct dma_channel dma_channel_t
 

A structure used to store hardware definition of DMA channels.


Generated on Fri Feb 20 15:32:17 2004 for Minirighi by doxygen1.2.18