cre_mpf
acre_mpf
ER cre_mpf (ID mpfid, T_CMPF *pk_cmpf );
ER_ID acre_mpf ( T_CMPF *pk_cmpf );
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.
mpfatr := ( TA_TFIFO | TA_TPRI )
- 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.
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.
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, 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.
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.