From 0a143e4c2dfae5e5b9e1000fd83ce5d05a84d6aa Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 7 Apr 2011 01:54:59 +0000 Subject: Fix AVR build, Add hooks for kernel threads git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3477 42af7a65-404d-4744-a932-0658087f49c3 --- apps/examples/thttpd/content/tasks/tasks.c | 12 ++++++++++-- apps/nshlib/nsh_proccmds.c | 10 +++++++++- 2 files changed, 19 insertions(+), 3 deletions(-) (limited to 'apps') diff --git a/apps/examples/thttpd/content/tasks/tasks.c b/apps/examples/thttpd/content/tasks/tasks.c index 13ba5cbb6..780569090 100755 --- a/apps/examples/thttpd/content/tasks/tasks.c +++ b/apps/examples/thttpd/content/tasks/tasks.c @@ -1,7 +1,7 @@ /**************************************************************************** * examples/thttpd/tasks/tasks.c * - * Copyright (C) 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -77,6 +77,14 @@ static const char *g_statenames[] = #endif }; +static const char *g_ttypenames[4] = +{ + "TASK ", + "PTHREAD", + "KTHREAD", + "--?-- " +}; + /**************************************************************************** * Public Data ****************************************************************************/ @@ -104,7 +112,7 @@ static const char *g_statenames[] = printf("%5d %3d %4s %7s%c%c %8s ", tcb->pid, tcb->sched_priority, tcb->flags & TCB_FLAG_ROUND_ROBIN ? "RR " : "FIFO", - tcb->flags & TCB_FLAG_PTHREAD ? "PTHREAD" : "TASK ", + g_ttypenames[(tcb->flags & TCB_FLAG_TTYPE_MASK) >> TCB_FLAG_TTYPE_SHIFT], tcb->flags & TCB_FLAG_NONCANCELABLE ? 'N' : ' ', tcb->flags & TCB_FLAG_CANCEL_PENDING ? 'P' : ' ', g_statenames[tcb->task_state]); diff --git a/apps/nshlib/nsh_proccmds.c b/apps/nshlib/nsh_proccmds.c index 7abd50ec1..8ae201123 100644 --- a/apps/nshlib/nsh_proccmds.c +++ b/apps/nshlib/nsh_proccmds.c @@ -86,6 +86,14 @@ static const char *g_statenames[] = "MQNFULL " #endif }; + +static const char *g_ttypenames[4] = +{ + "TASK ", + "PTHREAD", + "KTHREAD", + "--?-- " +}; #endif /**************************************************************************** @@ -111,7 +119,7 @@ static void ps_task(FAR _TCB *tcb, FAR void *arg) nsh_output(vtbl, "%5d %3d %4s %7s%c%c %8s ", tcb->pid, tcb->sched_priority, tcb->flags & TCB_FLAG_ROUND_ROBIN ? "RR " : "FIFO", - tcb->flags & TCB_FLAG_PTHREAD ? "PTHREAD" : "TASK ", + g_ttypenames[(tcb->flags & TCB_FLAG_TTYPE_MASK) >> TCB_FLAG_TTYPE_SHIFT], tcb->flags & TCB_FLAG_NONCANCELABLE ? 'N' : ' ', tcb->flags & TCB_FLAG_CANCEL_PENDING ? 'P' : ' ', g_statenames[tcb->task_state]); -- cgit v1.2.3