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:
UINT 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 address of the return parameter packet cannot be used)
Gets the current system execution status, passing in return parameters system information such 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.
When tk_ref_sys is called in the task or handler of TA_ASM attribute, correct information is not necessarily returned.
The type of sysstat is UINT instead of INT.

Comments
Click here to Post a Comment