tk_ref_sys

Reference System Status

[C Language Interface]

ER ercd	= tk_ref_sys ( T_RSYS *pk_rsys ) ;

[Parameters]

T_RSYS*	pk_rsys	Address of packet for returning status information

[Return Parameters]

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.)

[Error Codes]

E_OK	Normal completion


E_PAR	Parameter error (the address of the return parameter packet cannot be used)

[Description]

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.

[Additional Notes]

When tk_ref_sys is called in the task or handler of TA_ASM attribute, correct information is not necessarily returned.

[Difference with T-Kernel 1.00.00]

The type of sysstat is UINT instead of INT.

Comments

Click here to Post a Comment