javax.realtime
Class PhysicalMemoryManager

java.lang.Object
  |
  +--javax.realtime.PhysicalMemoryManager

public final class PhysicalMemoryManager
extends java.lang.Object

The PhysicalMemoryManager is available for use by the various physical memory accessor objects (VTPhysicalMemory, LTPhysicalMemory, ImmortalPhysicalMemory, RawMemoryAccess, RawMemoryFloatAccess) to create objects of the correct type that are bound to areas of physical memory with the appropriate characteristics -- or with appropriate accessor behavior. Esxamples of characteristics that might be specified are: DMA memory, accessors with byte swapping, etc.

The base implementation will provide a PhysicalMemoryManager and a set of PhysicalMemoryTypeFilter classes that correctly identify memory classes that are standard for the (OS, JVM, and processor) platform.

OEMs may provide a PhysicalMemoryTypeFilter classes that allow additional characteristics of memory devices to be specified.

Memory attributes that are configured may not be compatible with one another. For instance, copy-back cache enable may be imcompatible with execute-only. In this case, the implementation of memory filters may detect conflicts and throw a MemoryTypeConflictException, but since filters are not part of the normative RTSJ, this exception is at best advisory.


Field Summary
static java.lang.String ALIGNED
          Specify this to identify aligned memory.
static java.lang.String BYTESWAP
          Specify this if byte swapping should be used.
static java.lang.String DMA
          Specify this to identify DMA memory.
static java.lang.String SHARED
          Specify this to identify shared memory.
 
Constructor Summary
PhysicalMemoryManager()
           
 
Method Summary
static boolean isRemovable(long address, long size)
          Queries the system about the removability of the specified range of memory.
static boolean isRemoved(long address, long size)
          Queries the system about the removed state of the specified range of memory.
static void onInsertion(long base, long size, javax.realtime.AsyncEventHandler aeh)
          Register the specified AsyncEventHandler to run when any memory in the range is added to the system.
static void onRemoval(long base, long size, javax.realtime.AsyncEventHandler aeh)
          Register the specified AsyncEventHandler to run when any memory in the range is removed from the system.
static void registerFilter(java.lang.Object name, javax.realtime.PhysicalMemoryTypeFilter filter)
          Register a memory type filter with the physical memory manager.
static void removeFilter(java.lang.Object name)
          Remove the identified filter from the set of registered filters.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIGNED

public static final java.lang.String ALIGNED
Specify this to identify aligned memory.

See Also:
Constant Field Values

BYTESWAP

public static final java.lang.String BYTESWAP
Specify this if byte swapping should be used.

See Also:
Constant Field Values

DMA

public static final java.lang.String DMA
Specify this to identify DMA memory.

See Also:
Constant Field Values

SHARED

public static final java.lang.String SHARED
Specify this to identify shared memory.

See Also:
Constant Field Values
Constructor Detail

PhysicalMemoryManager

public PhysicalMemoryManager()
Method Detail

isRemovable

public static boolean isRemovable(long address,
                                  long size)
Queries the system about the removability of the specified range of memory.

Parameters:
size - The size of the memory area.

isRemoved

public static boolean isRemoved(long address,
                                long size)
Queries the system about the removed state of the specified range of memory. This method is used for devices that lien in the memory address space and can be removed while the system is running (such as PC cards).

Parameters:
size - The size of the memory area.
Returns:
True, if any part of the specified range is currently not usable.

onInsertion

public static void onInsertion(long base,
                               long size,
                               javax.realtime.AsyncEventHandler aeh)
Register the specified AsyncEventHandler to run when any memory in the range is added to the system. If the specified range of physical memory contains multiple different types of removable memory, the AsyncEventHandler will be registered with any one of them. If the size or the base is less than zero, unregister all "remove" references to the handler.

Parameters:
base - The starting address in physical memory.
size - The size of the memory area.
aeh - The handler to register.

onRemoval

public static void onRemoval(long base,
                             long size,
                             javax.realtime.AsyncEventHandler aeh)
                      throws java.lang.IllegalArgumentException
Register the specified AsyncEventHandler to run when any memory in the range is removed from the system. If the specified range of physical memory contains multiple different types of removable memory, the aeh will be registered with any one of them. If the size or the base is less than zero, remove all "remove" references to the handler parameter.

Parameters:
base - The starting address in physical memory.
size - The size of the memory area.
aeh - The handler to register.
java.lang.IllegalArgumentException

registerFilter

public static final void registerFilter(java.lang.Object name,
                                        javax.realtime.PhysicalMemoryTypeFilter filter)
                                 throws DuplicateFilterException,
                                        java.lang.IllegalArgumentException
Register a memory type filter with the physical memory manager.

Parameters:
name - The type of memory handled by this filter.
filter - The filter object
Throws:
DuplicateFilterException - A filter for this type of memory already exists.
java.lang.RuntimeException - The system is configured for a bounded number of filters. This filter exceeds the bound.
java.lang.IllegalArgumentException - The name parameter must not be an array of objects.
java.lang.IllegalArgumentException - The name and filter must both be in immortal memory.

removeFilter

public static final void removeFilter(java.lang.Object name)
Remove the identified filter from the set of registered filters.