procedure Region_Create ( Name : in RTEMS.Name; Starting_Address : in RTEMS.Address; Length : in RTEMS.Unsigned32; Page_Size : in RTEMS.Unsigned32; Attribute_Set : in RTEMS.Attribute; ID : out RTEMS.ID; Result : out RTEMS.Status_Codes );
RTEMS.SUCCESSFUL
- region created successfully
RTEMS.INVALID_NAME
- invalid region name
RTEMS.INVALID_ADDRESS
- id
is NULL
RTEMS.INVALID_ADDRESS
- starting_address
is NULL
RTEMS.INVALID_ADDRESS
- address not on four byte boundary
RTEMS.TOO_MANY
- too many regions created
RTEMS.INVALID_SIZE
- invalid page size
This directive creates a region from a physically contiguous memory space which starts at starting_address and is length bytes long. Segments allocated from the region will be a multiple of page_size bytes in length. The assigned region id is returned in id. This region id is used as an argument to other region related directives to access the region.
For control and maintenance of the region, RTEMS allocates and initializes an RNCB from the RNCB free pool. Thus memory from the region is not used to store the RNCB. However, some overhead within the region is required by RTEMS each time a segment is constructed in the region.
Specifying RTEMS.PRIORITY
in attribute_set causes tasks
waiting for a segment to be serviced according to task priority.
Specifying RTEMS.FIFO
in attribute_set or selecting
RTEMS.DEFAULT_ATTRIBUTES
will cause waiting tasks to
be serviced in First In-First Out order.
The starting_address
parameter must be aligned on a
four byte boundary. The page_size
parameter must be a multiple
of four greater than or equal to eight.
This directive will not cause the calling task to be preempted.
The following region attribute constants are defined by RTEMS:
RTEMS.FIFO
- tasks wait by FIFO (default)
RTEMS.PRIORITY
- tasks wait by priority
Copyright © 1988-2008 OAR Corporation