public final class MMIODeviceConfig extends java.lang.Object implements DeviceConfig<MMIODevice>, DeviceConfig.HardwareAddressing
MMIODeviceConfig
class encapsulates the hardware addressing information, and static and dynamic
configuration parameters of an MMIO device.
Some hardware addressing parameter, and static and dynamic configuration parameters may be set to DeviceConfig.DEFAULT
.
Whether such default settings are supported is platform- as well as device driver-dependent.
An instance of MMIODeviceConfig
can be passed to the DeviceManager.open(DeviceConfig)
or
DeviceManager.open(Class, DeviceConfig)
method to open the designated MMIO device with the specified
configuration. A InvalidDeviceConfigException
is thrown when attempting to open a device with
an invalid or unsupported configuration.Modifier and Type | Class and Description |
---|---|
static class |
MMIODeviceConfig.RawBlockConfig
The
RawBlockConfig class encapsulates the configuration parameters of a memory block. |
static class |
MMIODeviceConfig.RawMemoryConfig
The
RawMemoryConfig class encapsulates the configuration parameters of a generic raw memory area. |
static class |
MMIODeviceConfig.RawRegisterConfig<T extends java.lang.Number>
The
RawRegisterConfig class encapsulates the configuration parameters of a register. |
DeviceConfig.HardwareAddressing
DEFAULT
Constructor and Description |
---|
MMIODeviceConfig(long address,
int size,
int byteOrdering,
MMIODeviceConfig.RawMemoryConfig... memConfigs)
Creates a new
MMIODeviceConfig with the specified hardware addressing information and configuration
parameters. |
MMIODeviceConfig(java.lang.String controllerName,
long address,
int size,
int byteOrdering,
MMIODeviceConfig.RawMemoryConfig... memConfigs)
Creates a new
MMIODeviceConfig with the specified hardware addressing information and configuration
parameters. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Checks two
MMIODeviceConfig objects for equality. |
long |
getAddress()
Gets the configured memory address of the MMIO device.
|
int |
getByteOrdering()
Gets the configured byte ordering of the MMIO device.
|
java.lang.String |
getControllerName()
Gets the configured controller name (such as its device file name on UNIX systems).
|
int |
getControllerNumber()
Gets the configured controller number.
|
MMIODeviceConfig.RawMemoryConfig[] |
getRawMemoryConfigs()
Gets the set of configured registers and memory blocks.
|
int |
getSize()
Gets the configured size of the memory-mapped area of the MMIO device.
|
int |
hashCode()
Returns the hash code value for this object.
|
public MMIODeviceConfig(long address, int size, int byteOrdering, MMIODeviceConfig.RawMemoryConfig... memConfigs)
MMIODeviceConfig
with the specified hardware addressing information and configuration
parameters.
Note that if no raw block and raw register configuration is provided, the specified memory area will be mapped to
the RawBlock
instance returned by a call to MMIODevice.getAsRawBlock
.
Note that if the designated memory region is protected or if it overlaps with that of an existing
MMIO device configuration and the requested access mode (DeviceManager.EXCLUSIVE
or
DeviceManager.SHARED
) is incompatible or unsupported, attempting to open an MMIODevice
device using this configuration may result in either a SecurityException
or
a InvalidDeviceConfigException
to be thrown.address
- the memory address of the device (a positive or zero integer).size
- the size of the memory-mapped area of the device (a positive integer).byteOrdering
- the byte ordering of the device, one of: Device.BIG_ENDIAN
,
Device.LITTLE_ENDIAN
, Device.MIXED_ENDIAN
or DeviceConfig.DEFAULT
.memConfigs
- the raw block and raw register configurations (may be null
or empty).java.lang.IllegalArgumentException
- if any of the following is true:
address
is not in the defined range;size
is not in the defined range;byteOrdering
is not one of the defined values.java.lang.IndexOutOfBoundsException
- if any of the memConfigs
elements is pointing outside of the defined address range ([
0
-size]).public MMIODeviceConfig(java.lang.String controllerName, long address, int size, int byteOrdering, MMIODeviceConfig.RawMemoryConfig... memConfigs)
MMIODeviceConfig
with the specified hardware addressing information and configuration
parameters.
Note that if no raw block and raw register configuration is provided, the specified memory area will be mapped to
the RawBlock
instance returned by a call to MMIODevice.getAsRawBlock
.controllerName
- the controller name (such as its device file name on UNIX systems).address
- the memory address of the device (a positive or zero integer)or DeviceConfig.DEFAULT
.size
- the size of the memory-mapped area of the device (a positive integer).byteOrdering
- the byte ordering of the device, one of: Device.BIG_ENDIAN
,
Device.LITTLE_ENDIAN
, Device.MIXED_ENDIAN
or DeviceConfig.DEFAULT
.memConfigs
- the raw block and raw register configurations (may be null
or empty).java.lang.IllegalArgumentException
- if any of the following is true:
address
is not in the defined range;size
is not in the defined range;byteOrdering
is not one of the defined values.java.lang.NullPointerException
- if controllerName
is null
.java.lang.IndexOutOfBoundsException
- if any of the memConfigs
elements is pointing outside of the defined address range ([
0
-size]).public long getAddress()
DeviceConfig.DEFAULT
..public java.lang.String getControllerName()
getControllerName
in interface DeviceConfig.HardwareAddressing
null
.public int getControllerNumber()
getControllerNumber
in interface DeviceConfig.HardwareAddressing
DeviceConfig.DEFAULT
.public int getByteOrdering()
Device.BIG_ENDIAN
,
Device.LITTLE_ENDIAN
, Device.MIXED_ENDIAN
or DeviceConfig.DEFAULT
.public MMIODeviceConfig.RawMemoryConfig[] getRawMemoryConfigs()
null
if none is defined.public int getSize()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
MMIODeviceConfig
objects for equality.equals
in class java.lang.Object
obj
- the object to test for equality with this object.true
if obj
is a MMIODeviceConfig
and has
the same hardware addressing information and configuration parameter values
as this MMIODeviceConfig
object.Copyright © 2012, 2014, Oracle and/or its affiliates. All rights reserved.
Legal Notices