Relative Time and System Time

When the time of an event occurrence is specified relative to another time, such as the time when a system call was invoked, relative time (RELTIM type) is used. If relative time is used to specify event occurrence time, it is necessary to guarantee that event processing will take place after the specified time has elapsed from the time base. Relative time (RELTIM type) is also used for cases such as event occurrence. In such cases, the method of interpreting the specified relative time is specified for each case.

When time is specified as an absolute value, system time (SYSTIM type) is used. The µT-Kernel specification provides a function for setting system time, but even if the system time is changed using this function, there is no change in the real world time (actual time) at which an event occurred that was specified using relative time. What changes is the system time at which an event occurred that was specified as relative time.

  • SYSTIM: System time – Time base 1 millisecond, 64-bit signed integer

	typedef struct systim {
		W hi; /* high 32 bits */
		UW lo; /* low 32 bits */
	} SYSTIM;
  • RELTIM: Relative time – Time base 1 millisecond, 32-bit or higher unsigned integer (UINT)

	typedef UW RELTIM;
  • TMO: Timeout time Time base 1 millisecond, 32-bit or higher signed integer (INT)

	typedef W TMO;

Endless wait can be specified as TMO_FEVR (= -1).

[Additional Notes]

Timeout or other such processing must be guaranteed to occur after the time specified as RELTIM or TMO has elapsed. For example, if the timer interrupt cycle is 1 ms and a timeout of 1 ms is specified, timeout occurs on the second timer interrupt (because the first timer interrupt does not exceed 1 ms).

[Difference with T-Kernel 1.00.00]

The RELTIM type is defined as UW instead of UINT. Also, the TMO type is defined by W type instead of INT type. This is because the INT/UINT type was assumed to have insufficient range to represent the time in 16-bit environments.

Comments

Click here to Post a Comment