
User’s Manual U14833EJ2V0UM
84
CHAPTER 7 TIME MANAGEMENT
This chapter describes time management in the RX4000.
7.1
Overview
In a real-time system, time-synchronization processing is often used when processing tasks and handlers. In the
RX4000, a software timer is used to trigger timer interrupts issued at periodic intervals, and system clock, task delay
and timeout, and cyclic handler functions are provided.
7.2
System Clock
The system clock indicates the time (system time) upon which systems that incorporate the RX4000 are based.
The system clock consists of a 64-bit counter and is set to 0 as soon as the kernel has completed initialization. The
system clock is reset to 0 when the passage of time causes the 64-bit range of its counter to be exceeded (overflow is
ignored). The system clock operates in units of milliseconds.
7.2.1
Setting the system clock
The system clock can be set to any value during system operation by issuing the service call (i)set_tim. Note,
however, that the difference in time between the previous and new system clock values will not be treated has having
elapsed, leaving task timeouts or cyclic handler activation unaffected by a new system clock setting.
7.2.2
Reading the system clock
The system clock can be read by issuing the service call (i)get_tim. The system clock reading is stored in the
structure SYSTIM expressed by a 64-bit value.
7.2.3
Updating the system clock
The system clock can be updated by issuing the service call isig_tim. If isig_tim is issued, the kernel recognizes
that the unit time defined in the CF definition file has elapsed.
In other words, isig_tim must be issued each time the unit time defined in the CF files elapses, making it necessary
to describe an interrupt service routine that will input the CP0 timer interrupts, etc., of the processor, from which
isig_tim is issued. Processing such as for task timeout or cyclic handler activation is not activated by the issuance of
isig_tim; it is activated when the aforementioned interrupt service routine finishes processing.
Note that if the interval at which isig_tim is issued is undefined, the accuracy of the time until task timeout or the
cyclic handler’s activation interval cannot be guaranteed.