RTEMS Logo

RTEMS 4.6.0 On-Line Library


Memory Pool Manager get_blk - Get Variable-Size Memory Block

PREV UP NEXT Bookshelf RTEMS ITRON 3.0 API User's Guide

9.4.3: get_blk - Get Variable-Size Memory Block

CALLING SEQUENCE:

ER get_blk(
  VP *p_blk,
  ID mplid,
  INT blksz
);

STATUS CODES:

E_OK - Normal Completion

E_ID - Invalid ID number (mplid was invalid or could not be used)

E_NOEXS - Object does not exist (the memorypool specified by mplid does not exist)

E_OACV - Object access violation (A mplid less than -4 was specified from a user task. This is implementation dependent.)

E_PAR - Parameter error (tmout is -2 or less, blksz is negative or invalid)

E_DLT - The object being waited for was deleted (the specified memorypool was deleted while waiting)

E_RLWAI - WAIT state was forcibly released (rel_wai was received while waiting)

E_TMOUT - Polling failure or timeout

E_CTX - Context error (issued from task-independent portions or a task in dispatch disabled state; implementation dependent for pget_blk and tget_blk(tmout=TMO_POL))

DESCRIPTION:

A memory block of the size in bytes given by blksz is allocated from the variable-size memorypool specified by mplid. The start address of the memory block allocated is returned in blk. The allocated memory block is not cleared to zero. The contents of the memory block allocated are undefined. If the memory block cannot be obtained from the specified memorypool when get_blk is issued, the task issuing get_blk will be placed on the memory allocation queue of the specified memorypool, and wait until it can get the memory it requires.

The order in which tasks wait on the queue when waiting to be allocated memory blocks is according to either FIFO or task priority. The specification whereby tasks wait according to task priority is considered an extended function [level X] for which compatibility is not guaranteed. Furthermore, when tasks form a memory allocation queue, it is implementation dependent whether priority is given to tasks requesting the smaller size of memory or those at the head of the queue.

NOTES:

Pget_blk and get_blk represent the same processing as specifying certain values (TMO_POL or TMO_FEVR) to tget_blk for tmout. It is allowed that only tget_blk is implemented in the kernel and that pget_blk and get_blk are implemented as macros which call tget_blk.


PREV UP NEXT Bookshelf RTEMS ITRON 3.0 API User's Guide

Copyright © 1988-2004 OAR Corporation