loc_cpu

iloc_cpu

Outline

Lock the CPU.

C format

 ER      loc_cpu (void);
 ER      iloc_cpu (void);
Parameter(s)

None.

Explanation

These service calls transit the system to the CPU locked state.

In the CPU locked state, the task scheduling is prohibited, and kernel interrupts are masked. Therefore, exclusive processing can be achieved for all processing programs except non-kernel interrupt handlers.

The service calls that can be issued in the CPU locked state are limited to the one listed below.

Service Call that can be issued

Function

Terminate invoking task. (This service call transit the system to the CPU unlocked state.)

Lock the CPU.

Unlock the CPU.

Reference CPU state.

Reference dispatching state.

Reference contexts.

Reference dispatch pending state.

System down



The unl_cpuiunl_cpu and ext_tsk releases from the CPU locked state,

Note 1 The CPU locked state changed by issuing these service calls must be cancelled before the processing program that issued this service call ends.

Note 2 These service calls do not perform queuing of lock requests. If the system is in the CPU locked state, therefore, no processing is performed but it is not handled as an error.

Note 3 The RI600V4 realizes the TIME MANAGEMENT FUNCTIONS by using base clock timer interrupts that occurs at constant intervals. If acknowledgment of the relevant base clock timer interrupt is disabled by issuing this service call, the TIME MANAGEMENT FUNCTIONS may no longer operate normally.

Note 4 For kernel interrupts, refer to "10.1 Interrupt Type".

Note 5 The loc_cpu returns E_ILUSE error while interrupt mask has changed to other than 0 by chg_ims.

Return value

Macro

Value

Description

E_OK

0

Normal completion.

E_CTX

-25

Context error.

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

Note When the iloc_cpu is issued from task or the loc_cpu is issued from non-task, the context error is not detected and normal operation of the system is not guaranteed.

E_ILUSE

-28

Illegal use of service call.

- This service call is issued in the status that the invoking task changes the PSW.IPL to other than 0 by using chg_ims.