RTEMS Logo

RTEMS 4.8.1 On-Line Library


Partition Manager PARTITION_CREATE - Create a partition

PREV UP NEXT Bookshelf RTEMS C User's Guide

13.4.1: PARTITION_CREATE - Create a partition

CALLING SEQUENCE:

rtems_status_code rtems_partition_create(
  rtems_name       name,
  void            *starting_address,
  uint32_t         length,
  uint32_t         buffer_size,
  rtems_attribute  attribute_set,
  rtems_id        *id
);

DIRECTIVE STATUS CODES:

RTEMS_SUCCESSFUL - partition created successfully
RTEMS_INVALID_NAME - invalid partition name
RTEMS_TOO_MANY - too many partitions created
RTEMS_INVALID_ADDRESS - address not on four byte boundary
RTEMS_INVALID_ADDRESS - starting_address is NULL
RTEMS_INVALID_ADDRESS - id is NULL
RTEMS_INVALID_SIZE - length or buffer size is 0
RTEMS_INVALID_SIZE - length is less than the buffer size
RTEMS_INVALID_SIZE - buffer size not a multiple of 4
RTEMS_MP_NOT_CONFIGURED - multiprocessing not configured
RTEMS_TOO_MANY - too many global objects

DESCRIPTION:

This directive creates a partition of fixed size buffers from a physically contiguous memory space which starts at starting_address and is length bytes in size. Each allocated buffer is to be of buffer_size in bytes. The assigned partition id is returned in id. This partition id is used to access the partition with other partition related directives. For control and maintenance of the partition, RTEMS allocates a PTCB from the local PTCB free pool and initializes it.

NOTES:

This directive will not cause the calling task to be preempted.

The starting_address must be properly aligned for the target architecture.

Th buffer_size parameter must be a multiple of the CPU alignment factor. Additionally, buffer_size must be large enough to hold two pointers on the target architecture. This is required for RTEMS to manage the buffers when they are free.

Memory from the partition is not used by RTEMS to store the Partition Control Block.

The following partition attribute constants are defined by RTEMS:

The PTCB for a global partition is allocated on the local node. The memory space used for the partition must reside in shared memory. Partitions should not be made global unless remote tasks must interact with the partition. This is to avoid the overhead incurred by the creation of a global partition. When a global partition is created, the partition's name and id must be transmitted to every node in the system for insertion in the local copy of the global object table.

The total number of global objects, including partitions, is limited by the maximum_global_objects field in the Configuration Table.


PREV UP NEXT Bookshelf RTEMS C User's Guide

Copyright © 1988-2007OAR Corporation