Renesas 70 Manual De Usuario

Descargar
Página de 162
Chapter 3 Introduction to MR308 
   
- 27 - 
3.4 System States 
3.4.1 
Task Context and Non-task Context 
The system runs in either context state, "task context" or "non-task context." The differences between the task 
content and non-task context are shown in Table 3-1. Task Context and Non-task Context. 
 
Table 3-1 
Task Context and Non-task Context 
 Task 
context 
Non-task 
context 
Invocable service call 
Those that can be invoked from 
task context 
Those that can be invoked from 
non-task context 
Task scheduling 
Occurs when the queue state 
has changed to other than dis-
patch disabled and CPU locked 
states. 
It does not occur. 
Stack User 
stack 
System 
stack 
 
 
 
The processes executed in non-task context include the following. 
1. Interrupt Handler 
A program that starts upon hardware interruption is called the interrupt handler. The MR308 is not 
concerned in interrupt handler activation. Therefore, the interrupt handler entry address is to be di-
rectly written into the interrupt vector table.   
There are two interrupt handlers: Non-kernel interrupts (OS independent interrupts) and kernel inter-
rupts (OS dependent interrupts). For details about each type of interrupt, refer to Section 5.5. 
The system clock interrupt handler (isig_tim) is one of these interrupt handlers. 
2. Cyclic Handler 
The cyclic handler is a program that is started cyclically every preset time. The set cyclic handler may 
be started or stopped by the sta_cyc(ista_cyc) or stp_cyc(istp_cyc) service call. 
The cyclic handler startup time of day is unaffected by a change in the time of day by set_tim(iset_tim).   
3. Alarm Handler 
The alarm handler is a handler that is started after the lapse of a specified relative time of day. The 
alarm handler startup time of day is determined by a time of day relative to the time of day set by 
sta_alm(ista_alm), and is unaffected by a change in the time of day by set_tim(iset_tim). 
The cyclic and alarm handlers are invoked by a subroutine call from the system clock interrupt (timer interrupt) 
handler. Therefore, cyclic and alarm handlers operate as part of the system clock interrupt handler. Note that 
when the cyclic or alarm handler is invoked, it is executed in the interrupt priority level of the system clock inter-
rupt.