SunSPOT API V5.0


com.sun.spot.dmamemory
Class DMAMemoryManager

java.lang.Object
  extended by com.sun.spot.dmamemory.DMAMemoryManager
All Implemented Interfaces:
IDMAMemoryManager

public class DMAMemoryManager
extends Object
implements IDMAMemoryManager

Manages a chunk of uncached memory to be used for DMA buffers - see IDMAMemoryManager


Constructor Summary
DMAMemoryManager()
          For use by the SPOT library only - to get a handle to a DMA Memory Manager use Spot.getInstance().getDMAMemoryManager()
 
Method Summary
 Hashtable getAllocationDetails()
          Get information about current memory allocations.
 int getBuffer(int size, String comment)
          Try to obtain memory for a DMA buffer.
 int getMaxAvailableBufferSize()
          Find out the size of the biggest available DMA memory buffer
 void releaseBuffer(int memAddr)
          Release a previously allocated buffer
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DMAMemoryManager

public DMAMemoryManager()
For use by the SPOT library only - to get a handle to a DMA Memory Manager use Spot.getInstance().getDMAMemoryManager()

Method Detail

getBuffer

public int getBuffer(int size,
                     String comment)
              throws NotEnoughDMAMemoryException
Description copied from interface: IDMAMemoryManager
Try to obtain memory for a DMA buffer.

Specified by:
getBuffer in interface IDMAMemoryManager
Parameters:
size - The size of the required buffer
comment - A string that describes the usage (so we can tell who's using what)
Returns:
The address of the allocated buffer
Throws:
NotEnoughDMAMemoryException

getMaxAvailableBufferSize

public int getMaxAvailableBufferSize()
Description copied from interface: IDMAMemoryManager
Find out the size of the biggest available DMA memory buffer

Specified by:
getMaxAvailableBufferSize in interface IDMAMemoryManager
Returns:
The size of the biggest buffer that is available

releaseBuffer

public void releaseBuffer(int memAddr)
Description copied from interface: IDMAMemoryManager
Release a previously allocated buffer

Specified by:
releaseBuffer in interface IDMAMemoryManager
Parameters:
memAddr - The address of the buffer being released

getAllocationDetails

public Hashtable getAllocationDetails()
Description copied from interface: IDMAMemoryManager
Get information about current memory allocations. Each entry in the table represents an allocation. The key is the comment string provided when the buffer was allocated; the value is the size of the buffer.

Specified by:
getAllocationDetails in interface IDMAMemoryManager
Returns:
The table of allocations

SunSPOT API V5.0


Copyright � 2006-2008 Sun Microsystems, Inc. All Rights Reserved.