|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.rtsjx.CoreRawMemoryType com.sun.rtsjx.SharedMemoryMapper
public class SharedMemoryMapper
Shared memory support.
PhysicalMemoryManager.SHARED provides the common addConstraints call
new instances are created for each physical memory request.
Constructor Summary | |
---|---|
SharedMemoryMapper()
|
|
SharedMemoryMapper(long base,
long size)
|
|
SharedMemoryMapper(java.lang.Object[] param)
|
Method Summary | |
---|---|
void |
addConstraints(PhysicalMemoryRequest request)
Add new constraints to a physical memory request. |
boolean |
canRemap()
Returns true if a remap() can be attempted. |
void |
checkMapperConstraints(PhysicalMemoryRequest request)
Check the constraints due to the mapper itself. |
long |
get_mapped_address()
Get the mapped address, or 0 if unmapped. |
int |
get_shared_id()
Get the shared identifier. |
boolean |
isCompatibleWithPhysicalMemory()
Returns true if this mapper is compatible with ImmortalPhysicalMemory, LTPhysicalMemory and VTPhysicalMemory. |
long |
map(PhysicalMemoryRequest request)
Map the shared memory. |
void |
unmap(PhysicalMemoryRequest request)
Undo a mapping. |
Methods inherited from class com.sun.rtsjx.CoreRawMemoryType |
---|
checkConstraints, contains, find, getVMAttributes, getVMFlags, initialize, isPresent, isRemovable, onInsertion, onInsertion, onRemoval, onRemoval, unregisterInsertionEvent, unregisterRemovalEvent, vFind |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SharedMemoryMapper()
public SharedMemoryMapper(long base, long size)
public SharedMemoryMapper(java.lang.Object[] param)
Method Detail |
---|
public long get_mapped_address()
PhysicalMemoryMapper
get_mapped_address
in interface PhysicalMemoryMapper
public void addConstraints(PhysicalMemoryRequest request) throws java.lang.SecurityException, javax.realtime.OffsetOutOfBoundsException, javax.realtime.SizeOutOfBoundsException, javax.realtime.UnsupportedPhysicalMemoryException, javax.realtime.MemoryTypeConflictException, java.lang.OutOfMemoryError
CoreRawMemoryType
addConstraints
in class CoreRawMemoryType
request
- null or PhysicalMemoryRequest containing the previously
parsed constraints.
java.lang.SecurityException
- Thrown if application
doesn't have permissions to access physical memory, the
specified range of addresses, or the given type of memory.
javax.realtime.OffsetOutOfBoundsException
- Thrown if
the address is invalid.
javax.realtime.SizeOutOfBoundsException
- Thrown if
the size is negative or extends into an invalid range of memory.
javax.realtime.UnsupportedPhysicalMemoryException
- Thrown if the underlying hardware does not support the given
type, or if no matching PhysicalMemoryTypeFilter has been
registered with the PhysicalMemoryManager.
javax.realtime.MemoryTypeConflictException
- Thrown
if the specified base does not point to memory that matches the
request type, or if type specifies incompatible memory
attributes.
java.lang.OutOfMemoryError
- Thrown if the requested
type of memory exists, but there is not enough of it free to
satisfy the request.PhysicalMemoryRequest
public void checkMapperConstraints(PhysicalMemoryRequest request) throws javax.realtime.SizeOutOfBoundsException, javax.realtime.MemoryTypeConflictException
PhysicalMemoryMapper
The default implementation does nothing.
checkMapperConstraints
in interface PhysicalMemoryMapper
request
- constraints issued from the parsing of a memory type.
javax.realtime.SizeOutOfBoundsException
- Thrown if
the size is negative or extends into an invalid range of memory.
javax.realtime.MemoryTypeConflictException
- Thrown
if the specified base does not point to memory that matches the
request type, or if type specifies incompatible memory
attributes.public int get_shared_id()
It is the result of the shmget UNIX call.
public long map(PhysicalMemoryRequest request) throws javax.realtime.OffsetOutOfBoundsException, javax.realtime.SizeOutOfBoundsException, javax.realtime.MemoryTypeConflictException, java.lang.OutOfMemoryError
request.initial_pbase is used as the shared memory key.
request.get_len() provides the requested size.
request.get_flags() provides the flags for both the shmget and the shmat calls.
If the key is not -1, shmget and shmat are performed for each map call.
If the key is equal to -1, IPC_PRIVATE shared memory is created with shmget. Once successful, the same share memory identifier is reused and only shmat is called.
map
in interface PhysicalMemoryMapper
request
- constraints issued from the parsing of a memory type.
javax.realtime.OffsetOutOfBoundsException
- Thrown if
the address is invalid.
javax.realtime.SizeOutOfBoundsException
- Thrown if
the size is negative or extends into an invalid range of memory.
javax.realtime.MemoryTypeConflictException
- Thrown
if the specified base does not point to memory that matches the
request type, or if type specifies incompatible memory
attributes.
java.lang.OutOfMemoryError
- Thrown if the requested
type of memory exists, but there is not enough of it free to
satisfy the request.public void unmap(PhysicalMemoryRequest request)
PhysicalMemoryMapper
unmap
in interface PhysicalMemoryMapper
request
- constraints issued from the parsing of a memory type.public boolean canRemap()
PhysicalMemoryMapper
canRemap
in interface PhysicalMemoryMapper
public boolean isCompatibleWithPhysicalMemory()
PhysicalMemoryMapper
isCompatibleWithPhysicalMemory
in interface PhysicalMemoryMapper
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |