-
cre_mpf
acre_mpf
-
Create fixed-sized memory pool.
ER cre_mpf (ID mpfid, T_CMPF *pk_cmpf );
ER_ID acre_mpf ( T_CMPF *pk_cmpf );
|
|
|
|
ID mpfid;
|
ID number of the fixed-sized memory pool.
|
|
T_CMPF *pk_cmpf;
|
Pointer to the packet containing the fixed-sized memory pool creation information.
|
[Fixed-sized memory pool creation information packet : T_CMPF]
typedef struct t_cmpf {
ATR mpfatr; /*fixed-sized memory pool attribute*/
UINT blkcnt; /*Total number of memory blocks*/
UINT blksz; /*Memory block size (in bytes)*/
VP mpf; /*Start address of the fixed-sized memory pool area*/
VP mpfmb; /*Start address of the fixed-sized memory pool management area*/
} T_CMPF;
|
This service call can be called from tasks that belong to
Trusted Domain.
The cre_mpf creates a fixed-sized memory pool with fixed-sized memory pool ID indicated by
mpfid according to the content of
pk_cmpf. The acre_mpf creates a fixed-sized memory pool according to the content of
pk_cmpf, and returns the created fixed-sized memory pool ID.
1 ) Fixed-sized memory pool attribute (
mpfatr)
The following are specified for
mpfatr.
mpfatr := ( TA_TFIFO | TA_TPRI )
-
TA_TFIFO ( = 0x0000)
Task wait queue is managed in FIFO order.
-
TA_TPRI ( = 0x0001)
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
2 ) Total number of memory blocks (
blkcnt), memory block size (
blksz), Start address of the fixed-sized memory pool area (
mpf)
The application acquires TSZ_MPF(
blkcnt,
blksz ) bytes of fixed-sized memory pool area and specifies the start address for
mpf.
Note 2 The RI600PX is not concerned of anything of the access permission to the fixed-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 3 The
mITRON4.0 specification defines the function that the kernel allocates fixed-sized memory pool area when NULL is specified for
mpf. But RI600PX does not support this function.
Note 4 The alignment number of memory block is 1. Please perform the following, in order to enlarge the alignment number of memory blocks.
- Specify the memory block size to a multiple of the desired alignment number at fixed-sized memory pool creation.
- Make the start address of the fixed-sized memory pool area into the address of the desired alignment number.
3 ) Start address of the fixed-sized memory pool management area (
mpfmb)
The application acquires TSZ_MPFMB(
blkcnt,
blksz ) bytes of fixed-sized memory pool management area and specifies the start address for
mpfmb.
Note 2 The RI600PX is not concerned of anything of the access permission to the fixed-sized memory pool management area. Usually, the fixed-sized memory pool management area should be generated to the area other than memory objects and user stacks. When the fixed-sized memory pool management area is generated in the memory object, a task with the operand-write access permission to the memory object might rewrite the fixed-sized memory pool management area by mistake.
|
|
|
|
|
Normal completion of acre_mpf. (Created fixed-sized memory pool ID)
|
|
|
Normal completion of cre_mpf.
|
|
|
- Either of bits in mpfatr except bit0 is 1.
|
|
|
- blkcnt == 0, blkcnt > 65535
- blksz == 0, blksz > 65535
- mpf + TSZ_MPF( blkcnt, blksz) > 0x100000000
|
|
|
Invalid ID number. (only for cre_mpf)
|
|
|
- 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".
|
|
|
- Stack pointer points out of user stack for invoking task.
- The operand-read access to the area indicated by pk_cmpf has not been permitted to the invoking task.
|
|
|
- The invoking task does not belong to trusted domain.
|
|
|
|
|
|
No ID number available.(only for acre_mpf)
|
|
|
Object state error. (only for cre_mpf)
- The fixed-sized memory pool specified by mpfid exists.
|