cre_mpl

acre_mpl

Outline

Create variable-sized memory pool.

C format

 ER      cre_mpl (ID mplid, T_CMPL *pk_cmpl );
 ER_ID   acre_mpl ( T_CMPL *pk_cmpl );
Parameter(s)

I/O

Parameter

Description

I

 ID      mplid;
ID number of the variable-sized memory pool.

I

 T_CMPL  *pk_cmpl;
Pointer to the packet containing the variable-sized memory pool creation information.



[Variable-sized memory pool creation information packet : T_CMPL]

 typedef struct  t_cmpl {
     ATR    mplatr;   /*variable-sized memory pool attribute*/
     SIZE   mplsz;    /*Size of variable-sized memory pool area (in bytes)*/
     VP     mpl;      /*Start address of the variable-sized memory pool area*/
     UINT   maxblksz; /*maximum memory block size (in bytes)*/
 } T_CMPL;


Explanation

This service call can be called from tasks that belong to Trusted Domain.

The cre_mpl creates a variable-sized memory pool with variable-sized memory pool ID indicated by mplid according to the content of pk_cmpl. The acre_mpl creates a variable-sized memory pool according to the content of pk_cmpl, and returns the created variable-sized memory pool ID.

1 ) Variable-sized memory pool attribute (mplatr)
Only TA_TFIFO can be specified for mplatr.


- TA_TFIFO ( = 0x0000)
Task wait queue is managed in FIFO order.


2 ) Size of variable-sized memory pool area (mplsz), Start address of the variable-sized memory pool area (mpl)
The application acquires mplsz bytes of variable-sized memory pool area and specifies the start address for mpl.
The mpl must be 4-bytes boundary.



Note 1 The RI600PX is not concerned of anything of the access permission to the variable-sized memory pool area. To access to the memory block from task, the memory pool area must be in the memory object with appropriate permission.
Note, the RI600PX generates management tables in the memory pool area. If the management table is rewritten by allocation, correct system operation cannot be guaranteed.


Note 2 The mITRON4.0 specification defines the function that the kernel allocates variable-sized memory pool area when NULL is specified for mpl. But RI600PX does not support this function.

Note 3 The alignment number of memory block is 4.

3 ) Maximum memory block size (maxblksz)
Specify the maximum memory block size for maxblksz. Note, the maximum size of memory block that can be actually acquired might be larger than maxblksz. For details, refer to "9.3.1 Size of Variable-sized memory block".


Return value

Macro

Value

Description

-

Positive value

Normal completion of acre_mpl. (Created variable-sized memory pool ID)

E_OK

0

Normal completion of cre_mpl.

E_RSATR

-11

Reserved attribute

- mplatr != TA_TFIFO

E_PAR

-17

Parameter error.

- pk_cmpl == NULL

- mplsz < 24, mplsz > VTMAX_AREASIZE

- maxblksz == 0, maxblksz > 0x0BFFFFF4

- mplsz is too small to maxblksz.

- mpl + mplsz > 0x100000000

- mpl is not 4-bytes boundary.

E_ID

-18

Invalid ID number. (only for cre_mpl)

- mplid < 0

- mplid > VTMAX_MPL

E_CTX

-25

Context error.

- This service call was issued in the CPU locked state.

- This service call was issued from non-task.

- This service call was issued in the status "PSW.IPL > kernel interrupt mask level".

E_MACV

-26

Memory access violation.

- Stack pointer points out of user stack for invoking task.

- The operand-read access to the area indicated by pk_cmpl has not been permitted to the invoking task.

E_OACV

-27

Object access violation.

- The invoking task does not belong to trusted domain.

E_NOMEM

-33

Insufficient memory.

- mpl == NULL

E_NOID

-34

No ID number available.(only for acre_mpl)

E_OBJ

-41

Object state error. (only for cre_mpl)

- The variable-sized memory pool specified by mplid exists.