tk_ref_sys
Reference System Status
ER ercd = tk_ref_sys ( T_RSYS *pk_rsys ) ;
T_RSYS* pk rsys Address of packet for returning status information
ER ercd Error code
pk rsys detail:
INT sysstat System status
ID runtskid ID of task currently in RUN state
ID schedtskid ID of task scheduled to run next
(Other implementation-dependent parameters may be added beyond this point.)
E_OK Normal completion
E_PAR Parameter error (the return parameter packet address cannot be used)
Gets the current system execution status, passing in return parameters such information as the dispatch disabled state and whether a task-independent portion is executing.
The following values are returned in sysstat.
sysstat := ( TSS_TSK | [TSS_DDSP] | [TSS_DINT] )| | ( TSS_QTSK | [TSS_DDSP] | [TSS_DINT] )| | ( TSS_INDP )
TSS_TSK Task portion executing
TSS_DDSP Dispatch disabled
TSS_DINT Interrupts disabled
TSS_INDP Task-independent portion executing
TSS_QTSK Quasi-task portion executing
#define TSS_TSK 0 /* Task portion executing */
#define TSS_DDSP 1 /* Dispatch disabled */
#define TSS_DINT 2 /* Interrupts disabled */
#define TSS_INDP 4 /* Task-independent portion executing */
#define TSS_QTSK 8 /* Quasi-task portion executing */
The ID of the task currently in RUN state is returned in runtskid, while schedtskid indicates the ID of the next task scheduled to go to RUN state. Normally runtskid = schedtskid, but this is not necessarily true if, for example, a higher-priority task was wakened during dispatch disabled state. If there is no such task, 0 is returned.
It must be possible to invoke this system call from an interrupt handler or time event handler.
Depending on the OS implementation, the information returned by tk_ref_sys is not necessarily guaranteed to be accurate at all times.

Comments