VxWorks Reference Manual : Libraries

tickLib

NAME

tickLib - clock tick support library

ROUTINES

tickAnnounce( ) - announce a clock tick to the kernel
tickSet( ) - set the value of the kernel's tick counter
tickGet( ) - get the value of the kernel's tick counter

DESCRIPTION

This library is the interface to the VxWorks kernel routines that announce a clock tick to the kernel, get the current time in ticks, and set the current time in ticks.

Kernel facilities that rely on clock ticks include taskDelay( ), wdStart( ), kernelTimeslice( ), and semaphore timeouts. In each case, the specified timeout is relative to the current time, also referred to as "time to fire." Relative timeouts are not affected by calls to tickSet( ), which only changes absolute time. The routines tickSet( ) and tickGet( ) keep track of absolute time in isolation from the rest of the kernel.

Time-of-day clocks or other auxiliary time bases are preferable for lengthy timeouts of days or more. The accuracy of such time bases is greater, and some external time bases even calibrate themselves periodically.

INCLUDE FILES

tickLib.h

SEE ALSO

tickLib, kernelLib, taskLib, semLib, wdLib, VxWorks Programmer's Guide: Basic OS


Libraries : Routines

tickAnnounce( )

NAME

tickAnnounce( ) - announce a clock tick to the kernel

SYNOPSIS


void tickAnnounce (void)

DESCRIPTION

This routine informs the kernel of the passing of time. It should be called from an interrupt service routine that is connected to the system clock. The most common frequencies are 60Hz or 100Hz. Frequencies in excess of 600Hz are an inefficient use of processor power because the system will spend most of its time advancing the clock. By default, this routine is called by usrClock( ) in usrConfig.c.

RETURNS

N/A

SEE ALSO

tickLib, kernelLib, taskLib, semLib, wdLib, VxWorks Programmer's Guide: Basic OS


Libraries : Routines

tickSet( )

NAME

tickSet( ) - set the value of the kernel's tick counter

SYNOPSIS

void tickSet
    (
    ULONG ticks /* new time in ticks */
    )

DESCRIPTION

This routine sets the internal tick counter to a specified value in ticks. The new count will be reflected by tickGet( ), but will not change any delay fields or timeouts selected for any tasks. For example, if a task is delayed for ten ticks, and this routine is called to advance time, the delayed task will still be delayed until ten tickAnnounce( ) calls have been made.

RETURNS

N/A

SEE ALSO

tickLib, tickGet( ), tickAnnounce( )


Libraries : Routines

tickGet( )

NAME

tickGet( ) - get the value of the kernel's tick counter

SYNOPSIS


ULONG tickGet (void)

DESCRIPTION

This routine returns the current value of the tick counter. This value is set to zero at startup, incremented by tickAnnounce( ), and can be changed using tickSet( ).

RETURNS

The most recent tickSet( ) value, plus all tickAnnounce( ) calls since.

SEE ALSO

tickLib, tickSet( ), tickAnnounce( )