aallttccllkk_iinn() -- Accessible Kernel Routine

iinntt
aallttccllkk_iinn(_h_z, _f_n)
iinntt _h_z, (*_f_n)();

aallttccllkk_iinn() increases the system clock  rate from the value set by manifest
constant HHZZ (at present, 100 Hertz) to _h_z. Function _f_n will be called every
time the  clock interrupt occurs.  _h_z  must be an integral  multiple of HHZZ;
therefore, the  rate of clock interrupts  will be increased by  a factor of
_h_z/HHZZ.  _f_n is an iinntt-valued function that must return 0 every _h_z/HHZZ'th time
it is called,  nonzero the rest of the time.   The zero value returned from
_f_n tells the COHERENT system's clock routine to do its usual processing.

aallttccllkk_iinn() returns 0 if it completes normally; if argument _h_z is less than
HHZZ  or not  an integral  multiple  of HHZZ,  this function  does nothing  and
returns -1.

_E_x_a_m_p_l_e
The following gives a partial example of how to use aallttccllkk_iinn() in a device
driver.

#include <sys/const.h>  /* #define's HZ */
...

static int scale_factor;
static int poll_fn();
...

    /* install high-speed polling of I/O device */
    poll_rate = ...;
    scale_factor = poll_rate/HZ;
    altclk_out();
    altclk_in(poll_rate, poll_fn);
...

/* polling function */
int poll_fn()
{
    static int count;

    ...do device polling...

    count++;
    if (count >= scale_factor)
        count = 0;
    return count;
}

_S_e_e _A_l_s_o
aacccceessssiibbllee kkeerrnneell rroouuttiinneess, aallttccllkk_oouutt()

_N_o_t_e_s
Avoid  naming the  polling  function aallttccllkk():  there is  already a  kernel
symbol with this name.
