tget_mpf

Outline

Acquire fixed-sized memory block (with timeout).

C format

 ER      tget_mpf (ID mpfid, VP *p_blk, TMO tmout);
Parameter(s)

I/O

Parameter

Description

I

 ID      mpfid;
ID number of the fixed-sized memory pool from which a memory block is acquired.

O

 VP      *p_blk;
Start address of the acquired memory block.

I

 TMO     tmout;
Specified timeout (unit:millisecond).

TMO_FEVR: Waiting forever.

TMO_POL: Polling.

Value: Specified timeout.



Explanation

This service call acquires the fixed-sized memory block from the fixed-sized memory pool specified by parameter mpfid and stores the start address in the area specified by parameter p_blk.

If no fixed-size memory blocks could be acquired from the target fixed-size memory pool (no available fixed-size memory blocks exist) when this service call is issued, this service call does not acquire the fixed-size memory block but queues the invoking task to the target fixed-size memory pool wait queue and moves it from the RUNNING state to the WAITING state with timeout (fixed-size memory block acquisition wait state).

The WAITING state for a fixed-sized memory block is cancelled in the following cases, and then moved to the READY state.

WAITING State for a Fixed-sized Memory Block Cancel Operation

Return Value

A fixed-sized memory block was returned to the target fixed-sized memory pool as a result of issuing rel_mpf.

E_OK

A fixed-sized memory block was returned to the target fixed-sized memory pool as a result of issuing irel_mpf.

E_OK

Forced release from waiting (accept rel_wai while waiting).

E_RLWAI

Forced release from waiting (accept irel_wai while waiting).

E_RLWAI

Polling failure or timeout.

E_TMOUT



Note 1 The RI850V4 does not perform memory clear processing when acquiring a fixed-sized memory block. The contents of the acquired fixed-sized memory block are therefore undefined.

Note 2 If no fixed-sized memory blocks can be acquired from the target fixed-sized memory pool (no available fixed-sized memory blocks exist) when this service call is issued, the contents in the area specified by parameter p_blk become undefined.

Note 3 If the fixed-size memory block acquisition wait state is cancelled because rel_wai or irel_wai was issued or the wait time elapsed, the contents in the area specified by parameter p_blk become undefined.

Note 4 TMO_FEVR is specified for wait time tmout, processing equivalent to get_mpf will be executed. When TMO_POL is specified, processing equivalent to pget_mpf /ipget_mpf will be executed.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_PAR

-17

Parameter error.

- tmout < TMO_FEVR

E_ID

-18

Invalid ID number.

- mpfid < 0x0

- mpfid > Maximum ID number

E_CTX

-25

Context error.

- This service call was issued from a non-task.

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

- This service call was issued in the dispatching disabled state.

E_NOEXS

-42

Non-existent object.

- Specified fixed-sized memory pool is not registered.

E_RLWAI

-49

Forced release from the WAITING state.

- Accept rel_wai/irel_wai while waiting.

E_TMOUT

-50

Timeout.

- Polling failure or timeout.