td_hoc_dsp

Define Task Dispatch Hook Routine

[C Language Interface]

ER ercd = td_hok_dsp ( TD_HDSP *hdsp ) ;

[Parameters]

TD_HDSP hdsp Hook routine definition information

hdsp detail:

FP exec Hook routine when execution starts

FP stop Hook routine when execution stops

[Return Parameters]

ER ercd Error code

[Description]

Sets hook routines in the task dispatcher. A hook routine is canceled by setting NULL in hdsp.

The hook routines are called in dispatch disabled state. The hook routines must not invoke T-Kernel/OS system calls (tk_.) or extended SVC. T-Kernel/DS service calls (td_.) may be invoked.

void exec( ID tskid, INT lsid )

tskid Task ID of the started or resumed task

lsid Logical ID of the task designated in tskid

This is called when the designated task starts execution or resumes. At the time exec() is called, the task designated in tskid is already in RUN state and logical space has been switched. However, execution of the tskid task program code occurs after the return from exec().

void stop( ID tskid, INT lsid, UINT tskstat )

tskid Task ID of the executed or stopped task

lsid Logical ID of the task designated in tskid

tskstat State of the task designated in tskid

This is called when the designated task executes or stops. tskstat indicates the task state after stopping, as one of the following states.

TTS_RDY READY state

TTS\WAI WAIT state

TTS_SUS SUSPEND state

TTS_WAS WAIT-SUSPEND state

TTS_DM DORMANT state

0 NON-EXISTENT state

At the time stop() is called, the task designated in tskid has already entered the state indicated in tskstat. The logical space is indeterminate.

Comments