From 12ae4d2bd76f078933ab63b2d7bbc69c307d00f3 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 14 Dec 2009 18:39:29 +0000 Subject: [PATCH] Switching to C99 stdint.h types git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2336 42af7a65-404d-4744-a932-0658087f49c3 --- sched/atexit.c | 1 - sched/clock_abstime2ticks.c | 2 +- sched/clock_getres.c | 59 +++++++++++---------- sched/clock_gettime.c | 67 ++++++++++++------------ sched/clock_gettimeofday.c | 2 +- sched/clock_initialize.c | 10 ++-- sched/clock_internal.h | 3 +- sched/clock_settime.c | 3 +- sched/clock_ticks2time.c | 2 +- sched/clock_time2ticks.c | 12 +++-- sched/env_dup.c | 1 + sched/env_dupenv.c | 1 + sched/exit.c | 3 +- sched/irq_attach.c | 2 +- sched/irq_dispatch.c | 3 +- sched/irq_initialize.c | 2 +- sched/irq_internal.h | 3 +- sched/irq_unexpectedisr.c | 2 +- sched/mq_close.c | 3 +- sched/mq_descreate.c | 7 +-- sched/mq_findnamed.c | 43 +++++++-------- sched/mq_getattr.c | 43 +++++++-------- sched/mq_initialize.c | 57 ++++++++++---------- sched/mq_internal.h | 22 ++++---- sched/mq_msgfree.c | 43 +++++++-------- sched/mq_msgqfree.c | 45 ++++++++-------- sched/mq_notify.c | 39 +++++++------- sched/mq_open.c | 14 ++--- sched/mq_setattr.c | 45 ++++++++-------- sched/mq_sndinternal.c | 2 +- sched/mq_timedreceive.c | 8 ++- sched/mq_timedsend.c | 7 ++- sched/mq_unlink.c | 45 ++++++++-------- sched/mq_waitirq.c | 5 +- sched/os_internal.h | 2 + sched/pthread_attrdestroy.c | 7 +-- sched/pthread_attrgetinheritsched.c | 7 +-- sched/pthread_attrgetschedparam.c | 7 +-- sched/pthread_attrinit.c | 8 +-- sched/pthread_attrsetinheritsched.c | 12 +++-- sched/pthread_attrsetschedparam.c | 7 +-- sched/pthread_attrsetschedpolicy.c | 7 +-- sched/pthread_attrsetstacksize.c | 10 ++-- sched/pthread_barrierattrdestroy.c | 9 ++-- sched/pthread_barrierattrgetpshared.c | 9 ++-- sched/pthread_barrierattrinit.c | 9 ++-- sched/pthread_barrierattrsetpshared.c | 9 ++-- sched/pthread_barrierdestroy.c | 9 ++-- sched/pthread_barrierinit.c | 9 ++-- sched/pthread_barrierwait.c | 9 ++-- sched/pthread_cancel.c | 4 ++ sched/pthread_condattrdestroy.c | 7 +-- sched/pthread_condattrinit.c | 5 +- sched/pthread_condbroadcast.c | 6 ++- sched/pthread_conddestroy.c | 5 +- sched/pthread_condinit.c | 6 ++- sched/pthread_condsignal.c | 6 ++- sched/pthread_condtimedwait.c | 9 ++-- sched/pthread_condwait.c | 6 ++- sched/pthread_exit.c | 45 ++++++++-------- sched/pthread_getspecific.c | 44 ++++++++-------- sched/pthread_initialize.c | 11 ++-- sched/pthread_internal.h | 7 +-- sched/pthread_keycreate.c | 6 +-- sched/pthread_keydelete.c | 44 ++++++++-------- sched/pthread_kill.c | 24 +++++---- sched/pthread_mutexattrdestroy.c | 8 +-- sched/pthread_mutexattrgetpshared.c | 8 +-- sched/pthread_mutexattrinit.c | 6 ++- sched/pthread_mutexattrsetpshared.c | 8 +-- sched/pthread_mutexdestroy.c | 5 +- sched/pthread_mutexinit.c | 13 +++-- sched/pthread_mutexlock.c | 6 ++- sched/pthread_mutextrylock.c | 5 +- sched/pthread_mutexunlock.c | 6 ++- sched/pthread_once.c | 8 +-- sched/pthread_setspecific.c | 5 +- sched/pthread_sigmask.c | 45 ++++++++-------- sched/sched_addblocked.c | 46 ++++++++-------- sched/sched_addprioritized.c | 49 +++++++++-------- sched/sched_addreadytorun.c | 6 ++- sched/sched_free.c | 1 - sched/sched_garbage.c | 1 - sched/sched_getprioritymax.c | 49 ++++++++--------- sched/sched_getprioritymin.c | 49 ++++++++--------- sched/sched_lock.c | 3 +- sched/sched_lockcount.c | 52 ++++++++++--------- sched/sched_mergepending.c | 46 ++++++++-------- sched/sched_processtimer.c | 51 +++++++++--------- sched/sched_releasetcb.c | 38 +++++++------- sched/sched_removeblocked.c | 50 +++++++++--------- sched/sched_removereadytorun.c | 6 ++- sched/sched_reprioritize.c | 4 +- sched/sched_setpriority.c | 15 +++--- sched/sched_setupidlefiles.c | 3 +- sched/sched_unlock.c | 3 +- sched/sched_verifytcb.c | 4 +- sched/sched_yield.c | 3 +- sched/sem_close.c | 6 ++- sched/sem_destroy.c | 4 +- sched/sem_findnamed.c | 48 +++++++++-------- sched/sem_getvalue.c | 6 ++- sched/sem_holder.c | 3 +- sched/sem_init.c | 6 ++- sched/sem_initialize.c | 3 +- sched/sem_internal.h | 13 ++--- sched/sem_post.c | 4 +- sched/sem_trywait.c | 6 ++- sched/sem_unlink.c | 6 ++- sched/sem_wait.c | 3 +- sched/sem_waitirq.c | 6 ++- sched/sig_action.c | 8 +-- sched/sig_allocatependingsigaction.c | 46 ++++++++-------- sched/sig_cleanup.c | 45 ++++++++-------- sched/sig_findaction.c | 44 ++++++++-------- sched/sig_initialize.c | 75 ++++++++++++++------------- sched/sig_internal.h | 6 +-- sched/sig_kill.c | 25 +++++---- sched/sig_lowest.c | 46 ++++++++-------- sched/sig_mqnotempty.c | 6 ++- sched/sig_pending.c | 6 ++- sched/sig_procmask.c | 6 ++- sched/sig_queue.c | 4 +- sched/sig_received.c | 65 ++++++++++++----------- sched/sig_releasependingsigaction.c | 46 ++++++++-------- sched/sig_releasependingsignal.c | 45 ++++++++-------- sched/sig_removependingsignal.c | 45 ++++++++-------- sched/sig_suspend.c | 7 +-- sched/sig_timedwait.c | 16 +++--- sched/sig_unmaskpendingsignal.c | 46 ++++++++-------- sched/sig_waitinfo.c | 4 +- sched/sleep.c | 3 +- sched/task_activate.c | 2 +- sched/task_deletecurrent.c | 1 - sched/task_init.c | 4 +- sched/task_setup.c | 6 +-- sched/task_start.c | 5 +- sched/timer_create.c | 2 +- sched/timer_initialize.c | 5 +- sched/timer_internal.h | 6 +-- sched/timer_settime.c | 22 ++++---- sched/wd_cancel.c | 4 +- sched/wd_create.c | 6 ++- sched/wd_delete.c | 2 +- sched/wd_gettime.c | 10 ++-- sched/wd_initialize.c | 46 ++++++++-------- sched/wd_internal.h | 46 ++++++++-------- sched/wd_start.c | 17 +++--- sched/work_cancel.c | 1 - sched/work_internal.h | 1 - sched/work_queue.c | 4 +- sched/work_thread.c | 8 +-- 152 files changed, 1328 insertions(+), 1151 deletions(-) diff --git a/sched/atexit.c b/sched/atexit.c index 9feb4ce9a7..2920a36181 100644 --- a/sched/atexit.c +++ b/sched/atexit.c @@ -37,7 +37,6 @@ * Included Files ************************************************************/ -#include #include #include #include diff --git a/sched/clock_abstime2ticks.c b/sched/clock_abstime2ticks.c index b93fb8eac8..c8be4b1b18 100644 --- a/sched/clock_abstime2ticks.c +++ b/sched/clock_abstime2ticks.c @@ -38,7 +38,7 @@ ********************************************************************************/ #include -#include + #include #include #include diff --git a/sched/clock_getres.c b/sched/clock_getres.c index 821941ba2c..467802f277 100644 --- a/sched/clock_getres.c +++ b/sched/clock_getres.c @@ -1,7 +1,7 @@ -/************************************************************ - * clock_getres.c +/************************************************************************ + * sched/clock_getres.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,62 +31,65 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include +#include + +#include #include #include #include + #include "clock_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/********************************************************** +/********************************************************************** * Public Constant Data - **********************************************************/ + **********************************************************************/ -/************************************************************ +/************************************************************************ * Public Variables - ************************************************************/ + ************************************************************************/ -/********************************************************** +/********************************************************************** * Private Variables - **********************************************************/ + **********************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: clock_getres * * Description: * Clock Functions based on POSIX APIs * - ************************************************************/ + ************************************************************************/ int clock_getres(clockid_t clock_id, struct timespec *res) { - uint32 time_res; - int ret = OK; + uint32_t time_res; + int ret = OK; sdbg("clock_id=%d\n", clock_id); diff --git a/sched/clock_gettime.c b/sched/clock_gettime.c index 68c8b64925..6b8ac8c795 100644 --- a/sched/clock_gettime.c +++ b/sched/clock_gettime.c @@ -1,7 +1,7 @@ -/************************************************************ - * clock_gettime.c +/************************************************************************ + * sched/clock_gettime.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,63 +31,66 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include +#include + +#include #include #include #include + #include "clock_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/********************************************************** +/********************************************************************** * Public Constant Data - **********************************************************/ + **********************************************************************/ -/************************************************************ +/************************************************************************ * Public Variables - ************************************************************/ + ************************************************************************/ -/********************************************************** +/********************************************************************** * Private Variables - **********************************************************/ + **********************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: clock_gettime * * Description: * Clock Functions based on POSIX APIs * - ************************************************************/ + ************************************************************************/ int clock_gettime(clockid_t clock_id, struct timespec *tp) { - uint32 msecs; - uint32 secs; - uint32 nsecs; + uint32_t msecs; + uint32_t secs; + uint32_t nsecs; int ret = OK; sdbg("clock_id=%d\n", clock_id); @@ -123,14 +126,14 @@ int clock_gettime(clockid_t clock_id, struct timespec *tp) /* Add the base time to this. */ - secs += (uint32)g_basetime.tv_sec; - nsecs += (uint32)g_basetime.tv_nsec; + secs += (uint32_t)g_basetime.tv_sec; + nsecs += (uint32_t)g_basetime.tv_nsec; /* Handle carry to seconds. */ if (nsecs > NSEC_PER_SEC) { - uint32 dwCarrySecs = nsecs / NSEC_PER_SEC; + uint32_t dwCarrySecs = nsecs / NSEC_PER_SEC; secs += dwCarrySecs; nsecs -= (dwCarrySecs * NSEC_PER_SEC); } diff --git a/sched/clock_gettimeofday.c b/sched/clock_gettimeofday.c index ccc6fc9b3b..54c44f7534 100644 --- a/sched/clock_gettimeofday.c +++ b/sched/clock_gettimeofday.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include diff --git a/sched/clock_initialize.c b/sched/clock_initialize.c index e63ba1dea0..baddc31364 100644 --- a/sched/clock_initialize.c +++ b/sched/clock_initialize.c @@ -1,5 +1,5 @@ /**************************************************************************** - * clock_initialize.c + * sched/clock_initialize.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -38,8 +38,8 @@ ****************************************************************************/ #include -#include +#include #include #include #include @@ -71,9 +71,9 @@ * Public Variables ****************************************************************************/ -volatile uint32 g_system_timer = 0; -struct timespec g_basetime = {0,0}; -uint32 g_tickbias = 0; +volatile uint32_t g_system_timer = 0; +struct timespec g_basetime = {0,0}; +uint32_t g_tickbias = 0; /************************************************************************** * Private Variables diff --git a/sched/clock_internal.h b/sched/clock_internal.h index 7d1dbb6293..008bdcd3cf 100644 --- a/sched/clock_internal.h +++ b/sched/clock_internal.h @@ -41,7 +41,6 @@ ********************************************************************************/ #include -#include #include #include @@ -58,7 +57,7 @@ ********************************************************************************/ extern struct timespec g_basetime; -extern uint32 g_tickbias; +extern uint32_t g_tickbias; /******************************************************************************** * Public Function Prototypes diff --git a/sched/clock_settime.c b/sched/clock_settime.c index 605199c18e..989ed50cd0 100644 --- a/sched/clock_settime.c +++ b/sched/clock_settime.c @@ -37,7 +37,8 @@ * Included Files ************************************************************/ -#include +#include + #include #include #include diff --git a/sched/clock_ticks2time.c b/sched/clock_ticks2time.c index 154756a6f9..fe2165d685 100644 --- a/sched/clock_ticks2time.c +++ b/sched/clock_ticks2time.c @@ -38,7 +38,7 @@ ********************************************************************************/ #include -#include + #include #include "clock_internal.h" diff --git a/sched/clock_time2ticks.c b/sched/clock_time2ticks.c index 5414dfe752..beba5014c1 100644 --- a/sched/clock_time2ticks.c +++ b/sched/clock_time2ticks.c @@ -1,7 +1,7 @@ /******************************************************************************** - * clock_time2ticks.c + * sched/clock_time2ticks.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -38,8 +38,10 @@ ********************************************************************************/ #include -#include + +#include #include + #include "clock_internal.h" /******************************************************************************** @@ -87,7 +89,7 @@ int clock_time2ticks(FAR const struct timespec *reltime, FAR int *ticks) { - sint32 relusec; + int32_t relusec; /* Convert the relative time into microseconds.*/ diff --git a/sched/env_dup.c b/sched/env_dup.c index 671b8ea7b7..4627393bb3 100644 --- a/sched/env_dup.c +++ b/sched/env_dup.c @@ -41,6 +41,7 @@ #ifndef CONFIG_DISABLE_ENVIRON +#include #include #include #include diff --git a/sched/env_dupenv.c b/sched/env_dupenv.c index 748af878c8..164dbe7134 100644 --- a/sched/env_dupenv.c +++ b/sched/env_dupenv.c @@ -41,6 +41,7 @@ #ifndef CONFIG_DISABLE_ENVIRON +#include #include #include #include "os_internal.h" diff --git a/sched/exit.c b/sched/exit.c index 564c1bb6c8..5302dade61 100644 --- a/sched/exit.c +++ b/sched/exit.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/irq_attach.c b/sched/irq_attach.c index 02063438f0..5ccb77ce11 100644 --- a/sched/irq_attach.c +++ b/sched/irq_attach.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include "irq_internal.h" diff --git a/sched/irq_dispatch.c b/sched/irq_dispatch.c index c8c3c7bdaa..4b2447cbf8 100644 --- a/sched/irq_dispatch.c +++ b/sched/irq_dispatch.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/irq_initialize.c b/sched/irq_initialize.c index ea0870375b..91e8126447 100644 --- a/sched/irq_initialize.c +++ b/sched/irq_initialize.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include #include "irq_internal.h" diff --git a/sched/irq_internal.h b/sched/irq_internal.h index 8dce137926..4d180ec12e 100644 --- a/sched/irq_internal.h +++ b/sched/irq_internal.h @@ -40,7 +40,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/irq_unexpectedisr.c b/sched/irq_unexpectedisr.c index 272e5d3ea5..e00e534a3a 100644 --- a/sched/irq_unexpectedisr.c +++ b/sched/irq_unexpectedisr.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include #include "os_internal.h" diff --git a/sched/mq_close.c b/sched/mq_close.c index 15d2272a01..06b81fb5ed 100644 --- a/sched/mq_close.c +++ b/sched/mq_close.c @@ -37,7 +37,8 @@ * Included Files ************************************************************/ -#include /* uint32, etc. */ +#include + #include #include #include "os_internal.h" diff --git a/sched/mq_descreate.c b/sched/mq_descreate.c index 47b9397d5e..c8a0cfeae3 100644 --- a/sched/mq_descreate.c +++ b/sched/mq_descreate.c @@ -1,7 +1,7 @@ /**************************************************************************** - * mq_descreate.c + * sched/mq_descreate.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,8 @@ * Included Files ****************************************************************************/ +#include + #include /* va_list */ #include #include @@ -48,7 +50,6 @@ #include "os_internal.h" #include "sig_internal.h" -#include /* uint32, etc. */ #include #include #include "mq_internal.h" diff --git a/sched/mq_findnamed.c b/sched/mq_findnamed.c index a74caba7b9..851052e280 100644 --- a/sched/mq_findnamed.c +++ b/sched/mq_findnamed.c @@ -1,7 +1,7 @@ -/************************************************************ - * mq_findnamed.c +/************************************************************************ + * sched/mq_findnamed.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,41 +31,42 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_findnamed * * Description: @@ -79,7 +80,7 @@ * A reference to the matching named message queue * structure (or NULL if none was found). * - ************************************************************/ + ************************************************************************/ FAR msgq_t *mq_findnamed(const char *mq_name) { diff --git a/sched/mq_getattr.c b/sched/mq_getattr.c index 71f2a87dfe..e788d6e71a 100644 --- a/sched/mq_getattr.c +++ b/sched/mq_getattr.c @@ -1,7 +1,7 @@ -/************************************************************ - * mq_getattr.c +/************************************************************************ + * sched/mq_getattr.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,13 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include /* va_list */ #include #include @@ -51,31 +52,31 @@ #include "sig_internal.h" #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_getattr * * Description: @@ -91,7 +92,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int mq_getattr(mqd_t mqdes, struct mq_attr *mq_stat) { diff --git a/sched/mq_initialize.c b/sched/mq_initialize.c index df8e981e63..fdc5dbb00c 100644 --- a/sched/mq_initialize.c +++ b/sched/mq_initialize.c @@ -1,7 +1,7 @@ -/************************************************************ - * mq_initialize.c +/************************************************************************ + * sched/mq_initialize.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,24 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include /* uint32, etc. */ +#include + +#include #include #include + #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ /* This is a container for a list of message queue * descriptors. @@ -60,9 +63,9 @@ struct mq_des_block_s struct mq_des mqdes[NUM_MSG_DESCRIPTORS]; }; -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ /* This is a list of all opened message queues */ @@ -88,9 +91,9 @@ sq_queue_t g_msgfreeirq; sq_queue_t g_desfree; -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ /* g_msgalloc is a pointer to the start of the allocated * block of messages. @@ -110,11 +113,11 @@ static mqmsg_t *g_msgfreeirqalloc; static sq_queue_t g_desalloc; -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_msgblockalloc * * Description: @@ -124,10 +127,10 @@ static sq_queue_t g_desalloc; * * Inputs: * queue - ************************************************************/ + ************************************************************************/ -static mqmsg_t *mq_msgblockalloc(sq_queue_t *queue, uint16 nmsgs, - ubyte alloc_type) +static mqmsg_t *mq_msgblockalloc(sq_queue_t *queue, uint16_t nmsgs, + uint8_t alloc_type) { mqmsg_t *mqmsgblock; @@ -151,11 +154,11 @@ static mqmsg_t *mq_msgblockalloc(sq_queue_t *queue, uint16 nmsgs, return mqmsgblock; } -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_initialize * * Description: @@ -170,7 +173,7 @@ static mqmsg_t *mq_msgblockalloc(sq_queue_t *queue, uint16 nmsgs, * Return Value: * None * - ************************************************************/ + ************************************************************************/ void mq_initialize(void) { @@ -203,7 +206,7 @@ void mq_initialize(void) mq_desblockalloc(); } -/************************************************************ +/************************************************************************ * Function: mq_desblockalloc * * Description: @@ -216,7 +219,7 @@ void mq_initialize(void) * Return Value: * None * - ************************************************************/ + ************************************************************************/ void mq_desblockalloc(void) { diff --git a/sched/mq_internal.h b/sched/mq_internal.h index 554b598840..e5dc3ea3fe 100644 --- a/sched/mq_internal.h +++ b/sched/mq_internal.h @@ -90,14 +90,14 @@ typedef enum mqalloc_e mqalloc_t; struct mqmsg { FAR struct mqmsg *next; /* Forward link to next message */ - ubyte type; /* (Used to manage allocations) */ - ubyte priority; /* priority of message */ + uint8_t type; /* (Used to manage allocations) */ + uint8_t priority; /* priority of message */ #if MQ_MAX_BYTES < 256 - ubyte msglen; /* Message data length */ + uint8_t msglen; /* Message data length */ #else - uint16 msglen; /* Message data length */ + uint16_t msglen; /* Message data length */ #endif - ubyte mail[MQ_MAX_BYTES]; /* Message data */ + uint8_t mail[MQ_MAX_BYTES]; /* Message data */ }; typedef struct mqmsg mqmsg_t; @@ -109,12 +109,12 @@ struct msgq_s { FAR struct msgq_s *flink; /* Forward link to next message queue */ sq_queue_t msglist; /* Prioritized message list */ - sint16 maxmsgs; /* Maximum number of messages in the queue */ - sint16 nmsgs; /* Number of message in the queue */ - sint16 nconnect; /* Number of connections to message queue */ - sint16 nwaitnotfull; /* Number tasks waiting for not full */ - sint16 nwaitnotempty; /* Number tasks waiting for not empty */ - ubyte maxmsgsize; /* Max size of message in message queue */ + int16_t maxmsgs; /* Maximum number of messages in the queue */ + int16_t nmsgs; /* Number of message in the queue */ + int16_t nconnect; /* Number of connections to message queue */ + int16_t nwaitnotfull; /* Number tasks waiting for not full */ + int16_t nwaitnotempty; /* Number tasks waiting for not empty */ + uint8_t maxmsgsize; /* Max size of message in message queue */ boolean unlinked; /* TRUE if the msg queue has been unlinked */ #ifndef CONFIG_DISABLE_SIGNALS FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */ diff --git a/sched/mq_msgfree.c b/sched/mq_msgfree.c index f7a236f153..8147dd518e 100644 --- a/sched/mq_msgfree.c +++ b/sched/mq_msgfree.c @@ -1,5 +1,5 @@ -/************************************************************ - * mq_msgfree.c +/************************************************************************ + * sched/mq_msgfree.c * * Copyright (C) 2007 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,43 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include #include #include "os_internal.h" #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_msgfree * * Description: @@ -82,7 +83,7 @@ * Return Value: * None * - ************************************************************/ + ************************************************************************/ void mq_msgfree(FAR mqmsg_t *mqmsg) { diff --git a/sched/mq_msgqfree.c b/sched/mq_msgqfree.c index 06d5da8158..74ba3d441e 100644 --- a/sched/mq_msgqfree.c +++ b/sched/mq_msgqfree.c @@ -1,7 +1,7 @@ -/************************************************************ - * mq_msgqfree.c +/************************************************************************ + * sched/mq_msgqfree.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,43 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include #include #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_msgqfree * * Description: @@ -82,7 +83,7 @@ * Return Value: * None * - ************************************************************/ + ************************************************************************/ void mq_msgqfree(FAR msgq_t *msgq) { diff --git a/sched/mq_notify.c b/sched/mq_notify.c index b01a2d7c7e..f491f653af 100644 --- a/sched/mq_notify.c +++ b/sched/mq_notify.c @@ -1,4 +1,4 @@ -/************************************************************ +/************************************************************************ * sched/mq_notify.c * * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. @@ -31,44 +31,45 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include #include #include #include "os_internal.h" #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_notify * * Description: @@ -110,7 +111,7 @@ * message shall satisfy mq_receive()... The resulting behavior is as if * the message queue remains empty, and no notification shall be sent." * - ************************************************************/ + ************************************************************************/ int mq_notify(mqd_t mqdes, const struct sigevent *notification) { diff --git a/sched/mq_open.c b/sched/mq_open.c index 2179178d04..4780d396b6 100644 --- a/sched/mq_open.c +++ b/sched/mq_open.c @@ -1,7 +1,7 @@ /**************************************************************************** - * mq_open.c + * sched/mq_open.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include /* uint32, etc. */ -#include /* va_list */ +#include + +#include +#include #include #include #include @@ -173,10 +175,10 @@ mqd_t mq_open(const char *mq_name, int oflags, ...) sq_init(&msgq->msglist); if (attr) { - msgq->maxmsgs = (sint16)attr->mq_maxmsg; + msgq->maxmsgs = (int16_t)attr->mq_maxmsg; if (attr->mq_msgsize <= MQ_MAX_BYTES) { - msgq->maxmsgsize = (sint16)attr->mq_msgsize; + msgq->maxmsgsize = (int16_t)attr->mq_msgsize; } else { diff --git a/sched/mq_setattr.c b/sched/mq_setattr.c index f0eca4eae5..4a74e35490 100644 --- a/sched/mq_setattr.c +++ b/sched/mq_setattr.c @@ -1,7 +1,7 @@ -/************************************************************ - * mq_setattr.c +/************************************************************************ + * sched/mq_setattr.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,43 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include /* O_NONBLOCK */ #include #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_setattr * * Description: @@ -89,7 +90,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int mq_setattr(mqd_t mqdes, const struct mq_attr *mq_stat, struct mq_attr *oldstat) diff --git a/sched/mq_sndinternal.c b/sched/mq_sndinternal.c index e81d5ae4f3..8755603f83 100644 --- a/sched/mq_sndinternal.c +++ b/sched/mq_sndinternal.c @@ -208,7 +208,7 @@ FAR mqmsg_t *mq_msgalloc(void) else { sdbg("Out of messages\n"); - PANIC((uint32)OSERR_OUTOFMESSAGES); + PANIC((uint32_t)OSERR_OUTOFMESSAGES); } } } diff --git a/sched/mq_timedreceive.c b/sched/mq_timedreceive.c index fd8f0edd80..a13a8a632e 100644 --- a/sched/mq_timedreceive.c +++ b/sched/mq_timedreceive.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mq_timedreceive.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,13 +37,17 @@ * Included Files ****************************************************************************/ +#include + #include +#include #include #include #include #include #include #include + #include "os_internal.h" #include "clock_internal.h" #include "mq_internal.h" @@ -86,7 +90,7 @@ * ****************************************************************************/ -static void mq_rcvtimeout(int argc, uint32 pid) +static void mq_rcvtimeout(int argc, uint32_t pid) { FAR _TCB *wtcb; irqstate_t saved_state; diff --git a/sched/mq_timedsend.c b/sched/mq_timedsend.c index b50cdcef3d..7bdbbb7e1d 100644 --- a/sched/mq_timedsend.c +++ b/sched/mq_timedsend.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mq_timedsend.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -38,13 +38,16 @@ ****************************************************************************/ #include + #include +#include #include #include #include #include #include #include + #include "clock_internal.h" #include "os_internal.h" #include "mq_internal.h" @@ -87,7 +90,7 @@ * ****************************************************************************/ -static void mq_sndtimeout(int argc, uint32 pid) +static void mq_sndtimeout(int argc, uint32_t pid) { FAR _TCB *wtcb; irqstate_t saved_state; diff --git a/sched/mq_unlink.c b/sched/mq_unlink.c index 17b5767ae3..7d77e266d6 100644 --- a/sched/mq_unlink.c +++ b/sched/mq_unlink.c @@ -1,7 +1,7 @@ -/************************************************************ - * mq_unlink.c +/************************************************************************ + * sched.mq_unlink.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,43 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include /* uint32, etc. */ #include #include #include "os_internal.h" #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: mq_unlink * * Description: @@ -85,7 +86,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int mq_unlink(const char *mq_name) { diff --git a/sched/mq_waitirq.c b/sched/mq_waitirq.c index 417aa84bf5..f0f55c5e6a 100644 --- a/sched/mq_waitirq.c +++ b/sched/mq_waitirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/mq_waitirq.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/os_internal.h b/sched/os_internal.h index a7b55acfde..cda7dc61ce 100644 --- a/sched/os_internal.h +++ b/sched/os_internal.h @@ -40,6 +40,8 @@ * Included Files ****************************************************************************/ +#include +#include #include #include #include diff --git a/sched/pthread_attrdestroy.c b/sched/pthread_attrdestroy.c index bdacdab268..bfa1a49a91 100644 --- a/sched/pthread_attrdestroy.c +++ b/sched/pthread_attrdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrdestroy.c + * sched/pthread_attrdestroy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_attrgetinheritsched.c b/sched/pthread_attrgetinheritsched.c index 367d9d6cf4..7accfcdf74 100644 --- a/sched/pthread_attrgetinheritsched.c +++ b/sched/pthread_attrgetinheritsched.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrgetinheritsched.c + * sched/pthread_attrgetinheritsched.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_attrgetschedparam.c b/sched/pthread_attrgetschedparam.c index dd3303c461..513a941a38 100644 --- a/sched/pthread_attrgetschedparam.c +++ b/sched/pthread_attrgetschedparam.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrgetschedparam.c + * sched/pthread_attrgetschedparam.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_attrinit.c b/sched/pthread_attrinit.c index 003cd8677e..ed260aa831 100644 --- a/sched/pthread_attrinit.c +++ b/sched/pthread_attrinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrinit.c + * sched/pthread_attrinit.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_attrsetinheritsched.c b/sched/pthread_attrsetinheritsched.c index c17703a5f5..35b7ad425c 100644 --- a/sched/pthread_attrsetinheritsched.c +++ b/sched/pthread_attrsetinheritsched.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrsetinheritsched.c + * sched/pthread_attrsetinheritsched.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** @@ -102,7 +104,7 @@ int pthread_attr_setinheritsched(FAR pthread_attr_t *attr, } else { - attr->inheritsched = (ubyte)inheritsched; + attr->inheritsched = (uint8_t)inheritsched; ret = OK; } diff --git a/sched/pthread_attrsetschedparam.c b/sched/pthread_attrsetschedparam.c index 9cf699cbfc..cd806d72f3 100644 --- a/sched/pthread_attrsetschedparam.c +++ b/sched/pthread_attrsetschedparam.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrsetschedparam.c + * sched/pthread_attrsetschedparam.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_attrsetschedpolicy.c b/sched/pthread_attrsetschedpolicy.c index 73bfb73390..93756f0705 100644 --- a/sched/pthread_attrsetschedpolicy.c +++ b/sched/pthread_attrsetschedpolicy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrsetschedpolicy.c + * sched/pthread_attrsetschedpolicy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_attrsetstacksize.c b/sched/pthread_attrsetstacksize.c index 7286441c77..659a35d471 100644 --- a/sched/pthread_attrsetstacksize.c +++ b/sched/pthread_attrsetstacksize.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrsetstacksize.c + * sched/pthread_attrsetstacksize.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_barrierattrdestroy.c b/sched/pthread_barrierattrdestroy.c index de20d16f6f..813e95d8a1 100644 --- a/sched/pthread_barrierattrdestroy.c +++ b/sched/pthread_barrierattrdestroy.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barrierattrdestroy.c + * sched/pthread_barrierattrdestroy.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_barrierattrgetpshared.c b/sched/pthread_barrierattrgetpshared.c index 23cf438722..0e2cf30df3 100644 --- a/sched/pthread_barrierattrgetpshared.c +++ b/sched/pthread_barrierattrgetpshared.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barrierattrgetpshared.c + * sched/pthread_barrierattrgetpshared.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_barrierattrinit.c b/sched/pthread_barrierattrinit.c index b2787bd315..3a0d346f19 100644 --- a/sched/pthread_barrierattrinit.c +++ b/sched/pthread_barrierattrinit.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barrierattrinit.c + * sched/pthread_barrierattrinit.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_barrierattrsetpshared.c b/sched/pthread_barrierattrsetpshared.c index 2f1aee4f1e..b130757914 100644 --- a/sched/pthread_barrierattrsetpshared.c +++ b/sched/pthread_barrierattrsetpshared.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barrierattrsetpshared.c + * sched/pthread_barrierattrsetpshared.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_barrierdestroy.c b/sched/pthread_barrierdestroy.c index d4a33cc208..6720b9d99e 100644 --- a/sched/pthread_barrierdestroy.c +++ b/sched/pthread_barrierdestroy.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barriedestroy.c + * sched/pthread_barriedestroy.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_barrierinit.c b/sched/pthread_barrierinit.c index bafb0794a6..1d8dd00c30 100644 --- a/sched/pthread_barrierinit.c +++ b/sched/pthread_barrierinit.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barrieinit.c + * sched/pthread_barrieinit.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_barrierwait.c b/sched/pthread_barrierwait.c index 14cfa2eb31..b8588aff05 100644 --- a/sched/pthread_barrierwait.c +++ b/sched/pthread_barrierwait.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_barrierwait.c + * sched/pthread_barrierwait.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,7 +37,8 @@ * Included Files ********************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_cancel.c b/sched/pthread_cancel.c index 8b8c36c991..ac28bb85a3 100644 --- a/sched/pthread_cancel.c +++ b/sched/pthread_cancel.c @@ -37,9 +37,13 @@ * Included Files **************************************************************************/ +#include + +#include #include #include #include + #include "os_internal.h" #include "pthread_internal.h" diff --git a/sched/pthread_condattrdestroy.c b/sched/pthread_condattrdestroy.c index e1d4d41fda..99e261ce20 100644 --- a/sched/pthread_condattrdestroy.c +++ b/sched/pthread_condattrdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_condattrdestroy.c + * sched/pthread_condattrdestroy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_condattrinit.c b/sched/pthread_condattrinit.c index 4e9ca23d9f..1e37466548 100644 --- a/sched/pthread_condattrinit.c +++ b/sched/pthread_condattrinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_condattrinit.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_condbroadcast.c b/sched/pthread_condbroadcast.c index 4cda2af702..5b69ea4282 100644 --- a/sched/pthread_condbroadcast.c +++ b/sched/pthread_condbroadcast.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_condbroadcast.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_conddestroy.c b/sched/pthread_conddestroy.c index e473f75641..dc176af777 100644 --- a/sched/pthread_conddestroy.c +++ b/sched/pthread_conddestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_conddestroy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_condinit.c b/sched/pthread_condinit.c index 6b9eebd5f0..f341d28faa 100644 --- a/sched/pthread_condinit.c +++ b/sched/pthread_condinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_condinit.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_condsignal.c b/sched/pthread_condsignal.c index 771d9a7694..a10dda6be4 100644 --- a/sched/pthread_condsignal.c +++ b/sched/pthread_condsignal.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_condsignal.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_condtimedwait.c b/sched/pthread_condtimedwait.c index 0a1bc7ca9b..6abf7881d1 100644 --- a/sched/pthread_condtimedwait.c +++ b/sched/pthread_condtimedwait.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_condtimedwait.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,9 @@ * Included Files ****************************************************************************/ +#include #include -#include + #include #include #include @@ -89,7 +90,7 @@ * ****************************************************************************/ -static void pthread_condtimedout(int argc, uint32 pid, uint32 signo) +static void pthread_condtimedout(int argc, uint32_t pid, uint32_t signo) { #ifdef CONFIG_CAN_PASS_STRUCTS union sigval value; @@ -233,7 +234,7 @@ int pthread_cond_timedwait(FAR pthread_cond_t *cond, FAR pthread_mutex_t *mutex, /* Start the watchdog */ wd_start(wdog, ticks, (wdentry_t)pthread_condtimedout, - 2, (uint32)mypid, (uint32)SIGCONDTIMEDOUT); + 2, (uint32_t)mypid, (uint32_t)SIGCONDTIMEDOUT); /* Take the condition semaphore. Do not restore interrupts * until we return from the wait. This is necessary to diff --git a/sched/pthread_condwait.c b/sched/pthread_condwait.c index 56f49d4ac0..38e3ddeb9b 100644 --- a/sched/pthread_condwait.c +++ b/sched/pthread_condwait.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_condwait.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,14 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_exit.c b/sched/pthread_exit.c index e313b34ea8..c320bbb104 100644 --- a/sched/pthread_exit.c +++ b/sched/pthread_exit.c @@ -1,7 +1,7 @@ -/************************************************************ - * pthread_exit.c +/************************************************************************ + * sched/pthread_exit.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,13 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include #include @@ -47,31 +48,31 @@ #include #include "pthread_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: pthread_exit * * Description: @@ -85,7 +86,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ void pthread_exit(FAR void *exit_value) { diff --git a/sched/pthread_getspecific.c b/sched/pthread_getspecific.c index c3eec886fd..e0f606eaf3 100644 --- a/sched/pthread_getspecific.c +++ b/sched/pthread_getspecific.c @@ -1,7 +1,7 @@ -/************************************************************ - * pthread_getspecific.c +/************************************************************************ + * sched/pthread_getspecific.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,46 +31,46 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include #include #include #include + #include "os_internal.h" #include "pthread_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: pthread_getspecific * * Description: @@ -101,7 +101,7 @@ * may be called from a thread-specific data destructor * function. * - ************************************************************/ + ************************************************************************/ FAR void *pthread_getspecific(pthread_key_t key) { diff --git a/sched/pthread_initialize.c b/sched/pthread_initialize.c index 3cd715d8fa..8ba06e9b0f 100644 --- a/sched/pthread_initialize.c +++ b/sched/pthread_initialize.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_initialize.c + * sched/pthread_initialize.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + +#include #include #include + #include "pthread_internal.h" /**************************************************************************** @@ -71,7 +74,7 @@ sem_t g_join_semaphore; * allocated. */ -ubyte g_pthread_num_keys; +uint8_t g_pthread_num_keys; /**************************************************************************** * Private Variables diff --git a/sched/pthread_internal.h b/sched/pthread_internal.h index 8a417179d6..55d58d49f2 100644 --- a/sched/pthread_internal.h +++ b/sched/pthread_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** * pthread_internal.h * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ ****************************************************************************/ #include +#include #include #include @@ -64,7 +65,7 @@ struct join_s { FAR struct join_s *next; /* Implements link list */ - ubyte crefs; /* Reference count */ + uint8_t crefs; /* Reference count */ boolean started; /* TRUE: pthread started. */ boolean detached; /* TRUE: pthread_detached'ed */ boolean terminated; /* TRUE: detach'ed+exit'ed */ @@ -97,7 +98,7 @@ extern sem_t g_join_semaphore; * allocated. */ -extern ubyte g_pthread_num_keys; +extern uint8_t g_pthread_num_keys; /* Default pthread attributes */ diff --git a/sched/pthread_keycreate.c b/sched/pthread_keycreate.c index 402d0e6900..466cef84da 100644 --- a/sched/pthread_keycreate.c +++ b/sched/pthread_keycreate.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_keycreate.c + * sched/pthread_keycreate.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,10 +39,10 @@ #include -#include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_keydelete.c b/sched/pthread_keydelete.c index 9a53a5e5e7..397f06267d 100644 --- a/sched/pthread_keydelete.c +++ b/sched/pthread_keydelete.c @@ -1,7 +1,7 @@ -/************************************************************ - * pthread_keydelete.c +/************************************************************************ + * sched/pthread_keydelete.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,45 +31,45 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include #include #include #include + #include "pthread_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: pthread_key_delete * * Description: @@ -87,7 +87,7 @@ * * POSIX Compatibility: * - ************************************************************/ + ************************************************************************/ int pthread_key_delete(pthread_key_t key) { diff --git a/sched/pthread_kill.c b/sched/pthread_kill.c index bf6c42d339..171b309420 100644 --- a/sched/pthread_kill.c +++ b/sched/pthread_kill.c @@ -1,7 +1,7 @@ -/************************************************************ - * pthread_kill.c +/************************************************************************ + * sched/pthread_kill.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,23 +31,25 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include + +#include #include #include #include #include -/************************************************************ +/************************************************************************ * Global Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: pthread_kill * * Description: @@ -75,7 +77,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int pthread_kill(pthread_t thread, int signo) { diff --git a/sched/pthread_mutexattrdestroy.c b/sched/pthread_mutexattrdestroy.c index 72568e1333..64e6bbd759 100644 --- a/sched/pthread_mutexattrdestroy.c +++ b/sched/pthread_mutexattrdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_mutexattrdestroy.c + * sched/pthread_mutexattrdestroy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_mutexattrgetpshared.c b/sched/pthread_mutexattrgetpshared.c index 873e7ca2f2..a70417ceed 100644 --- a/sched/pthread_mutexattrgetpshared.c +++ b/sched/pthread_mutexattrgetpshared.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_mutexattrgetpshared.c + * sched/pthread_mutexattrgetpshared.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_mutexattrinit.c b/sched/pthread_mutexattrinit.c index b023bee3e8..6d155d4ca5 100644 --- a/sched/pthread_mutexattrinit.c +++ b/sched/pthread_mutexattrinit.c @@ -1,7 +1,7 @@ /**************************************************************************** * pthread_mutexattrinit.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_mutexattrsetpshared.c b/sched/pthread_mutexattrsetpshared.c index 7574240dfe..22b70e118d 100644 --- a/sched/pthread_mutexattrsetpshared.c +++ b/sched/pthread_mutexattrsetpshared.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_mutexattrsetpshared.c + * sched/pthread_mutexattrsetpshared.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_mutexdestroy.c b/sched/pthread_mutexdestroy.c index 2b994e664d..fa78fe82b5 100644 --- a/sched/pthread_mutexdestroy.c +++ b/sched/pthread_mutexdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_mutexdestroy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_mutexinit.c b/sched/pthread_mutexinit.c index 92591fac6d..60a095caf7 100644 --- a/sched/pthread_mutexinit.c +++ b/sched/pthread_mutexinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_mutexinit.c + * sched/pthread_mutexinit.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + +#include #include #include #include + #include "pthread_internal.h" /**************************************************************************** @@ -87,9 +90,9 @@ int pthread_mutex_init(FAR pthread_mutex_t *mutex, FAR pthread_mutexattr_t *attr { int pshared = 0; #ifdef CONFIG_MUTEX_TYPES - ubyte type = PTHREAD_MUTEX_DEFAULT; + uint8_t type = PTHREAD_MUTEX_DEFAULT; #endif - int ret = OK; + int ret = OK; int status; sdbg("mutex=0x%p attr=0x%p\n", mutex, attr); diff --git a/sched/pthread_mutexlock.c b/sched/pthread_mutexlock.c index d5156e4618..a56fd9d712 100644 --- a/sched/pthread_mutexlock.c +++ b/sched/pthread_mutexlock.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_mutexlock.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,14 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_mutextrylock.c b/sched/pthread_mutextrylock.c index b62a524968..24779cbf70 100644 --- a/sched/pthread_mutextrylock.c +++ b/sched/pthread_mutextrylock.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_mutextrylock.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/pthread_mutexunlock.c b/sched/pthread_mutexunlock.c index e985263117..90ed5e5378 100644 --- a/sched/pthread_mutexunlock.c +++ b/sched/pthread_mutexunlock.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/pthread_mutexunlock.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,14 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include #include + #include "pthread_internal.h" /**************************************************************************** diff --git a/sched/pthread_once.c b/sched/pthread_once.c index 011c186f07..b2db0ab5f4 100644 --- a/sched/pthread_once.c +++ b/sched/pthread_once.c @@ -1,7 +1,7 @@ /******************************************************************************** - * pthread_once.c + * sched/pthread_once.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -38,7 +38,7 @@ ********************************************************************************/ #include -#include + #include #include #include diff --git a/sched/pthread_setspecific.c b/sched/pthread_setspecific.c index 511e911164..b9f166d343 100644 --- a/sched/pthread_setspecific.c +++ b/sched/pthread_setspecific.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_setspecific.c + * sched/pthread_setspecific.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,6 @@ #include -#include #include #include #include diff --git a/sched/pthread_sigmask.c b/sched/pthread_sigmask.c index 02f318cea0..dac9219039 100644 --- a/sched/pthread_sigmask.c +++ b/sched/pthread_sigmask.c @@ -1,7 +1,7 @@ -/************************************************************ - * pthread_sigmask.c +/************************************************************************ + * sched/pthread_sigmask.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,43 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include #include #include -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: pthread_sigmask * * Description: @@ -93,7 +94,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset) { diff --git a/sched/sched_addblocked.c b/sched/sched_addblocked.c index 6b1ba36588..9231afa490 100644 --- a/sched/sched_addblocked.c +++ b/sched/sched_addblocked.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_addblocked.c +/************************************************************************ + * sched/sched_addblocked.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: sched_addblocked * * Description: @@ -84,7 +86,7 @@ * - The caller has established a critical section before * calling this function. * - ************************************************************/ + ************************************************************************/ void sched_addblocked(FAR _TCB *btcb, tstate_t task_state) { diff --git a/sched/sched_addprioritized.c b/sched/sched_addprioritized.c index 788b73263b..824dc32d65 100644 --- a/sched/sched_addprioritized.c +++ b/sched/sched_addprioritized.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_addprioritized.c +/************************************************************************ + * sched/sched_addprioritized.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,45 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include +#include + +#include #include #include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sched_addprioritized * * Description: @@ -89,13 +92,13 @@ * the head of the task list is changed. * - The caller must set the task_state field of the TCB to * match the state associated with the list. - ************************************************************/ + ************************************************************************/ boolean sched_addprioritized(FAR _TCB *tcb, DSEG dq_queue_t *list) { FAR _TCB *next; FAR _TCB *prev; - ubyte sched_priority = tcb->sched_priority; + uint8_t sched_priority = tcb->sched_priority; boolean ret = FALSE; /* Lets do a sanity check before we get started. */ diff --git a/sched/sched_addreadytorun.c b/sched/sched_addreadytorun.c index be33daa2eb..503d15f985 100644 --- a/sched/sched_addreadytorun.c +++ b/sched/sched_addreadytorun.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sched_addreadytorun.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include + #include "os_internal.h" /**************************************************************************** diff --git a/sched/sched_free.c b/sched/sched_free.c index afa5e62c91..998f5458ce 100644 --- a/sched/sched_free.c +++ b/sched/sched_free.c @@ -38,7 +38,6 @@ ************************************************************************/ #include -#include #include #include diff --git a/sched/sched_garbage.c b/sched/sched_garbage.c index 66c7bafae6..7c9f434a1b 100755 --- a/sched/sched_garbage.c +++ b/sched/sched_garbage.c @@ -38,7 +38,6 @@ ****************************************************************************/ #include -#include #include diff --git a/sched/sched_getprioritymax.c b/sched/sched_getprioritymax.c index 683d276609..1476d0918b 100644 --- a/sched/sched_getprioritymax.c +++ b/sched/sched_getprioritymax.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_getprioritymax.c +/************************************************************************ + * sched/sched_getprioritymax.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,46 +31,47 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include + #include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: ched_get_priority_max * * Description: @@ -86,7 +87,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int sched_get_priority_max(int policy) { diff --git a/sched/sched_getprioritymin.c b/sched/sched_getprioritymin.c index c57b22f6b5..731290135d 100644 --- a/sched/sched_getprioritymin.c +++ b/sched/sched_getprioritymin.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_getprioritymin.c +/************************************************************************ + * sched/sched_getprioritymin.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,46 +31,47 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include + #include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: sched_get_priority_min * * Description: @@ -86,7 +87,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int sched_get_priority_min(int policy) { diff --git a/sched/sched_lock.c b/sched/sched_lock.c index 5cddc436e6..2dd4062030 100644 --- a/sched/sched_lock.c +++ b/sched/sched_lock.c @@ -38,9 +38,10 @@ ************************************************************************/ #include -#include + #include #include + #include #include "os_internal.h" diff --git a/sched/sched_lockcount.c b/sched/sched_lockcount.c index 8db9b116b1..476deac9d7 100644 --- a/sched/sched_lockcount.c +++ b/sched/sched_lockcount.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_lockcount.c +/************************************************************************ + * sched/sched_lockcount.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -31,45 +31,47 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include + +#include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functionss - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: sched_lockcount * * Description: @@ -84,10 +86,10 @@ * Return Value: * lockcount * - ************************************************************/ + ************************************************************************/ -sint32 sched_lockcount(void) +int32_t sched_lockcount(void) { _TCB *rtcb = (_TCB*)g_readytorun.head; - return (sint32)rtcb->lockcount; + return (int32_t)rtcb->lockcount; } diff --git a/sched/sched_mergepending.c b/sched/sched_mergepending.c index ab61db6efb..c45010e8c0 100644 --- a/sched/sched_mergepending.c +++ b/sched/sched_mergepending.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_mergepending.c +/************************************************************************ + * sched/sched_mergepending.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sched_mergepending * * Description: @@ -86,7 +88,7 @@ * - The caller handles the condition that occurs if the * the head of the sched_mergTSTATE_TASK_PENDINGs is changed. * - ************************************************************/ + ************************************************************************/ boolean sched_mergepending(void) { diff --git a/sched/sched_processtimer.c b/sched/sched_processtimer.c index 6cbca47765..5ca89d4fbd 100644 --- a/sched/sched_processtimer.c +++ b/sched/sched_processtimer.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_processtimer.c +/************************************************************************ + * sched/sched_processtimer.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,19 +31,18 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Compilation Switches - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include #include -#include #if CONFIG_RR_INTERVAL > 0 # include @@ -54,25 +53,25 @@ #include "wd_internal.h" #include "clock_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ static void sched_process_timeslice(void) { @@ -136,19 +135,19 @@ static void sched_process_timeslice(void) #endif } -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * System Timer Hooks * * These are standard interfaces that are exported by the OS * for use by the architecture specific logic * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: sched_process_timer * * Description: @@ -164,7 +163,7 @@ static void sched_process_timeslice(void) * Return Value: * None * - ************************************************************/ + ************************************************************************/ void sched_process_timer(void) { diff --git a/sched/sched_releasetcb.c b/sched/sched_releasetcb.c index cd8e9c8c32..2be77b77be 100644 --- a/sched/sched_releasetcb.c +++ b/sched/sched_releasetcb.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_releasetcb.c +/************************************************************************ + * sched/sched_releasetcb.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,33 +31,33 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ - * Compilation Switches - ************************************************************/ - -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ +#include + +#include #include #include #include + #include "os_internal.h" #include "timer_internal.h" #include "env_internal.h" -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: sched_releasepid * * Description: When a task is destroyed, this function must * be called to make its process ID available for re-use. - ************************************************************/ + ************************************************************************/ static void sched_releasepid(pid_t pid) { @@ -72,11 +72,11 @@ static void sched_releasepid(pid_t pid) g_pidhash[hash_ndx].pid = INVALID_PROCESS_ID; } -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sched_releasetcb * * Description: @@ -91,7 +91,7 @@ static void sched_releasepid(pid_t pid) * Assumptions: * Interrupts are disabled. * - ************************************************************/ + ************************************************************************/ int sched_releasetcb(FAR _TCB *tcb) { diff --git a/sched/sched_removeblocked.c b/sched/sched_removeblocked.c index 79e8a3e757..6e2987fb66 100644 --- a/sched/sched_removeblocked.c +++ b/sched/sched_removeblocked.c @@ -1,7 +1,7 @@ -/************************************************************ - * sched_removeblocked.c +/************************************************************************ + * sched/sched_removeblocked.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,46 +31,48 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Compilation Switches - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include + #include "os_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Name: sched_removeblocked * * Description: @@ -88,7 +90,7 @@ * - The caller has established a critical section before * calling this function. * - ************************************************************/ + ************************************************************************/ void sched_removeblocked(FAR _TCB *btcb) { diff --git a/sched/sched_removereadytorun.c b/sched/sched_removereadytorun.c index ee848e8f04..f09b5fc991 100644 --- a/sched/sched_removereadytorun.c +++ b/sched/sched_removereadytorun.c @@ -1,7 +1,7 @@ /**************************************************************************** * shced/sched_removereadytorun.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include + #include "os_internal.h" /**************************************************************************** diff --git a/sched/sched_reprioritize.c b/sched/sched_reprioritize.c index c9e1651047..86385f9494 100644 --- a/sched/sched_reprioritize.c +++ b/sched/sched_reprioritize.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#include + #include #include @@ -115,7 +115,7 @@ int sched_reprioritize(FAR _TCB *tcb, int sched_priority) * to once it posts the semaphore. */ - tcb->base_priority = (ubyte)sched_priority; + tcb->base_priority = (uint8_t)sched_priority; /* Discard any pending reprioritizations as well */ diff --git a/sched/sched_setpriority.c b/sched/sched_setpriority.c index a071a72593..522fc602f0 100644 --- a/sched/sched_setpriority.c +++ b/sched/sched_setpriority.c @@ -38,10 +38,11 @@ ****************************************************************************/ #include -#include + #include #include #include + #include "os_internal.h" /**************************************************************************** @@ -140,7 +141,7 @@ int sched_setpriority(FAR _TCB *tcb, int sched_priority) { /* A context switch will occur. */ - up_reprioritize_rtr(tcb, (ubyte)sched_priority); + up_reprioritize_rtr(tcb, (uint8_t)sched_priority); } /* Otherwise, we can just change priority since it has no effect */ @@ -149,7 +150,7 @@ int sched_setpriority(FAR _TCB *tcb, int sched_priority) { /* Change the task priority */ - tcb->sched_priority = (ubyte)sched_priority; + tcb->sched_priority = (uint8_t)sched_priority; } break; @@ -167,7 +168,7 @@ int sched_setpriority(FAR _TCB *tcb, int sched_priority) { /* A context switch will occur. */ - up_reprioritize_rtr(tcb, (ubyte)sched_priority); + up_reprioritize_rtr(tcb, (uint8_t)sched_priority); } /* Otherwise, we can just change priority and re-schedule (since it @@ -182,7 +183,7 @@ int sched_setpriority(FAR _TCB *tcb, int sched_priority) /* Change the task priority */ - tcb->sched_priority = (ubyte)sched_priority; + tcb->sched_priority = (uint8_t)sched_priority; /* Put it back into the ready-to-run task list */ @@ -205,7 +206,7 @@ int sched_setpriority(FAR _TCB *tcb, int sched_priority) /* Change the task priority */ - tcb->sched_priority = (ubyte)sched_priority; + tcb->sched_priority = (uint8_t)sched_priority; /* Put it back into the prioritized list at the correct * position @@ -220,7 +221,7 @@ int sched_setpriority(FAR _TCB *tcb, int sched_priority) { /* Just change the task's priority */ - tcb->sched_priority = (ubyte)sched_priority; + tcb->sched_priority = (uint8_t)sched_priority; } break; } diff --git a/sched/sched_setupidlefiles.c b/sched/sched_setupidlefiles.c index abe5e0d320..e88d75e127 100644 --- a/sched/sched_setupidlefiles.c +++ b/sched/sched_setupidlefiles.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sched_setupidlefiles.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,6 @@ #include -#include #include #include #include diff --git a/sched/sched_unlock.c b/sched/sched_unlock.c index 1d56b07e75..302aea6b7b 100644 --- a/sched/sched_unlock.c +++ b/sched/sched_unlock.c @@ -38,8 +38,9 @@ ************************************************************************/ #include -#include + #include + #include "os_internal.h" /************************************************************************ diff --git a/sched/sched_verifytcb.c b/sched/sched_verifytcb.c index 21810940ee..5b91e77d23 100644 --- a/sched/sched_verifytcb.c +++ b/sched/sched_verifytcb.c @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include +#include + #include + #include "os_internal.h" /**************************************************************************** diff --git a/sched/sched_yield.c b/sched/sched_yield.c index 79a8515ed1..a7af4c7878 100644 --- a/sched/sched_yield.c +++ b/sched/sched_yield.c @@ -38,8 +38,9 @@ ****************************************************************************/ #include -#include + #include + #include "os_internal.h" /**************************************************************************** diff --git a/sched/sem_close.c b/sched/sem_close.c index 4589695b61..c6e934c1ba 100644 --- a/sched/sem_close.c +++ b/sched/sem_close.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sem_close.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "os_internal.h" #include "sem_internal.h" diff --git a/sched/sem_destroy.c b/sched/sem_destroy.c index 3a96fcef9d..a0a7ca3d17 100644 --- a/sched/sem_destroy.c +++ b/sched/sem_destroy.c @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include +#include + #include + #include "sem_internal.h" /**************************************************************************** diff --git a/sched/sem_findnamed.c b/sched/sem_findnamed.c index f626da42d6..1c80bdf9a4 100644 --- a/sched/sem_findnamed.c +++ b/sched/sem_findnamed.c @@ -1,7 +1,7 @@ -/************************************************************ +/************************************************************************ * sem_findnamed.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,45 +31,47 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include + #include "sem_internal.h" -/************************************************************ +/************************************************************************ * Compilation Switches - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sem_findnamed * * Description: @@ -82,7 +84,7 @@ * Return Value: * Pointer to the semaphore or NULL if not found * - ************************************************************/ + ************************************************************************/ FAR nsem_t *sem_findnamed(const char *name) { diff --git a/sched/sem_getvalue.c b/sched/sem_getvalue.c index f320f92c06..4bed5ab3e3 100644 --- a/sched/sem_getvalue.c +++ b/sched/sem_getvalue.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sem_getvalue.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include +#include + #include + #include "sem_internal.h" /**************************************************************************** diff --git a/sched/sem_holder.c b/sched/sem_holder.c index 66ee2592af..c2e7d34473 100644 --- a/sched/sem_holder.c +++ b/sched/sem_holder.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/sem_init.c b/sched/sem_init.c index 65707949fe..6717714f54 100644 --- a/sched/sem_init.c +++ b/sched/sem_init.c @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include + #include "sem_internal.h" /**************************************************************************** @@ -97,7 +99,7 @@ int sem_init (FAR sem_t *sem, int pshared, unsigned int value) if (sem && value <= SEM_VALUE_MAX) { - sem->semcount = (sint16)value; + sem->semcount = (int16_t)value; #ifdef CONFIG_PRIORITY_INHERITANCE #if CONFIG_SEM_PREALLOCHOLDERS > 0 sem->hlist.flink = NULL; diff --git a/sched/sem_initialize.c b/sched/sem_initialize.c index f61d71f238..a355571fde 100644 --- a/sched/sem_initialize.c +++ b/sched/sem_initialize.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include "sem_internal.h" diff --git a/sched/sem_internal.h b/sched/sem_internal.h index 1fa1b9c812..31037d930c 100644 --- a/sched/sem_internal.h +++ b/sched/sem_internal.h @@ -33,18 +33,19 @@ * ****************************************************************************/ -#ifndef __SEM_INTERNAL_H -#define __SEM_INTERNAL_H +#ifndef __SCHED_SEM_INTERNAL_H +#define __SCHED_SEM_INTERNAL_H /**************************************************************************** * Included Files ****************************************************************************/ -#include +#include +#include + #include #include #include -#include /**************************************************************************** * Definitions @@ -60,7 +61,7 @@ struct nsem_s { FAR struct nsem_s *flink; /* Forward link */ FAR struct nsem_s *blink; /* Backward link */ - uint16 nconnect; /* Number of connections to semaphore */ + uint16_t nconnect; /* Number of connections to semaphore */ FAR char *name; /* Semaphore name (NULL if un-named) */ boolean unlinked; /* TRUE if the semaphore has been unlinked */ sem_t sem; /* The semaphore itself */ @@ -113,5 +114,5 @@ EXTERN void sem_canceled(FAR sem_t *sem); } #endif -#endif /* __SEM_INTERNAL_H */ +#endif /* __SCHED_SEM_INTERNAL_H */ diff --git a/sched/sem_post.c b/sched/sem_post.c index bed58f6bcb..b29cdfb157 100644 --- a/sched/sem_post.c +++ b/sched/sem_post.c @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include + #include "os_internal.h" #include "sem_internal.h" diff --git a/sched/sem_trywait.c b/sched/sem_trywait.c index 70b23cc4e2..03c1ea0626 100644 --- a/sched/sem_trywait.c +++ b/sched/sem_trywait.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sem_trywait.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include #include + #include "os_internal.h" #include "sem_internal.h" diff --git a/sched/sem_unlink.c b/sched/sem_unlink.c index b1bc1571a2..4a53a1da6b 100644 --- a/sched/sem_unlink.c +++ b/sched/sem_unlink.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sem_unlink.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "os_internal.h" #include "sem_internal.h" diff --git a/sched/sem_wait.c b/sched/sem_wait.c index 94622ae373..f723b72150 100644 --- a/sched/sem_wait.c +++ b/sched/sem_wait.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/sem_waitirq.c b/sched/sem_waitirq.c index e5572acb17..9113c475c7 100644 --- a/sched/sem_waitirq.c +++ b/sched/sem_waitirq.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sem_waitirq.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "sem_internal.h" /**************************************************************************** diff --git a/sched/sig_action.c b/sched/sig_action.c index 53e3782970..28956bb41a 100644 --- a/sched/sig_action.c +++ b/sched/sig_action.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_action.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "os_internal.h" #include "sig_internal.h" @@ -216,7 +218,7 @@ int sigaction(int signo, FAR const struct sigaction *act, FAR struct sigaction * { /* Put the signal number in the queue entry */ - sigact->signo = (ubyte)signo; + sigact->signo = (uint8_t)signo; /* Add the new sigaction to sigactionq */ diff --git a/sched/sig_allocatependingsigaction.c b/sched/sig_allocatependingsigaction.c index 5356058cfa..3294a0ab8d 100644 --- a/sched/sig_allocatependingsigaction.c +++ b/sched/sig_allocatependingsigaction.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_allocatependingsigaction.c +/************************************************************************ + * sched/sig_allocatependingsigaction.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,49 +31,51 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include #include + #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_allocatependingsigaction * * Description: * Allocate a new element for the pending signal action queue - ************************************************************/ + ************************************************************************/ FAR sigq_t *sig_allocatependingsigaction(void) { diff --git a/sched/sig_cleanup.c b/sched/sig_cleanup.c index 019e7fbe50..7fb0d1a9c4 100644 --- a/sched/sig_cleanup.c +++ b/sched/sig_cleanup.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_cleanup.c +/************************************************************************ + * sched/sig_cleanup.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,43 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include +#include #include + #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_cleanup * * Description: @@ -74,7 +75,7 @@ * is called only at task deletion time. The caller is * expected to have assured the critical section necessary * to perform this action. - ************************************************************/ + ************************************************************************/ void sig_cleanup(FAR _TCB *stcb) { diff --git a/sched/sig_findaction.c b/sched/sig_findaction.c index be5675d62f..6c9d7386f3 100644 --- a/sched/sig_findaction.c +++ b/sched/sig_findaction.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_findaction.c +/************************************************************************ + * sched/sig_findaction.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,46 +31,46 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include +#include #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_findaction * * Description: * Allocate a new element for a signal queue * - ************************************************************/ + ************************************************************************/ FAR sigactq_t *sig_findaction(FAR _TCB *stcb, int signo) { diff --git a/sched/sig_initialize.c b/sched/sig_initialize.c index d3bd108604..a0e7627441 100644 --- a/sched/sig_initialize.c +++ b/sched/sig_initialize.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_initialize.c +/************************************************************************ + * sched/sig_initialize.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,29 +31,32 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ -#include +#include + +#include #include #include + #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ /* The g_sigfreeaction data structure is a list of available * signal action structures. */ @@ -86,9 +89,9 @@ sq_queue_t g_sigpendingsignal; sq_queue_t g_sigpendingirqsignal; -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ /* g_sigactionalloc is a pointer to the start of the * allocated blocks of signal actions. @@ -120,30 +123,30 @@ static sigpendq_t *g_sigpendingsignalalloc; static sigpendq_t *g_sigpendingirqsignalalloc; -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16 nsigs, - ubyte sigtype); +static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs, + uint8_t sigtype); static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist, - uint16 nsigs, ubyte sigtype); + uint16_t nsigs, uint8_t sigtype); -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_allocateblock * * Description: * Allocate a block of pending signal actions and place them * on the free list. * - ************************************************************/ + ************************************************************************/ -static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16 nsigs, - ubyte sigtype) +static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16_t nsigs, + uint8_t sigtype) { sigq_t *sigqalloc; sigq_t *sigq; @@ -163,16 +166,16 @@ static sigq_t *sig_allocateblock(sq_queue_t *siglist, uint16 nsigs, return sigqalloc; } -/************************************************************ +/************************************************************************ * Function: sig_allocatependingsignalblock * * Description: * Allocate a block of pending signal structures and place them * on the free list. - ************************************************************/ + ************************************************************************/ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist, - uint16 nsigs, ubyte sigtype) + uint16_t nsigs, uint8_t sigtype) { sigpendq_t *sigpendalloc; sigpendq_t *sigpend; @@ -193,16 +196,16 @@ static sigpendq_t *sig_allocatependingsignalblock(sq_queue_t *siglist, return sigpendalloc; } -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_initialize * * Description: * Perform one-time power-up initialization - ************************************************************/ + ************************************************************************/ void sig_initialize(void) { @@ -234,13 +237,13 @@ void sig_initialize(void) SIG_ALLOC_IRQ); } -/************************************************************ +/************************************************************************ * Function: sig_allocateactionblock * * Description: * Allocate a block of signal actions and place them * on the free list. - ************************************************************/ + ************************************************************************/ void sig_allocateactionblock(void) { diff --git a/sched/sig_internal.h b/sched/sig_internal.h index b202ebfb48..054ff76507 100644 --- a/sched/sig_internal.h +++ b/sched/sig_internal.h @@ -77,7 +77,7 @@ struct sigactq { FAR struct sigactq *flink; /* Forward link */ struct sigaction act; /* Sigaction data */ - ubyte signo; /* Signal associated with action */ + uint8_t signo; /* Signal associated with action */ }; typedef struct sigactq sigactq_t; @@ -91,7 +91,7 @@ struct sigpendq { FAR struct sigpendq *flink; /* Forward link */ siginfo_t info; /* Signal information */ - ubyte type; /* (Used to manage allocations) */ + uint8_t type; /* (Used to manage allocations) */ }; typedef struct sigpendq sigpendq_t; @@ -109,7 +109,7 @@ struct sigq_s sigset_t mask; /* Additional signals to mask while the * the signal-catching functin executes */ siginfo_t info; /* Signal information */ - ubyte type; /* (Used to manage allocations) */ + uint8_t type; /* (Used to manage allocations) */ }; typedef struct sigq_s sigq_t; diff --git a/sched/sig_kill.c b/sched/sig_kill.c index 421fe77824..7d36ac4b13 100644 --- a/sched/sig_kill.c +++ b/sched/sig_kill.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_kill.c +/************************************************************************ + * sched/sig_kill.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,24 +31,27 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include + +#include #include #include #include + #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Global Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: kill * * Description: @@ -81,7 +84,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int kill(pid_t pid, int signo) { diff --git a/sched/sig_lowest.c b/sched/sig_lowest.c index 7cbf9c1fe7..cb009a706d 100644 --- a/sched/sig_lowest.c +++ b/sched/sig_lowest.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_lowest.c +/************************************************************************ + * sched/sig_lowest.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,46 +31,48 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include + #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_lowest * * Description: * - ************************************************************/ + ************************************************************************/ int sig_lowest(sigset_t *set) { diff --git a/sched/sig_mqnotempty.c b/sched/sig_mqnotempty.c index ca2e7b49ad..a9f05e28b2 100644 --- a/sched/sig_mqnotempty.c +++ b/sched/sig_mqnotempty.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_mqnotempty.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ +#include #include -#include + #include #include #include + #include "os_internal.h" #include "sig_internal.h" diff --git a/sched/sig_pending.c b/sched/sig_pending.c index 36f242ba4b..1c60210504 100644 --- a/sched/sig_pending.c +++ b/sched/sig_pending.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_pending.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include + #include "os_internal.h" #include "sig_internal.h" diff --git a/sched/sig_procmask.c b/sched/sig_procmask.c index fcfbd43c38..00ef539047 100644 --- a/sched/sig_procmask.c +++ b/sched/sig_procmask.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_procmask.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include @@ -47,6 +48,7 @@ #include #include #include + #include "os_internal.h" #include "sig_internal.h" diff --git a/sched/sig_queue.c b/sched/sig_queue.c index d0b421b9ba..3bb35c5647 100644 --- a/sched/sig_queue.c +++ b/sched/sig_queue.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_queue.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ #include #include -#include + #include #include #include diff --git a/sched/sig_received.c b/sched/sig_received.c index 8856cd0f6f..775d36df1e 100644 --- a/sched/sig_received.c +++ b/sched/sig_received.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_received.c +/************************************************************************ + * sched/sig_received.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,15 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include #include #include #include @@ -52,33 +51,33 @@ #include "sig_internal.h" #include "mq_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_queueaction * * Description: * Queue a signal action for delivery to a task. * - ************************************************************/ + ************************************************************************/ static int sig_queueaction(FAR _TCB *stcb, siginfo_t *info) { @@ -125,13 +124,13 @@ static int sig_queueaction(FAR _TCB *stcb, siginfo_t *info) return ret; } -/************************************************************ +/************************************************************************ * Function: sig_findpendingsignal * * Description: * Find a specified element in the pending signal list * - ************************************************************/ + ************************************************************************/ static FAR sigpendq_t *sig_findpendingsignal(FAR _TCB *stcb, int signo) { @@ -157,13 +156,13 @@ static FAR sigpendq_t *sig_findpendingsignal(FAR _TCB *stcb, int signo) return sigpend; } -/************************************************************ +/************************************************************************ * Function: sig_allocatependingsignal * * Description: * Allocate a pending signal list entry * - ************************************************************/ + ************************************************************************/ static FAR sigpendq_t *sig_allocatependingsignal(void) { @@ -219,7 +218,7 @@ static FAR sigpendq_t *sig_allocatependingsignal(void) return sigpend; } -/************************************************************ +/************************************************************************ * Function: sig_addpendingsignal * * Description: @@ -227,7 +226,7 @@ static FAR sigpendq_t *sig_allocatependingsignal(void) * NOTE: This function will queue only one entry for each * pending signal. This was done intentionally so that a * run-away sender cannot consume all of memory. - ************************************************************/ + ************************************************************************/ static FAR sigpendq_t *sig_addpendingsignal(FAR _TCB *stcb, siginfo_t *info) { @@ -268,11 +267,11 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR _TCB *stcb, siginfo_t *info) return sigpend; } -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_received * * Description: @@ -285,7 +284,7 @@ static FAR sigpendq_t *sig_addpendingsignal(FAR _TCB *stcb, siginfo_t *info) * - Unblocking tasks that are waiting for signals * - Queuing pending signals. * - ************************************************************/ + ************************************************************************/ int sig_received(FAR _TCB *stcb, siginfo_t *info) { @@ -300,7 +299,7 @@ int sig_received(FAR _TCB *stcb, siginfo_t *info) { ret = OK; - /****** MASKED SIGNAL HANDLING ******/ + /****************** MASKED SIGNAL HANDLING ******************/ /* Check if the signal is masked -- if it is, it will be added to the * list of pending signals. @@ -337,7 +336,7 @@ int sig_received(FAR _TCB *stcb, siginfo_t *info) } } - /****** UNMASKED SIGNAL HANDLING ******/ + /****************** UNMASKED SIGNAL HANDLING ******************/ else { @@ -370,7 +369,7 @@ int sig_received(FAR _TCB *stcb, siginfo_t *info) * simply to ignore the signal */ - /****** OTHER SIGNAL HANDLING ******/ + /****************** OTHER SIGNAL HANDLING ******************/ /* If the task is blocked waiting for a semaphore, then that * task must be unblocked when a signal is received. diff --git a/sched/sig_releasependingsigaction.c b/sched/sig_releasependingsigaction.c index 9ddedc711f..f486bf708b 100644 --- a/sched/sig_releasependingsigaction.c +++ b/sched/sig_releasependingsigaction.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_releasependingsigaction.c +/************************************************************************ + * sched/sig_releasependingsigaction.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,48 +31,50 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include + #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_releasependingsigaction * * Description: * Deallocate a pending signal action Q entry * - ************************************************************/ + ************************************************************************/ void sig_releasependingsigaction(FAR sigq_t *sigq) { diff --git a/sched/sig_releasependingsignal.c b/sched/sig_releasependingsignal.c index 0c5a745958..4059b9bbe4 100644 --- a/sched/sig_releasependingsignal.c +++ b/sched/sig_releasependingsignal.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_releasependingsignal.c +/************************************************************************ + * sched/sig_releasependingsignal.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,13 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include #include @@ -50,36 +51,36 @@ #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_releasependingsignal * * Description: * Deallocate a pending signal list entry - ************************************************************/ + ************************************************************************/ void sig_releasependingsignal(FAR sigpendq_t *sigpend) { diff --git a/sched/sig_removependingsignal.c b/sched/sig_removependingsignal.c index 7ee9752fcf..37c829dfe2 100644 --- a/sched/sig_removependingsignal.c +++ b/sched/sig_removependingsignal.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_removependingsignal.c +/************************************************************************ + * sched/sig_removependingsignal.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,13 +31,14 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include #include @@ -50,36 +51,36 @@ #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_removependingsignal * * Description: * Remove the specified signal from the signal pending list - ************************************************************/ + ************************************************************************/ FAR sigpendq_t *sig_removependingsignal(FAR _TCB *stcb, int signo) { diff --git a/sched/sig_suspend.c b/sched/sig_suspend.c index 1551952004..4b6190266e 100644 --- a/sched/sig_suspend.c +++ b/sched/sig_suspend.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sig_suspend.c + * sched/sig_suspend.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include diff --git a/sched/sig_timedwait.c b/sched/sig_timedwait.c index 0fe35a0690..dbbf444dcc 100644 --- a/sched/sig_timedwait.c +++ b/sched/sig_timedwait.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_timedwait.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,9 @@ * Included Files ****************************************************************************/ -#include +#include + +#include #include #include #include @@ -78,10 +80,10 @@ * ****************************************************************************/ -static void sig_timeout(int argc, uint32 itcb) +static void sig_timeout(int argc, uint32_t itcb) { /* On many small machines, pointers are encoded and cannot be simply cast - * from uint32 to _TCB*. The following union works around this + * from uint32_t to _TCB*. The following union works around this * (see wdogparm_t). This odd logic could be conditioned on * CONFIG_CAN_CAST_POINTERS, but it is not too bad in any case. */ @@ -89,7 +91,7 @@ static void sig_timeout(int argc, uint32 itcb) union { FAR _TCB *wtcb; - uint32 itcb; + uint32_t itcb; } u; u.itcb = itcb; @@ -163,7 +165,7 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, FAR sigpendq_t *sigpend; WDOG_ID wdog; irqstate_t saved_state; - sint32 waitticks; + int32_t waitticks; int ret = ERROR; sched_lock(); /* Not necessary */ @@ -234,7 +236,7 @@ int sigtimedwait(FAR const sigset_t *set, FAR struct siginfo *info, if (wdog) { /* This little of nonsense is necessary for some - * processors where sizeof(pointer) < sizeof(uint32). + * processors where sizeof(pointer) < sizeof(uint32_t). * see wdog.h. */ diff --git a/sched/sig_unmaskpendingsignal.c b/sched/sig_unmaskpendingsignal.c index 77892dfc98..27b405b5b9 100644 --- a/sched/sig_unmaskpendingsignal.c +++ b/sched/sig_unmaskpendingsignal.c @@ -1,7 +1,7 @@ -/************************************************************ - * sig_unmaskpendingsignal.c +/************************************************************************ + * sched/sig_unmaskpendingsignal.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,42 +31,44 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include + #include "os_internal.h" #include "sig_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Function Prototypes - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: sig_unmaskpendingsignal * * Description: @@ -74,7 +76,7 @@ * function unmasks and processes any pending signals. This * function should be called whenever the sigprocmask is * changed. - ************************************************************/ + ************************************************************************/ void sig_unmaskpendingsignal(void) { diff --git a/sched/sig_waitinfo.c b/sched/sig_waitinfo.c index fd218535c1..50f06a136e 100644 --- a/sched/sig_waitinfo.c +++ b/sched/sig_waitinfo.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/sig_waitinfo.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include /**************************************************************************** diff --git a/sched/sleep.c b/sched/sleep.c index 238211812f..bf586acd93 100644 --- a/sched/sleep.c +++ b/sched/sleep.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include diff --git a/sched/task_activate.c b/sched/task_activate.c index 12038960f3..8e4b8b0808 100644 --- a/sched/task_activate.c +++ b/sched/task_activate.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include -#include + #include #include #include diff --git a/sched/task_deletecurrent.c b/sched/task_deletecurrent.c index 4de621b2ad..0945282c45 100644 --- a/sched/task_deletecurrent.c +++ b/sched/task_deletecurrent.c @@ -39,7 +39,6 @@ #include -#include #include #include "os_internal.h" #ifndef CONFIG_DISABLE_SIGNALS diff --git a/sched/task_init.c b/sched/task_init.c index 6c70bf4351..98b12fb5c7 100644 --- a/sched/task_init.c +++ b/sched/task_init.c @@ -38,7 +38,9 @@ ****************************************************************************/ #include + #include +#include #include #include @@ -109,7 +111,7 @@ #ifndef CONFIG_CUSTOM_STACK int task_init(FAR _TCB *tcb, const char *name, int priority, - FAR uint32 *stack, uint32 stack_size, + FAR uint32_t *stack, uint32_t stack_size, main_t entry, const char *argv[]) #else int task_init(FAR _TCB *tcb, const char *name, int priority, diff --git a/sched/task_setup.c b/sched/task_setup.c index f54796e590..d7da288e7c 100644 --- a/sched/task_setup.c +++ b/sched/task_setup.c @@ -218,10 +218,10 @@ int task_schedsetup(FAR _TCB *tcb, int priority, start_t start, main_t main) { /* Save task priority and entry point in the TCB */ - tcb->init_priority = (ubyte)priority; - tcb->sched_priority = (ubyte)priority; + tcb->init_priority = (uint8_t)priority; + tcb->sched_priority = (uint8_t)priority; #ifdef CONFIG_PRIORITY_INHERITANCE - tcb->base_priority = (ubyte)priority; + tcb->base_priority = (uint8_t)priority; #endif tcb->start = start; tcb->entry.main = main; diff --git a/sched/task_start.c b/sched/task_start.c index 72e96516e2..add6409e7a 100644 --- a/sched/task_start.c +++ b/sched/task_start.c @@ -1,5 +1,5 @@ /**************************************************************************** - * task_start.c + * sched/task_start.c * * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt @@ -38,10 +38,11 @@ ****************************************************************************/ #include -#include + #include #include #include + #include "os_internal.h" /**************************************************************************** diff --git a/sched/timer_create.c b/sched/timer_create.c index a616e35215..4394095fca 100644 --- a/sched/timer_create.c +++ b/sched/timer_create.c @@ -76,7 +76,7 @@ static struct posix_timer_s *timer_allocate(void) { struct posix_timer_s *ret; irqstate_t flags; - ubyte pt_flags; + uint8_t pt_flags; /* Try to get a preallocated timer from the free list */ diff --git a/sched/timer_initialize.c b/sched/timer_initialize.c index af430fd581..10856d8006 100644 --- a/sched/timer_initialize.c +++ b/sched/timer_initialize.c @@ -38,10 +38,13 @@ ********************************************************************************/ #include +#include + +#include #include #include #include -#include + #include "timer_internal.h" #ifndef CONFIG_DISABLE_POSIX_TIMERS diff --git a/sched/timer_internal.h b/sched/timer_internal.h index 39946a8d32..41676ef5a7 100644 --- a/sched/timer_internal.h +++ b/sched/timer_internal.h @@ -61,9 +61,9 @@ struct posix_timer_s { FAR struct posix_timer_s *flink; - ubyte pt_flags; /* See PT_FLAGS_* definitions */ - ubyte pt_crefs; /* Reference count */ - ubyte pt_signo; /* Notification signal */ + uint8_t pt_flags; /* See PT_FLAGS_* definitions */ + uint8_t pt_crefs; /* Reference count */ + uint8_t pt_signo; /* Notification signal */ pid_t pt_owner; /* Creator of timer */ int pt_delay; /* If non-zero, used to reset repetitive timers */ int pt_last; /* Last value used to set watchdog */ diff --git a/sched/timer_settime.c b/sched/timer_settime.c index 1551ff3a76..6aceea27c5 100644 --- a/sched/timer_settime.c +++ b/sched/timer_settime.c @@ -38,6 +38,8 @@ ********************************************************************************/ #include + +#include #include #include #include @@ -66,8 +68,8 @@ ********************************************************************************/ static void inline timer_sigqueue(FAR struct posix_timer_s *timer); -static void inline timer_restart(FAR struct posix_timer_s *timer, uint32 itimer); -static void timer_timeout(int argc, uint32 itimer); +static void inline timer_restart(FAR struct posix_timer_s *timer, uint32_t itimer); +static void timer_timeout(int argc, uint32_t itimer); /******************************************************************************** * Private Functions @@ -135,7 +137,7 @@ static void inline timer_sigqueue(FAR struct posix_timer_s *timer) * ********************************************************************************/ -static void inline timer_restart(FAR struct posix_timer_s *timer, uint32 itimer) +static void inline timer_restart(FAR struct posix_timer_s *timer, uint32_t itimer) { /* If this is a repetitive timer, then restart the watchdog */ @@ -166,17 +168,17 @@ static void inline timer_restart(FAR struct posix_timer_s *timer, uint32 itimer) * ********************************************************************************/ -static void timer_timeout(int argc, uint32 itimer) +static void timer_timeout(int argc, uint32_t itimer) { #ifndef CONFIG_CAN_PASS_STRUCTS /* On many small machines, pointers are encoded and cannot be simply cast from - * uint32 to _TCB*. The following union works around this (see wdogparm_t). + * uint32_t to _TCB*. The following union works around this (see wdogparm_t). */ union { FAR struct posix_timer_s *timer; - uint32 itimer; + uint32_t itimer; } u; u.itimer = itimer; @@ -200,11 +202,11 @@ static void timer_timeout(int argc, uint32 itimer) timer_restart(u.timer, itimer); } #else - /* (casting to uintptr first eliminates complaints on some architectures - * where the sizeof uint32 is different from the size of a pointer). + /* (casting to uintptr_t first eliminates complaints on some architectures + * where the sizeof uint32_t is different from the size of a pointer). */ - FAR struct posix_timer_s *timer = (FAR struct posix_timer_s *)((uintptr)itimer); + FAR struct posix_timer_s *timer = (FAR struct posix_timer_s *)((uintptr_t)itimer); /* Send the specified signal to the specified task. Increment the reference * count on the timer first so that will not be deleted until after the @@ -383,7 +385,7 @@ int timer_settime(timer_t timerid, int flags, FAR const struct itimerspec *value if (delay > 0) { timer->pt_last = delay; - ret = wd_start(timer->pt_wdog, timer->pt_delay, (wdentry_t)timer_timeout, 1, (uint32)((uintptr)timer)); + ret = wd_start(timer->pt_wdog, timer->pt_delay, (wdentry_t)timer_timeout, 1, (uint32_t)((uintptr_t)timer)); } irqrestore(state); diff --git a/sched/wd_cancel.c b/sched/wd_cancel.c index acf957163c..f17e0d227c 100644 --- a/sched/wd_cancel.c +++ b/sched/wd_cancel.c @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "os_internal.h" #include "wd_internal.h" diff --git a/sched/wd_create.c b/sched/wd_create.c index dcd301a56e..296ff5c3dd 100644 --- a/sched/wd_create.c +++ b/sched/wd_create.c @@ -1,7 +1,7 @@ /**************************************************************************** * sched/wd_create.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include +#include + #include #include #include + #include "wd_internal.h" /**************************************************************************** diff --git a/sched/wd_delete.c b/sched/wd_delete.c index eebfc0dc88..3f39bf7233 100644 --- a/sched/wd_delete.c +++ b/sched/wd_delete.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include +#include #include #include diff --git a/sched/wd_gettime.c b/sched/wd_gettime.c index 40322e00a4..0d5a3a4708 100644 --- a/sched/wd_gettime.c +++ b/sched/wd_gettime.c @@ -1,7 +1,7 @@ /******************************************************************************** - * wd_gettime.c + * sched/wd_gettime.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -37,8 +37,10 @@ * Included Files ********************************************************************************/ -#include +#include + #include + #include "os_internal.h" #include "wd_internal.h" diff --git a/sched/wd_initialize.c b/sched/wd_initialize.c index a1d943079a..8553582e07 100644 --- a/sched/wd_initialize.c +++ b/sched/wd_initialize.c @@ -1,7 +1,7 @@ -/************************************************************ - * wd_initialize.c +/************************************************************************ + * sched/wd_initialize.c * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,29 +31,31 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ + +#include -#include #include #include + #include "os_internal.h" #include "wd_internal.h" -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Type Declarations - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Global Variables - ************************************************************/ + ************************************************************************/ /* The g_wdfreelist data structure is a singly linked list * of watchdogs available to the system for delayed function @@ -77,19 +79,19 @@ FAR wdog_t *g_wdpool; sq_queue_t g_wdactivelist; -/************************************************************ +/************************************************************************ * Private Variables - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Private Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: wd_initialize * * Description: @@ -106,7 +108,7 @@ sq_queue_t g_wdactivelist; * sequence before the timer interrupt is attached and * before any watchdog services are used. * - ************************************************************/ + ************************************************************************/ void wd_initialize(void) { diff --git a/sched/wd_internal.h b/sched/wd_internal.h index 216d82079b..c624674395 100644 --- a/sched/wd_internal.h +++ b/sched/wd_internal.h @@ -1,7 +1,7 @@ -/************************************************************ - * wd_internal.h +/************************************************************************ + * sched/d_internal.h * - * Copyright (C) 2007 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -14,7 +14,7 @@ * notice, this list of conditions and the following disclaimer in * the documentation and/or other materials provided with the * distribution. - * 3. Neither the name Gregory Nutt nor the names of its contributors may be + * 3. Neither the name NuttX nor the names of its contributors may be * used to endorse or promote products derived from this software * without specific prior written permission. * @@ -31,31 +31,31 @@ * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * POSSIBILITY OF SUCH DAMAGE. * - ************************************************************/ + ************************************************************************/ -#ifndef __WD_INTERNAL_H -#define __WD_INTERNAL_H +#ifndef __SCHED_WD_INTERNAL_H +#define __SCHED_WD_INTERNAL_H -/************************************************************ +/************************************************************************ * Included Files - ************************************************************/ + ************************************************************************/ #include -#include + #include #include -/************************************************************ +/************************************************************************ * Compilations Switches - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Definitions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Public Type Declarations - ************************************************************/ + ************************************************************************/ /* This is the watchdog structure. The WDOG_ID is a pointer to * a watchdog structure. @@ -70,14 +70,14 @@ struct wdog_s #endif int lag; /* Timer associated with the delay */ boolean active; /* TRUE if the watchdog is actively timing */ - ubyte argc; /* The number of parameters to pass */ - uint32 parm[CONFIG_MAX_WDOGPARMS]; + uint8_t argc; /* The number of parameters to pass */ + uint32_t parm[CONFIG_MAX_WDOGPARMS]; }; typedef struct wdog_s wdog_t; -/************************************************************ +/************************************************************************ * Public Variables - ************************************************************/ + ************************************************************************/ /* The g_wdfreelist data structure is a singly linked list * of watchdogs available to the system for delayed function @@ -101,9 +101,9 @@ extern FAR wdog_t *g_wdpool; extern sq_queue_t g_wdactivelist; -/************************************************************ +/************************************************************************ * Public Function Prototypes - ************************************************************/ + ************************************************************************/ #ifdef __cplusplus #define EXTERN extern "C" @@ -120,4 +120,4 @@ EXTERN void weak_function wd_timer(void); } #endif -#endif /* __WD_INTERNAL_H */ +#endif /* __SCHED_WD_INTERNAL_H */ diff --git a/sched/wd_start.c b/sched/wd_start.c index 39525c0bc5..31bc3bea0c 100644 --- a/sched/wd_start.c +++ b/sched/wd_start.c @@ -39,6 +39,7 @@ #include +#include #include #include #include @@ -60,18 +61,18 @@ typedef void (*wdentry0_t)(int argc); #if CONFIG_MAX_WDOGPARMS > 0 -typedef void (*wdentry1_t)(int argc, uint32 arg1); +typedef void (*wdentry1_t)(int argc, uint32_t arg1); #endif #if CONFIG_MAX_WDOGPARMS > 1 -typedef void (*wdentry2_t)(int argc, uint32 arg1, uint32 arg2); +typedef void (*wdentry2_t)(int argc, uint32_t arg1, uint32_t arg2); #endif #if CONFIG_MAX_WDOGPARMS > 2 -typedef void (*wdentry3_t)(int argc, uint32 arg1, uint32 arg2, - uint32 arg3); +typedef void (*wdentry3_t)(int argc, uint32_t arg1, uint32_t arg2, + uint32_t arg3); #endif #if CONFIG_MAX_WDOGPARMS > 3 -typedef void (*wdentry4_t)(int argc, uint32 arg1, uint32 arg2, - uint32 arg3, uint32 arg4); +typedef void (*wdentry4_t)(int argc, uint32_t arg1, uint32_t arg2, + uint32_t arg3, uint32_t arg4); #endif /**************************************************************************** @@ -131,7 +132,7 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) FAR wdog_t *curr; FAR wdog_t *prev; FAR wdog_t *next; - sint32 now; + int32_t now; irqstate_t saved_state; int i; @@ -164,7 +165,7 @@ int wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, int argc, ...) va_start(ap, argc); for (i = 0; i < argc; i++) { - wdog->parm[i] = va_arg(ap, uint32); + wdog->parm[i] = va_arg(ap, uint32_t); } #ifdef CONFIG_DEBUG for (; i < CONFIG_MAX_WDOGPARMS; i++) diff --git a/sched/work_cancel.c b/sched/work_cancel.c index 92393dec33..9ef43994b9 100755 --- a/sched/work_cancel.c +++ b/sched/work_cancel.c @@ -38,7 +38,6 @@ ****************************************************************************/ #include -#include #include #include diff --git a/sched/work_internal.h b/sched/work_internal.h index c0b371b73a..8405778593 100755 --- a/sched/work_internal.h +++ b/sched/work_internal.h @@ -41,7 +41,6 @@ ****************************************************************************/ #include -#include #include #ifdef CONFIG_SCHED_WORKQUEUE diff --git a/sched/work_queue.c b/sched/work_queue.c index 144c321781..aa4d48889d 100755 --- a/sched/work_queue.c +++ b/sched/work_queue.c @@ -38,8 +38,8 @@ ****************************************************************************/ #include -#include +#include #include #include #include @@ -104,7 +104,7 @@ * ****************************************************************************/ -int work_queue(struct work_s *work, worker_t worker, FAR void *arg, uint32 delay) +int work_queue(struct work_s *work, worker_t worker, FAR void *arg, uint32_t delay) { irqstate_t flags; diff --git a/sched/work_thread.c b/sched/work_thread.c index 1a772b6186..56673c9f0b 100755 --- a/sched/work_thread.c +++ b/sched/work_thread.c @@ -38,8 +38,8 @@ ****************************************************************************/ #include -#include +#include #include #include #include @@ -103,9 +103,9 @@ int work_thread(int argc, char *argv[]) volatile FAR struct work_s *work; worker_t worker; FAR void *arg; - uint32 elapsed; - uint32 remaining; - uint32 next; + uint32_t elapsed; + uint32_t remaining; + uint32_t next; int usec; irqstate_t flags;