\input manualMacros.tex
\manBegin
\manPageInfo{RCI Reference Manual}{}{}
\manTitle{rciOnInterrupt}{3}
\manSection{NAME}
{\rightskip=0ptplus1fil
{\tt \manName{rciOnInterrupt}},
{\tt \manName{rciTimeReady}}
-- wakeup functions for RCI tasks.

}
\manSection{USAGE}
\cverbatim
#include <rci.h>

rciOnInterrupt(td)
  RCI_DESC *td;

rciTimeReady(td)
  RCI_DESC *td;
@endcverbatim
\manSection{ARGUMENTS}
\manItem{{\tt td} --}
Pointer to task descriptor.
\manSection{DESCRIPTION}
These are supplied wakeup functions which may be specified for RCI control
tasks that are scheduled using the {\tt ON_FUNCTION}, {\tt ON_TRIGGER},
or {\tt ON_SIGNAL} scheduling disciplines. 
Setting a wakeup function is done using
the primitive {\tt rciWakeupOn()} (q.v.).

Using {\tt rciOnInterrupt()} ensures that
an RCI task is woken up once and only once for every interrupt it 
receives. The utility of this function is restricted to those RCI
tasks which can actually be bound to interrupts: tasks running on the
arbiter CPU and connected to an RCI device interrupt, or tasks
running on the arbiter CPU connected to a UNIX signal
(via the {\tt ON_SIGNAL} discipline).

To establish this function as a wakeup function, the following call
should be made:
\cverbatim
        rciWakeupOn (td, rciOnInterrupt, (int)td);
@endcverbatim
\noindent
Normally, this is done from the task's startup function,
but this is not necessary.

Using {\tt rciTimeReady()} causes emulation of the
{\tt ON_CLOCK} scheduling discipline; i.e., it will make the
task runnable whenever
\cverbatim
        ((t - o)%i) == 0 @endcverbatim
where {\tt t} is the elapsed time since the task was started, and 
{\tt i} and {\tt o} are the
task {\it interval} and {\it offset} given by the primitive {\tt rciRate()}.

To establish this function as a wakeup function, the following call
should be made:
\cverbatim
        rciWakeupOn (td, rciTimeReady, (int)td);
@endcverbatim

\manSection{SEE ALSO}
\rightskip=0ptplus1fil
{\tt rciScheduling(3)}, {\tt rciRate(3)}, {\tt rciWakeupOn(3)}, {\tt
controlFxns(7)}. 
\manEnd
\end
