RTEMS 6.1-rc1
Functions
Dual-Ported Memory Manager

The Dual-Ported Memory Manager provides a mechanism for converting addresses between internal and external representations for multiple dual-ported memory areas (DPMA). More...

Functions

rtems_status_code rtems_port_create (rtems_name name, void *internal_start, void *external_start, uint32_t length, rtems_id *id)
 Creates a port. More...
 
rtems_status_code rtems_port_ident (rtems_name name, rtems_id *id)
 Identifies a port by the object name. More...
 
rtems_status_code rtems_port_delete (rtems_id id)
 Deletes the port. More...
 
rtems_status_code rtems_port_external_to_internal (rtems_id id, void *external, void **internal)
 Converts the external address to the internal address. More...
 
rtems_status_code rtems_port_internal_to_external (rtems_id id, void *internal, void **external)
 Converts the internal address to the external address. More...
 

Detailed Description

The Dual-Ported Memory Manager provides a mechanism for converting addresses between internal and external representations for multiple dual-ported memory areas (DPMA).

Function Documentation

◆ rtems_port_create()

rtems_status_code rtems_port_create ( rtems_name  name,
void *  internal_start,
void *  external_start,
uint32_t  length,
rtems_id id 
)

Creates a port.

Parameters
nameis the object name of the port.
internal_startis the internal start address of the memory area.
external_startis the external start address of the memory area.
lengthis the length in bytes of the memory area.
[out]idis the pointer to an rtems_id object. When the directive call is successful, the identifier of the created port will be stored in this object.

This directive creates a port which resides on the local node. The port has the user-defined object name specified in name. The assigned object identifier is returned in id. This identifier is used to access the port with other dual-ported memory port related directives.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_INVALID_NAMEThe name parameter was invalid.
RTEMS_INVALID_ADDRESSThe id parameter was NULL.
RTEMS_INVALID_ADDRESSThe internal_start parameter was not properly aligned.
RTEMS_INVALID_ADDRESSThe external_start parameter was not properly aligned.
RTEMS_TOO_MANYThere was no inactive object available to create a port. The number of port available to the application is configured through the CONFIGURE_MAXIMUM_PORTS application configuration option.
Notes

The internal_start and external_start parameters must be on a boundary defined by the target processor architecture.

For control and maintenance of the port, RTEMS allocates a DPCB from the local DPCB free pool and initializes it.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within device driver initialization context.
  • The directive may be called from within task context.
  • The directive may obtain and release the object allocator mutex. This may cause the calling task to be preempted.
  • The number of ports available to the application is configured through the CONFIGURE_MAXIMUM_PORTS application configuration option.
  • Where the object class corresponding to the directive is configured to use unlimited objects, the directive may allocate memory from the RTEMS Workspace.

◆ rtems_port_delete()

rtems_status_code rtems_port_delete ( rtems_id  id)

Deletes the port.

Parameters
idis the port identifier.

This directive deletes the port specified by id.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_INVALID_IDThere was no port associated with the identifier specified by id.
Notes
The DPCB for the deleted port is reclaimed by RTEMS.
Constraints

The following constraints apply to this directive:

  • The directive may be called from within device driver initialization context.
  • The directive may be called from within task context.
  • The directive may obtain and release the object allocator mutex. This may cause the calling task to be preempted.
  • The calling task does not have to be the task that created the object. Any local task that knows the object identifier can delete the object.
  • Where the object class corresponding to the directive is configured to use unlimited objects, the directive may free memory to the RTEMS Workspace.

◆ rtems_port_external_to_internal()

rtems_status_code rtems_port_external_to_internal ( rtems_id  id,
void *  external,
void **  internal 
)

Converts the external address to the internal address.

Parameters
idis the port identifier.
externalis the external address to convert.
[out]internalis the pointer to a void pointer object. When the directive call is successful, the external address associated with the internal address will be stored in this object.

This directive converts a dual-ported memory address from external to internal representation for the specified port. If the given external address is invalid for the specified port, then the internal address is set to the given external address.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_INVALID_NAMEThe id parameter was invalid.
RTEMS_INVALID_ADDRESSThe internal parameter was NULL.
Constraints

The following constraints apply to this directive:

  • The directive may be called from within interrupt context.
  • The directive may be called from within device driver initialization context.
  • The directive may be called from within task context.
  • The directive will not cause the calling task to be preempted.

◆ rtems_port_ident()

rtems_status_code rtems_port_ident ( rtems_name  name,
rtems_id id 
)

Identifies a port by the object name.

Parameters
nameis the object name to look up.
[out]idis the pointer to an rtems_id object. When the directive call is successful, the object identifier of an object with the specified name will be stored in this object.

This directive obtains a port identifier associated with the port name specified in name.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_INVALID_ADDRESSThe id parameter was NULL.
RTEMS_INVALID_NAMEThe name parameter was 0.
RTEMS_INVALID_NAMEThere was no object with the specified name on the local node.
Notes

If the port name is not unique, then the port identifier will match the first port with that name in the search order. However, this port identifier is not guaranteed to correspond to the desired port.

The objects are searched from lowest to the highest index. Only the local node is searched.

The port identifier is used with other dual-ported memory related directives to access the port.

Constraints

The following constraints apply to this directive:

  • The directive may be called from within any runtime context.
  • The directive will not cause the calling task to be preempted.

◆ rtems_port_internal_to_external()

rtems_status_code rtems_port_internal_to_external ( rtems_id  id,
void *  internal,
void **  external 
)

Converts the internal address to the external address.

Parameters
idis the port identifier.
internalis the internal address to convert.
[out]externalis the pointer to a void pointer object. When the directive call is successful, the external address associated with the internal address will be stored in this object.

This directive converts a dual-ported memory address from internal to external representation so that it can be passed to owner of the DPMA represented by the specified port. If the given internal address is an invalid dual-ported address, then the external address is set to the given internal address.

Return values
RTEMS_SUCCESSFULThe requested operation was successful.
RTEMS_INVALID_NAMEThe id parameter was invalid.
RTEMS_INVALID_ADDRESSThe external parameter was NULL.
Constraints

The following constraints apply to this directive:

  • The directive may be called from within interrupt context.
  • The directive may be called from within device driver initialization context.
  • The directive may be called from within task context.
  • The directive will not cause the calling task to be preempted.