tstart Kernel Service

Purpose

Submits a timer request.

Syntax

#include <sys/types.h>
#include <sys/errno.h>
#include <sys/timer.h>

void tstart ( t)
struct trb *t;

Parameter

Item Description
t Points to a timer request structure.

Description

The tstart kernel service submits a timer request with the timer request block specified by the t parameter as input. The caller of the tstart kernel service must first call the talloc kernel service to allocate the timer request structure. The caller must then initialize the structure's fields before calling the tstart kernel service.

Once the request has been submitted, the kernel calls the t->func timer function when the amount of time specified by the t->timeout.it value has elapsed. The t->func timer function is called on an interrupt level. Therefore, code for this routine must follow conventions for interrupt handlers.

The tstart kernel service examines the t->flags field to determine if the timer request being submitted represents an absolute request or an incremental one. An absolute request is a request for a time out at the time represented in the it_value structure. An incremental request is a request for a time out at the time represented by now, plus the time in the it_value structure.

The caller should place time information for both absolute and incremental timers in the itimerstruc_t t.it value substructure. The T_ABSOLUTE absolute request flag is defined in the /usr/include/sys/timer.h file and should be ORed into the t->flag field if an absolute timer request is desired.

When the T_MOVE_OK flag is set, the associated timer is moved to another processor when the owning processor is folded.

When T_LATE_OK flag is set, the associated timer is put to sleep when the owning processor is put to sleep (folded) mode. The timer expiration handler is called when the owning processor is awakened (unfolded) if the scheduled expiration time has past. The time spent sleeping is therefore counted with respect to the expiration time. When this flag is set, there is no guarantee as to when the timer might expire.

Note: The T_MOVE_OK and T_LATE_OK flags are not required. They are intended to improve the effectiveness of processor folding by reducing the load on folded processors.

Modifications to the system time are added to incremental timer requests, but not to absolute ones. Consider the user who has submitted an absolute timer request for noon on 12/25/88. If a privileged user then modifies the system time by adding four hours to it, then the timer request submitted by the user still occurs at noon on 12/25/88.

By contrast, suppose it is presently 12 noon and a user submits an incremental timer request for 6 hours from now (to occur at 6 p.m.). If, before the timer expires, the privileged user modifies the system time by adding four hours to it, the user's timer request will then expire at 2200 (10 p.m.).

Execution Environment

The tstart kernel service can be called from either the process or interrupt environment.

Return Values

The tstart service has no return values.