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
This commit is contained in:
patacongo 2011-04-07 01:54:59 +00:00
parent 92fb07122b
commit 9123441ebe
2 changed files with 19 additions and 3 deletions

View File

@ -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 <spudmonkey@racsa.co.cr>
*
* 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]);

View File

@ -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]);