From 0017d65ee25f15e67e5376ac59340e5835032867 Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 8 Feb 2013 00:17:54 +0000 Subject: LPC17xx now supports FPU needed by LPC1788; LPC17xx can not use Mike's common vectors git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5623 42af7a65-404d-4744-a932-0658087f49c3 --- apps/nshlib/nsh_proccmds.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) (limited to 'apps/nshlib') diff --git a/apps/nshlib/nsh_proccmds.c b/apps/nshlib/nsh_proccmds.c index 3f206b592..29daec0cd 100644 --- a/apps/nshlib/nsh_proccmds.c +++ b/apps/nshlib/nsh_proccmds.c @@ -129,23 +129,42 @@ static void ps_task(FAR struct tcb_s *tcb, FAR void *arg) /* Show task name and arguments */ - nsh_output(vtbl, "%s(", tcb->argv[0]); +#if CONFIG_TASK_NAME_SIZE > 0 + nsh_output(vtbl, "%s(", tcb->name); +#else + nsh_output(vtbl, "("); +#endif - /* Special case 1st argument (no comma) */ + /* Is this a task or a pthread? */ - if (tcb->argv[1]) +#ifndef CONFIG_DISABLE_PTHREAD + if ((tcb->flags & TCB_FLAG_TTYPE_MASK) == TCB_FLAG_TTYPE_PTHREAD) { - nsh_output(vtbl, "%p", tcb->argv[1]); + FAR struct pthread_tcb_s *ptcb = (FAR struct pthread_tcb_s *)tcb; + nsh_output(vtbl, "%p", ptcb->arg); } + else +#endif + { + FAR struct task_tcb_s *ttcb = (FAR struct task_tcb_s *)tcb; + + /* Special case 1st argument (no comma) */ - /* Then any additional arguments */ + if (ttcb->argv[1]) + { + nsh_output(vtbl, "%p", ttcb->argv[1]); + } + + /* Then any additional arguments */ #if CONFIG_MAX_TASK_ARGS > 2 - for (i = 2; i <= CONFIG_MAX_TASK_ARGS && tcb->argv[i]; i++) - { - nsh_output(vtbl, ", %p", tcb->argv[i]); - } + for (i = 2; i <= CONFIG_MAX_TASK_ARGS && ttcb->argv[i]; i++) + { + nsh_output(vtbl, ", %p", ttcb->argv[i]); + } #endif + } + nsh_output(vtbl, ")\n"); } #endif -- cgit v1.2.3