Exemplo n.º 1
0
static int __wind_taskinfo_iddfl(struct pt_regs *regs)
{
	xnhandle_t handle = __xn_reg_arg1(regs);
	TASK_ID ret_id;

	ret_id = taskIdDefault(handle);

	return __xn_safe_copy_to_user((void __user *)__xn_reg_arg2(regs), &ret_id,
				      sizeof(ret_id));
}
Exemplo n.º 2
0
static int __wind_taskinfo_iddfl(struct task_struct *curr, struct pt_regs *regs)
{
	xnhandle_t handle = __xn_reg_arg1(regs);
	TASK_ID ret_id;

	if (!__xn_access_ok
	    (curr, VERIFY_WRITE, __xn_reg_arg2(regs), sizeof(ret_id)))
		return -EFAULT;

	ret_id = taskIdDefault(handle);
	__xn_copy_to_user(curr, (void __user *)__xn_reg_arg2(regs), &ret_id,
			  sizeof(ret_id));

	return 0;
}
Exemplo n.º 3
0
STATUS taskShow
    (
    int tid,		/* task ID */
    int level		/* 0 = summary, 1 = details, 2 = all tasks */
    )
    {
    FAST int	nTasks;			/* number of task */
    FAST int	ix;			/* index */
    TASK_DESC	td;			/* task descriptor for task info */
    WIND_TCB *	pTcb;			/* pointer to tasks tcb */
    int		idList[MAX_DSP_TASKS];	/* list of active IDs */
    char	optionsString[256];	/* task options string */

    tid = taskIdDefault (tid);				/* get default task */

    switch (level)
	{
	case 0 :					/* summarize a task */
	    {
	    if (taskInfoGet (tid, &td) != OK)
		{
		printErr ("Task not found.\n");
		return (ERROR);
		}

	    printf (infoHdr);
	    taskSummary (&td);
	    break;
	    }

	case 1 :					/* get task detail */
	    {
	    if (taskInfoGet (tid, &td) != OK)
		{
		printErr ("Task not found.\n");
		return (ERROR);
		}

	    taskOptionsString (tid, optionsString);	/* get options string */

	    /* Print the summary as in all_task_info, then all the regs. */

	    printf (infoHdr);				/* banner */
	    taskSummary (&td);

	    printf ("\nstack: base 0x%-6x  end 0x%-6x  size %-5d  ",
		    (int)td.td_pStackBase, (int)td.td_pStackEnd,
		    td.td_stackSize);

	    if (td.td_options & VX_NO_STACK_FILL)
		printf ("high %5s  margin %5s\n", "???", "???");
	    else
		printf ("high %-5d  margin %-5d\n", td.td_stackHigh,
			 td.td_stackMargin);

	    printf ("\noptions: 0x%x\n%s\n", td.td_options, optionsString);

	    /* display VxWorks events information */

	    eventTaskShow (&td.td_events);

	    if (tid != taskIdSelf ())			/* no self exam */
		{
		taskRegsShow (tid);
		if (_func_fppTaskRegsShow != NULL)	/* fp regs if attached*/
		    (* _func_fppTaskRegsShow) (tid);
		if (_func_dspTaskRegsShow != NULL)	/* dsp regs if attached*/
		    (* _func_dspTaskRegsShow) (tid);
#ifdef _WRS_ALTIVEC_SUPPORT
		if (_func_altivecTaskRegsShow != NULL)	/* altivec regs if attached*/
		    (* _func_altivecTaskRegsShow) (tid);
#endif /* _WRS_ALTIVEC_SUPPORT */

#if (CPU_FAMILY==I80X86)
		if (_func_sseTaskRegsShow != NULL)	/* SIMD regs if attached */
		    (* _func_sseTaskRegsShow) (tid);
#endif /* (CPU_FAMILY==I80X86) */
		}

	    /* print exception info if any */

	    if ((_func_excInfoShow != NULL) && ((pTcb = taskTcb (tid)) != NULL))
		(* _func_excInfoShow) (&pTcb->excInfo, FALSE);
	    break;
	    }

	case 2 :				/* summarize all tasks */
	default :
	    {
	    printf (infoHdr);

	    nTasks = taskIdListGet (idList, NELEMENTS (idList));
	    taskIdListSort (idList, nTasks);

	    for (ix = 0; ix < nTasks; ++ix)
		{
		if (taskInfoGet (idList [ix], &td) == OK)
		    taskSummary (&td);
		}
	    break;
	    }
	}

    return (OK);
    }