diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-14 18:39:29 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-12-14 18:39:29 +0000 |
commit | 59f367c060c408a9c9f2ee6db3a4fd498c4a2724 (patch) | |
tree | 80d034ca2b741e6d5b074758c5285f804f772c66 /nuttx/sched | |
parent | 24bdea23f746984480bd59dd13dd4d631a210320 (diff) | |
download | px4-nuttx-59f367c060c408a9c9f2ee6db3a4fd498c4a2724.tar.gz px4-nuttx-59f367c060c408a9c9f2ee6db3a4fd498c4a2724.tar.bz2 px4-nuttx-59f367c060c408a9c9f2ee6db3a4fd498c4a2724.zip |
Switching to C99 stdint.h types
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2336 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched')
152 files changed, 1328 insertions, 1151 deletions
diff --git a/nuttx/sched/atexit.c b/nuttx/sched/atexit.c index 9feb4ce9a..2920a3618 100644 --- a/nuttx/sched/atexit.c +++ b/nuttx/sched/atexit.c @@ -37,7 +37,6 @@ * Included Files ************************************************************/ -#include <sys/types.h> #include <stdlib.h> #include <assert.h> #include <unistd.h> diff --git a/nuttx/sched/clock_abstime2ticks.c b/nuttx/sched/clock_abstime2ticks.c index b93fb8eac..c8be4b1b1 100644 --- a/nuttx/sched/clock_abstime2ticks.c +++ b/nuttx/sched/clock_abstime2ticks.c @@ -38,7 +38,7 @@ ********************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <time.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/clock_getres.c b/nuttx/sched/clock_getres.c index 821941ba2..467802f27 100644 --- a/nuttx/sched/clock_getres.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <time.h> #include <errno.h> #include <debug.h> + #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/nuttx/sched/clock_gettime.c b/nuttx/sched/clock_gettime.c index 68c8b6492..6b8ac8c79 100644 --- a/nuttx/sched/clock_gettime.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <time.h> #include <errno.h> #include <debug.h> + #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/nuttx/sched/clock_gettimeofday.c b/nuttx/sched/clock_gettimeofday.c index ccc6fc9b3..54c44f753 100644 --- a/nuttx/sched/clock_gettimeofday.c +++ b/nuttx/sched/clock_gettimeofday.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> #include <sys/time.h> #include <errno.h> diff --git a/nuttx/sched/clock_initialize.c b/nuttx/sched/clock_initialize.c index e63ba1dea..baddc3136 100644 --- a/nuttx/sched/clock_initialize.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> @@ -38,8 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <time.h> #include <errno.h> #include <debug.h> @@ -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/nuttx/sched/clock_internal.h b/nuttx/sched/clock_internal.h index 7d1dbb629..008bdcd3c 100644 --- a/nuttx/sched/clock_internal.h +++ b/nuttx/sched/clock_internal.h @@ -41,7 +41,6 @@ ********************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <nuttx/clock.h> #include <nuttx/compiler.h> @@ -58,7 +57,7 @@ ********************************************************************************/ extern struct timespec g_basetime; -extern uint32 g_tickbias; +extern uint32_t g_tickbias; /******************************************************************************** * Public Function Prototypes diff --git a/nuttx/sched/clock_settime.c b/nuttx/sched/clock_settime.c index 605199c18..989ed50cd 100644 --- a/nuttx/sched/clock_settime.c +++ b/nuttx/sched/clock_settime.c @@ -37,7 +37,8 @@ * Included Files ************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <time.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/clock_ticks2time.c b/nuttx/sched/clock_ticks2time.c index 154756a6f..fe2165d68 100644 --- a/nuttx/sched/clock_ticks2time.c +++ b/nuttx/sched/clock_ticks2time.c @@ -38,7 +38,7 @@ ********************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <time.h> #include "clock_internal.h" diff --git a/nuttx/sched/clock_time2ticks.c b/nuttx/sched/clock_time2ticks.c index 5414dfe75..beba5014c 100644 --- a/nuttx/sched/clock_time2ticks.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> #include <time.h> + #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/nuttx/sched/env_dup.c b/nuttx/sched/env_dup.c index 671b8ea7b..4627393bb 100644 --- a/nuttx/sched/env_dup.c +++ b/nuttx/sched/env_dup.c @@ -41,6 +41,7 @@ #ifndef CONFIG_DISABLE_ENVIRON +#include <sys/types.h> #include <sched.h> #include <string.h> #include <errno.h> diff --git a/nuttx/sched/env_dupenv.c b/nuttx/sched/env_dupenv.c index 748af878c..164dbe713 100644 --- a/nuttx/sched/env_dupenv.c +++ b/nuttx/sched/env_dupenv.c @@ -41,6 +41,7 @@ #ifndef CONFIG_DISABLE_ENVIRON +#include <sys/types.h> #include <sched.h> #include <stdlib.h> #include "os_internal.h" diff --git a/nuttx/sched/exit.c b/nuttx/sched/exit.c index 564c1bb6c..5302dade6 100644 --- a/nuttx/sched/exit.c +++ b/nuttx/sched/exit.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <stdlib.h> #include <unistd.h> #include <debug.h> diff --git a/nuttx/sched/irq_attach.c b/nuttx/sched/irq_attach.c index 02063438f..5ccb77ce1 100644 --- a/nuttx/sched/irq_attach.c +++ b/nuttx/sched/irq_attach.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> #include <nuttx/irq.h> #include "irq_internal.h" diff --git a/nuttx/sched/irq_dispatch.c b/nuttx/sched/irq_dispatch.c index c8c3c7bda..4b2447cbf 100644 --- a/nuttx/sched/irq_dispatch.c +++ b/nuttx/sched/irq_dispatch.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <debug.h> #include <nuttx/arch.h> #include <nuttx/irq.h> diff --git a/nuttx/sched/irq_initialize.c b/nuttx/sched/irq_initialize.c index ea0870375..91e812644 100644 --- a/nuttx/sched/irq_initialize.c +++ b/nuttx/sched/irq_initialize.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> #include <nuttx/arch.h> #include <nuttx/irq.h> #include "irq_internal.h" diff --git a/nuttx/sched/irq_internal.h b/nuttx/sched/irq_internal.h index 8dce13792..4d180ec12 100644 --- a/nuttx/sched/irq_internal.h +++ b/nuttx/sched/irq_internal.h @@ -40,7 +40,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <nuttx/arch.h> #include <nuttx/irq.h> #include <nuttx/compiler.h> diff --git a/nuttx/sched/irq_unexpectedisr.c b/nuttx/sched/irq_unexpectedisr.c index 272e5d3ea..e00e534a3 100644 --- a/nuttx/sched/irq_unexpectedisr.c +++ b/nuttx/sched/irq_unexpectedisr.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> #include <nuttx/irq.h> #include <debug.h> #include "os_internal.h" diff --git a/nuttx/sched/mq_close.c b/nuttx/sched/mq_close.c index 15d2272a0..06b81fb5e 100644 --- a/nuttx/sched/mq_close.c +++ b/nuttx/sched/mq_close.c @@ -37,7 +37,8 @@ * Included Files ************************************************************/ -#include <sys/types.h> /* uint32, etc. */ +#include <nuttx/config.h> + #include <mqueue.h> #include <sched.h> #include "os_internal.h" diff --git a/nuttx/sched/mq_descreate.c b/nuttx/sched/mq_descreate.c index 47b9397d5..c8a0cfeae 100644 --- a/nuttx/sched/mq_descreate.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,6 +37,8 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> + #include <stdarg.h> /* va_list */ #include <unistd.h> #include <string.h> @@ -48,7 +50,6 @@ #include "os_internal.h" #include "sig_internal.h" -#include <sys/types.h> /* uint32, etc. */ #include <queue.h> #include <nuttx/kmalloc.h> #include "mq_internal.h" diff --git a/nuttx/sched/mq_findnamed.c b/nuttx/sched/mq_findnamed.c index a74caba7b..851052e28 100644 --- a/nuttx/sched/mq_findnamed.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <string.h> #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/nuttx/sched/mq_getattr.c b/nuttx/sched/mq_getattr.c index 71f2a87df..e788d6e71 100644 --- a/nuttx/sched/mq_getattr.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <stdarg.h> /* va_list */ #include <unistd.h> #include <string.h> @@ -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/nuttx/sched/mq_initialize.c b/nuttx/sched/mq_initialize.c index df8e981e6..fdc5dbb00 100644 --- a/nuttx/sched/mq_initialize.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> /* uint32, etc. */ +#include <nuttx/config.h> + +#include <stdinit.h> #include <queue.h> #include <nuttx/kmalloc.h> + #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/nuttx/sched/mq_internal.h b/nuttx/sched/mq_internal.h index 554b59884..e5dc3ea3f 100644 --- a/nuttx/sched/mq_internal.h +++ b/nuttx/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/nuttx/sched/mq_msgfree.c b/nuttx/sched/mq_msgfree.c index f7a236f15..8147dd518 100644 --- a/nuttx/sched/mq_msgfree.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> @@ -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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <queue.h> #include <nuttx/arch.h> #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/nuttx/sched/mq_msgqfree.c b/nuttx/sched/mq_msgqfree.c index 06d5da815..74ba3d441 100644 --- a/nuttx/sched/mq_msgqfree.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <debug.h> #include <nuttx/kmalloc.h> #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/nuttx/sched/mq_notify.c b/nuttx/sched/mq_notify.c index b01a2d7c7..f491f653a 100644 --- a/nuttx/sched/mq_notify.c +++ b/nuttx/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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <signal.h> #include <mqueue.h> #include <sched.h> #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/nuttx/sched/mq_open.c b/nuttx/sched/mq_open.c index 2179178d0..4780d396b 100644 --- a/nuttx/sched/mq_open.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> /* uint32, etc. */ -#include <stdarg.h> /* va_list */ +#include <nuttx/config.h> + +#include <sys/types.h> +#include <stdarg.h> #include <mqueue.h> #include <fcntl.h> #include <string.h> @@ -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/nuttx/sched/mq_setattr.c b/nuttx/sched/mq_setattr.c index f0eca4eae..4a74e3549 100644 --- a/nuttx/sched/mq_setattr.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <fcntl.h> /* O_NONBLOCK */ #include <mqueue.h> #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/nuttx/sched/mq_sndinternal.c b/nuttx/sched/mq_sndinternal.c index e81d5ae4f..8755603f8 100644 --- a/nuttx/sched/mq_sndinternal.c +++ b/nuttx/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/nuttx/sched/mq_timedreceive.c b/nuttx/sched/mq_timedreceive.c index fd8f0edd8..a13a8a632 100644 --- a/nuttx/sched/mq_timedreceive.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,13 +37,17 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> + #include <sys/types.h> +#include <stdint.h> #include <unistd.h> #include <errno.h> #include <mqueue.h> #include <wdog.h> #include <debug.h> #include <nuttx/arch.h> + #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/nuttx/sched/mq_timedsend.c b/nuttx/sched/mq_timedsend.c index b50cdcef3..7bdbbb7e1 100644 --- a/nuttx/sched/mq_timedsend.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -38,13 +38,16 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> +#include <stdint.h> #include <unistd.h> #include <mqueue.h> #include <wdog.h> #include <errno.h> #include <debug.h> #include <nuttx/arch.h> + #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/nuttx/sched/mq_unlink.c b/nuttx/sched/mq_unlink.c index 17b5767ae..7d77e266d 100644 --- a/nuttx/sched/mq_unlink.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> /* uint32, etc. */ #include <mqueue.h> #include <sched.h> #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/nuttx/sched/mq_waitirq.c b/nuttx/sched/mq_waitirq.c index 417aa84bf..f0f55c5e6 100644 --- a/nuttx/sched/mq_waitirq.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <sched.h> #include <errno.h> #include <nuttx/arch.h> diff --git a/nuttx/sched/os_internal.h b/nuttx/sched/os_internal.h index a7b55acfd..cda7dc61c 100644 --- a/nuttx/sched/os_internal.h +++ b/nuttx/sched/os_internal.h @@ -40,6 +40,8 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> +#include <sys/types.h> #include <queue.h> #include <sched.h> #include <nuttx/kmalloc.h> diff --git a/nuttx/sched/pthread_attrdestroy.c b/nuttx/sched/pthread_attrdestroy.c index bdacdab26..bfa1a49a9 100644 --- a/nuttx/sched/pthread_attrdestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <debug.h> diff --git a/nuttx/sched/pthread_attrgetinheritsched.c b/nuttx/sched/pthread_attrgetinheritsched.c index 367d9d6cf..7accfcdf7 100644 --- a/nuttx/sched/pthread_attrgetinheritsched.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <debug.h> diff --git a/nuttx/sched/pthread_attrgetschedparam.c b/nuttx/sched/pthread_attrgetschedparam.c index dd3303c46..513a941a3 100644 --- a/nuttx/sched/pthread_attrgetschedparam.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <sched.h> diff --git a/nuttx/sched/pthread_attrinit.c b/nuttx/sched/pthread_attrinit.c index 003cd8677..ed260aa83 100644 --- a/nuttx/sched/pthread_attrinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <debug.h> #include <errno.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_attrsetinheritsched.c b/nuttx/sched/pthread_attrsetinheritsched.c index c17703a5f..35b7ad425 100644 --- a/nuttx/sched/pthread_attrsetinheritsched.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <debug.h> #include <errno.h> + #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/nuttx/sched/pthread_attrsetschedparam.c b/nuttx/sched/pthread_attrsetschedparam.c index 9cf699cbf..cd806d72f 100644 --- a/nuttx/sched/pthread_attrsetschedparam.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <sched.h> diff --git a/nuttx/sched/pthread_attrsetschedpolicy.c b/nuttx/sched/pthread_attrsetschedpolicy.c index 73bfb7339..93756f070 100644 --- a/nuttx/sched/pthread_attrsetschedpolicy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <sched.h> diff --git a/nuttx/sched/pthread_attrsetstacksize.c b/nuttx/sched/pthread_attrsetstacksize.c index 7286441c7..659a35d47 100644 --- a/nuttx/sched/pthread_attrsetstacksize.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <string.h> #include <debug.h> #include <errno.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_barrierattrdestroy.c b/nuttx/sched/pthread_barrierattrdestroy.c index de20d16f6..813e95d8a 100644 --- a/nuttx/sched/pthread_barrierattrdestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/pthread_barrierattrgetpshared.c b/nuttx/sched/pthread_barrierattrgetpshared.c index 23cf43872..0e2cf30df 100644 --- a/nuttx/sched/pthread_barrierattrgetpshared.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/pthread_barrierattrinit.c b/nuttx/sched/pthread_barrierattrinit.c index b2787bd31..3a0d346f1 100644 --- a/nuttx/sched/pthread_barrierattrinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/pthread_barrierattrsetpshared.c b/nuttx/sched/pthread_barrierattrsetpshared.c index 2f1aee4f1..b13075791 100644 --- a/nuttx/sched/pthread_barrierattrsetpshared.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/pthread_barrierdestroy.c b/nuttx/sched/pthread_barrierdestroy.c index d4a33cc20..6720b9d99 100644 --- a/nuttx/sched/pthread_barrierdestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <semaphore.h> #include <errno.h> diff --git a/nuttx/sched/pthread_barrierinit.c b/nuttx/sched/pthread_barrierinit.c index bafb0794a..1d8dd00c3 100644 --- a/nuttx/sched/pthread_barrierinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <semaphore.h> #include <errno.h> diff --git a/nuttx/sched/pthread_barrierwait.c b/nuttx/sched/pthread_barrierwait.c index 14cfa2eb3..b8588aff0 100644 --- a/nuttx/sched/pthread_barrierwait.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <semaphore.h> #include <sched.h> diff --git a/nuttx/sched/pthread_cancel.c b/nuttx/sched/pthread_cancel.c index 8b8c36c99..ac28bb85a 100644 --- a/nuttx/sched/pthread_cancel.c +++ b/nuttx/sched/pthread_cancel.c @@ -37,9 +37,13 @@ * Included Files **************************************************************************/ +#include <nuttx/config.h> + +#include <sys/types.h> #include <unistd.h> #include <pthread.h> #include <errno.h> + #include "os_internal.h" #include "pthread_internal.h" diff --git a/nuttx/sched/pthread_condattrdestroy.c b/nuttx/sched/pthread_condattrdestroy.c index e1d4d41fd..99e261ce2 100644 --- a/nuttx/sched/pthread_condattrdestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <debug.h> #include <errno.h> diff --git a/nuttx/sched/pthread_condattrinit.c b/nuttx/sched/pthread_condattrinit.c index 4e9ca23d9..1e3746654 100644 --- a/nuttx/sched/pthread_condattrinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <config/nuttx.h> + #include <pthread.h> #include <debug.h> #include <errno.h> diff --git a/nuttx/sched/pthread_condbroadcast.c b/nuttx/sched/pthread_condbroadcast.c index 4cda2af70..5b69ea428 100644 --- a/nuttx/sched/pthread_condbroadcast.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <sched.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_conddestroy.c b/nuttx/sched/pthread_conddestroy.c index e473f7564..dc176af77 100644 --- a/nuttx/sched/pthread_conddestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <debug.h> #include <errno.h> diff --git a/nuttx/sched/pthread_condinit.c b/nuttx/sched/pthread_condinit.c index 6b9eebd5f..f341d28fa 100644 --- a/nuttx/sched/pthread_condinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <debug.h> #include <errno.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_condsignal.c b/nuttx/sched/pthread_condsignal.c index 771d9a769..a10dda6be 100644 --- a/nuttx/sched/pthread_condsignal.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_condtimedwait.c b/nuttx/sched/pthread_condtimedwait.c index 0a1bc7ca9..6abf7881d 100644 --- a/nuttx/sched/pthread_condtimedwait.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,9 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> #include <nuttx/compiler.h> -#include <sys/types.h> + #include <unistd.h> #include <pthread.h> #include <signal.h> @@ -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/nuttx/sched/pthread_condwait.c b/nuttx/sched/pthread_condwait.c index 56f49d4ac..38e3ddeb9 100644 --- a/nuttx/sched/pthread_condwait.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,14 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <unistd.h> #include <pthread.h> #include <sched.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_exit.c b/nuttx/sched/pthread_exit.c index e313b34ea..c320bbb10 100644 --- a/nuttx/sched/pthread_exit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <stdlib.h> #include <unistd.h> #include <signal.h> @@ -47,31 +48,31 @@ #include <nuttx/arch.h> #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/nuttx/sched/pthread_getspecific.c b/nuttx/sched/pthread_getspecific.c index c3eec886f..e0f606eaf 100644 --- a/nuttx/sched/pthread_getspecific.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <sched.h> #include <errno.h> #include <debug.h> + #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/nuttx/sched/pthread_initialize.c b/nuttx/sched/pthread_initialize.c index 3cd715d8f..8ba06e9b0 100644 --- a/nuttx/sched/pthread_initialize.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <semaphore.h> #include <errno.h> + #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/nuttx/sched/pthread_internal.h b/nuttx/sched/pthread_internal.h index 8a417179d..55d58d49f 100644 --- a/nuttx/sched/pthread_internal.h +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -41,6 +41,7 @@ ****************************************************************************/ #include <sys/types.h> +#include <stdint.h> #include <pthread.h> #include <nuttx/compiler.h> @@ -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/nuttx/sched/pthread_keycreate.c b/nuttx/sched/pthread_keycreate.c index 402d0e690..466cef84d 100644 --- a/nuttx/sched/pthread_keycreate.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,10 +39,10 @@ #include <nuttx/config.h> -#include <sys/types.h> #include <sched.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_keydelete.c b/nuttx/sched/pthread_keydelete.c index 9a53a5e5e..397f06267 100644 --- a/nuttx/sched/pthread_keydelete.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <sched.h> #include <errno.h> #include <debug.h> + #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/nuttx/sched/pthread_kill.c b/nuttx/sched/pthread_kill.c index bf6c42d33..171b30942 100644 --- a/nuttx/sched/pthread_kill.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> + +#include <sys/types.h> #include <signal.h> #include <pthread.h> #include <errno.h> #include <debug.h> -/************************************************************ +/************************************************************************ * Global Functions - ************************************************************/ + ************************************************************************/ -/************************************************************ +/************************************************************************ * Function: pthread_kill * * Description: @@ -75,7 +77,7 @@ * * Assumptions: * - ************************************************************/ + ************************************************************************/ int pthread_kill(pthread_t thread, int signo) { diff --git a/nuttx/sched/pthread_mutexattrdestroy.c b/nuttx/sched/pthread_mutexattrdestroy.c index 72568e133..64e6bbd75 100644 --- a/nuttx/sched/pthread_mutexattrdestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_mutexattrgetpshared.c b/nuttx/sched/pthread_mutexattrgetpshared.c index 873e7ca2f..a70417cee 100644 --- a/nuttx/sched/pthread_mutexattrgetpshared.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_mutexattrinit.c b/nuttx/sched/pthread_mutexattrinit.c index b023bee3e..6d155d4ca 100644 --- a/nuttx/sched/pthread_mutexattrinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_mutexattrsetpshared.c b/nuttx/sched/pthread_mutexattrsetpshared.c index 7574240df..22b70e118 100644 --- a/nuttx/sched/pthread_mutexattrsetpshared.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_mutexdestroy.c b/nuttx/sched/pthread_mutexdestroy.c index 2b994e664..fa78fe82b 100644 --- a/nuttx/sched/pthread_mutexdestroy.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <pthread.h> #include <semaphore.h> #include <sched.h> diff --git a/nuttx/sched/pthread_mutexinit.c b/nuttx/sched/pthread_mutexinit.c index 92591fac6..60a095caf 100644 --- a/nuttx/sched/pthread_mutexinit.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,13 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <pthread.h> #include <errno.h> #include <debug.h> + #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/nuttx/sched/pthread_mutexlock.c b/nuttx/sched/pthread_mutexlock.c index d5156e461..a56fd9d71 100644 --- a/nuttx/sched/pthread_mutexlock.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,14 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <unistd.h> #include <pthread.h> #include <sched.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_mutextrylock.c b/nuttx/sched/pthread_mutextrylock.c index b62a52496..24779cbf7 100644 --- a/nuttx/sched/pthread_mutextrylock.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <unistd.h> #include <pthread.h> #include <semaphore.h> diff --git a/nuttx/sched/pthread_mutexunlock.c b/nuttx/sched/pthread_mutexunlock.c index e98526311..90ed5e537 100644 --- a/nuttx/sched/pthread_mutexunlock.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,12 +37,14 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <unistd.h> #include <pthread.h> #include <sched.h> #include <errno.h> #include <debug.h> + #include "pthread_internal.h" /**************************************************************************** diff --git a/nuttx/sched/pthread_once.c b/nuttx/sched/pthread_once.c index 011c186f0..b2db0ab5f 100644 --- a/nuttx/sched/pthread_once.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> + #include <pthread.h> #include <sched.h> #include <errno.h> diff --git a/nuttx/sched/pthread_setspecific.c b/nuttx/sched/pthread_setspecific.c index 511e91116..b9f166d34 100644 --- a/nuttx/sched/pthread_setspecific.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,6 @@ #include <nuttx/config.h> -#include <sys/types.h> #include <sched.h> #include <errno.h> #include <debug.h> diff --git a/nuttx/sched/pthread_sigmask.c b/nuttx/sched/pthread_sigmask.c index 02f318cea..dac921903 100644 --- a/nuttx/sched/pthread_sigmask.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <signal.h> #include <pthread.h> #include <errno.h> #include <debug.h> -/************************************************************ +/************************************************************************ * 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/nuttx/sched/sched_addblocked.c b/nuttx/sched/sched_addblocked.c index 6b1ba3658..9231afa49 100644 --- a/nuttx/sched/sched_addblocked.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #include <assert.h> + #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/nuttx/sched/sched_addprioritized.c b/nuttx/sched/sched_addprioritized.c index 788b73263..824dc32d6 100644 --- a/nuttx/sched/sched_addprioritized.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <queue.h> #include <assert.h> + #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/nuttx/sched/sched_addreadytorun.c b/nuttx/sched/sched_addreadytorun.c index be33daa2e..503d15f98 100644 --- a/nuttx/sched/sched_addreadytorun.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <queue.h> #include <assert.h> + #include "os_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sched_free.c b/nuttx/sched/sched_free.c index afa5e62c9..998f5458c 100644 --- a/nuttx/sched/sched_free.c +++ b/nuttx/sched/sched_free.c @@ -38,7 +38,6 @@ ************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #include <assert.h> diff --git a/nuttx/sched/sched_garbage.c b/nuttx/sched/sched_garbage.c index 66c7bafae..7c9f434a1 100755 --- a/nuttx/sched/sched_garbage.c +++ b/nuttx/sched/sched_garbage.c @@ -38,7 +38,6 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <stdlib.h> diff --git a/nuttx/sched/sched_getprioritymax.c b/nuttx/sched/sched_getprioritymax.c index 683d27660..1476d0918 100644 --- a/nuttx/sched/sched_getprioritymax.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> + #include <nuttx/arch.h> + #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/nuttx/sched/sched_getprioritymin.c b/nuttx/sched/sched_getprioritymin.c index c57b22f6b..731290135 100644 --- a/nuttx/sched/sched_getprioritymin.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> + #include <nuttx/arch.h> + #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/nuttx/sched/sched_lock.c b/nuttx/sched/sched_lock.c index 5cddc436e..2dd406203 100644 --- a/nuttx/sched/sched_lock.c +++ b/nuttx/sched/sched_lock.c @@ -38,9 +38,10 @@ ************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <assert.h> + #include <nuttx/arch.h> #include "os_internal.h" diff --git a/nuttx/sched/sched_lockcount.c b/nuttx/sched/sched_lockcount.c index 8db9b116b..476deac9d 100644 --- a/nuttx/sched/sched_lockcount.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> + +#include <stdint.h> + #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/nuttx/sched/sched_mergepending.c b/nuttx/sched/sched_mergepending.c index ab61db6ef..c45010e8c 100644 --- a/nuttx/sched/sched_mergepending.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #include <assert.h> + #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/nuttx/sched/sched_processtimer.c b/nuttx/sched/sched_processtimer.c index 6cbca4776..5ca89d4fb 100644 --- a/nuttx/sched/sched_processtimer.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> #include <nuttx/compiler.h> -#include <sys/types.h> #if CONFIG_RR_INTERVAL > 0 # include <sched.h> @@ -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/nuttx/sched/sched_releasetcb.c b/nuttx/sched/sched_releasetcb.c index cd8e9c8c3..2be77b77b 100644 --- a/nuttx/sched/sched_releasetcb.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> +#include <sys/types.h> #include <sched.h> #include <errno.h> #include <nuttx/arch.h> + #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/nuttx/sched/sched_removeblocked.c b/nuttx/sched/sched_removeblocked.c index 79e8a3e75..6e2987fb6 100644 --- a/nuttx/sched/sched_removeblocked.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #include <assert.h> + #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/nuttx/sched/sched_removereadytorun.c b/nuttx/sched/sched_removereadytorun.c index ee848e8f0..f09b5fc99 100644 --- a/nuttx/sched/sched_removereadytorun.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <queue.h> #include <assert.h> + #include "os_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sched_reprioritize.c b/nuttx/sched/sched_reprioritize.c index c9e165104..86385f949 100644 --- a/nuttx/sched/sched_reprioritize.c +++ b/nuttx/sched/sched_reprioritize.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <errno.h> @@ -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/nuttx/sched/sched_setpriority.c b/nuttx/sched/sched_setpriority.c index a071a7259..522fc602f 100644 --- a/nuttx/sched/sched_setpriority.c +++ b/nuttx/sched/sched_setpriority.c @@ -38,10 +38,11 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <errno.h> #include <nuttx/arch.h> + #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/nuttx/sched/sched_setupidlefiles.c b/nuttx/sched/sched_setupidlefiles.c index abe5e0d32..e88d75e12 100644 --- a/nuttx/sched/sched_setupidlefiles.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,6 @@ #include <nuttx/config.h> -#include <sys/types.h> #include <stdio.h> #include <unistd.h> #include <fcntl.h> diff --git a/nuttx/sched/sched_unlock.c b/nuttx/sched/sched_unlock.c index 1d56b07e7..302aea6b7 100644 --- a/nuttx/sched/sched_unlock.c +++ b/nuttx/sched/sched_unlock.c @@ -38,8 +38,9 @@ ************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <nuttx/arch.h> + #include "os_internal.h" /************************************************************************ diff --git a/nuttx/sched/sched_verifytcb.c b/nuttx/sched/sched_verifytcb.c index 21810940e..5b91e77d2 100644 --- a/nuttx/sched/sched_verifytcb.c +++ b/nuttx/sched/sched_verifytcb.c @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <sched.h> + #include "os_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sched_yield.c b/nuttx/sched/sched_yield.c index 79a8515ed..a7af4c787 100644 --- a/nuttx/sched/sched_yield.c +++ b/nuttx/sched/sched_yield.c @@ -38,8 +38,9 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <nuttx/arch.h> + #include "os_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sem_close.c b/nuttx/sched/sem_close.c index 4589695b6..c6e934c1b 100644 --- a/nuttx/sched/sem_close.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <errno.h> #include <semaphore.h> #include <sched.h> + #include "os_internal.h" #include "sem_internal.h" diff --git a/nuttx/sched/sem_destroy.c b/nuttx/sched/sem_destroy.c index 3a96fcef9..a0a7ca3d1 100644 --- a/nuttx/sched/sem_destroy.c +++ b/nuttx/sched/sem_destroy.c @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <semaphore.h> + #include "sem_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sem_findnamed.c b/nuttx/sched/sem_findnamed.c index f626da42d..1c80bdf9a 100644 --- a/nuttx/sched/sem_findnamed.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <string.h> + #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/nuttx/sched/sem_getvalue.c b/nuttx/sched/sem_getvalue.c index f320f92c0..4bed5ab3e 100644 --- a/nuttx/sched/sem_getvalue.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,8 +37,10 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <semaphore.h> + #include "sem_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sem_holder.c b/nuttx/sched/sem_holder.c index 66ee2592a..c2e7d3447 100644 --- a/nuttx/sched/sem_holder.c +++ b/nuttx/sched/sem_holder.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <semaphore.h> #include <sched.h> #include <assert.h> diff --git a/nuttx/sched/sem_init.c b/nuttx/sched/sem_init.c index 65707949f..6717714f5 100644 --- a/nuttx/sched/sem_init.c +++ b/nuttx/sched/sem_init.c @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <limits.h> #include <semaphore.h> + #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/nuttx/sched/sem_initialize.c b/nuttx/sched/sem_initialize.c index f61d71f23..a355571fd 100644 --- a/nuttx/sched/sem_initialize.c +++ b/nuttx/sched/sem_initialize.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <queue.h> #include "sem_internal.h" diff --git a/nuttx/sched/sem_internal.h b/nuttx/sched/sem_internal.h index 1fa1b9c81..31037d930 100644 --- a/nuttx/sched/sem_internal.h +++ b/nuttx/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 <sys/types.h> +#include <nuttx/config.h> +#include <nuttx/compiler.h> + #include <semaphore.h> #include <sched.h> #include <queue.h> -#include <nuttx/compiler.h> /**************************************************************************** * 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/nuttx/sched/sem_post.c b/nuttx/sched/sem_post.c index bed58f6bc..b29cdfb15 100644 --- a/nuttx/sched/sem_post.c +++ b/nuttx/sched/sem_post.c @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <limits.h> #include <semaphore.h> #include <sched.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "sem_internal.h" diff --git a/nuttx/sched/sem_trywait.c b/nuttx/sched/sem_trywait.c index 70b23cc4e..03c1ea062 100644 --- a/nuttx/sched/sem_trywait.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <semaphore.h> #include <sched.h> #include <errno.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "sem_internal.h" diff --git a/nuttx/sched/sem_unlink.c b/nuttx/sched/sem_unlink.c index b1bc1571a..4a53a1da6 100644 --- a/nuttx/sched/sem_unlink.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <semaphore.h> #include <sched.h> #include <queue.h> + #include "os_internal.h" #include "sem_internal.h" diff --git a/nuttx/sched/sem_wait.c b/nuttx/sched/sem_wait.c index 94622ae37..f723b7215 100644 --- a/nuttx/sched/sem_wait.c +++ b/nuttx/sched/sem_wait.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <semaphore.h> #include <errno.h> #include <assert.h> diff --git a/nuttx/sched/sem_waitirq.c b/nuttx/sched/sem_waitirq.c index e5572acb1..9113c475c 100644 --- a/nuttx/sched/sem_waitirq.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <sched.h> #include <errno.h> #include <nuttx/arch.h> + #include "sem_internal.h" /**************************************************************************** diff --git a/nuttx/sched/sig_action.c b/nuttx/sched/sig_action.c index 53e378297..28956bb41 100644 --- a/nuttx/sched/sig_action.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <signal.h> #include <queue.h> #include <sched.h> + #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/nuttx/sched/sig_allocatependingsigaction.c b/nuttx/sched/sig_allocatependingsigaction.c index 5356058cf..3294a0ab8 100644 --- a/nuttx/sched/sig_allocatependingsigaction.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <signal.h> #include <assert.h> #include <nuttx/arch.h> + #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/nuttx/sched/sig_cleanup.c b/nuttx/sched/sig_cleanup.c index 019e7fbe5..7fb0d1a9c 100644 --- a/nuttx/sched/sig_cleanup.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> #include <nuttx/arch.h> + #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/nuttx/sched/sig_findaction.c b/nuttx/sched/sig_findaction.c index be5675d62..6c9d7386f 100644 --- a/nuttx/sched/sig_findaction.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> #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/nuttx/sched/sig_initialize.c b/nuttx/sched/sig_initialize.c index d3bd10860..a0e762744 100644 --- a/nuttx/sched/sig_initialize.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <queue.h> #include <nuttx/kmalloc.h> + #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/nuttx/sched/sig_internal.h b/nuttx/sched/sig_internal.h index b202ebfb4..054ff7650 100644 --- a/nuttx/sched/sig_internal.h +++ b/nuttx/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/nuttx/sched/sig_kill.c b/nuttx/sched/sig_kill.c index 421fe7782..7d36ac4b1 100644 --- a/nuttx/sched/sig_kill.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> + +#include <sys/types.h> #include <sched.h> #include <errno.h> #include <debug.h> + #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/nuttx/sched/sig_lowest.c b/nuttx/sched/sig_lowest.c index 7cbf9c1fe..cb009a706 100644 --- a/nuttx/sched/sig_lowest.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <signal.h> + #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/nuttx/sched/sig_mqnotempty.c b/nuttx/sched/sig_mqnotempty.c index ca2e7b49a..a9f05e28b 100644 --- a/nuttx/sched/sig_mqnotempty.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,11 +37,13 @@ * Included Files ****************************************************************************/ +#include <nuttx/config.h> #include <nuttx/compiler.h> -#include <sys/types.h> + #include <signal.h> #include <sched.h> #include <debug.h> + #include "os_internal.h" #include "sig_internal.h" diff --git a/nuttx/sched/sig_pending.c b/nuttx/sched/sig_pending.c index 36f242ba4..1c6021050 100644 --- a/nuttx/sched/sig_pending.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,9 +37,11 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <signal.h> #include <sched.h> + #include "os_internal.h" #include "sig_internal.h" diff --git a/nuttx/sched/sig_procmask.c b/nuttx/sched/sig_procmask.c index fcfbd43c3..00ef53904 100644 --- a/nuttx/sched/sig_procmask.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <unistd.h> #include <signal.h> #include <time.h> @@ -47,6 +48,7 @@ #include <sched.h> #include <nuttx/kmalloc.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "sig_internal.h" diff --git a/nuttx/sched/sig_queue.c b/nuttx/sched/sig_queue.c index d0b421b9b..3bb35c564 100644 --- a/nuttx/sched/sig_queue.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,7 +39,7 @@ #include <nuttx/config.h> #include <nuttx/compiler.h> -#include <sys/types.h> + #include <signal.h> #include <debug.h> #include <sched.h> diff --git a/nuttx/sched/sig_received.c b/nuttx/sched/sig_received.c index 8856cd0f6..775d36df1 100644 --- a/nuttx/sched/sig_received.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <string.h> #include <signal.h> #include <unistd.h> @@ -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/nuttx/sched/sig_releasependingsigaction.c b/nuttx/sched/sig_releasependingsigaction.c index 9ddedc711..f486bf708 100644 --- a/nuttx/sched/sig_releasependingsigaction.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <sched.h> + #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/nuttx/sched/sig_releasependingsignal.c b/nuttx/sched/sig_releasependingsignal.c index 0c5a74595..4059b9bbe 100644 --- a/nuttx/sched/sig_releasependingsignal.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <unistd.h> #include <signal.h> #include <time.h> @@ -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/nuttx/sched/sig_removependingsignal.c b/nuttx/sched/sig_removependingsignal.c index 7ee9752fc..37c829dfe 100644 --- a/nuttx/sched/sig_removependingsignal.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <unistd.h> #include <signal.h> #include <time.h> @@ -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/nuttx/sched/sig_suspend.c b/nuttx/sched/sig_suspend.c index 155195200..4b6190266 100644 --- a/nuttx/sched/sig_suspend.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <signal.h> #include <assert.h> #include <debug.h> diff --git a/nuttx/sched/sig_timedwait.c b/nuttx/sched/sig_timedwait.c index 0fe35a069..dbbf444dc 100644 --- a/nuttx/sched/sig_timedwait.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,9 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + +#include <stdint.h> #include <string.h> #include <signal.h> #include <time.h> @@ -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/nuttx/sched/sig_unmaskpendingsignal.c b/nuttx/sched/sig_unmaskpendingsignal.c index 77892dfc9..27b405b5b 100644 --- a/nuttx/sched/sig_unmaskpendingsignal.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <sched.h> + #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/nuttx/sched/sig_waitinfo.c b/nuttx/sched/sig_waitinfo.c index fd218535c..50f06a136 100644 --- a/nuttx/sched/sig_waitinfo.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> #include <signal.h> /**************************************************************************** diff --git a/nuttx/sched/sleep.c b/nuttx/sched/sleep.c index 238211812..bf586acd9 100644 --- a/nuttx/sched/sleep.c +++ b/nuttx/sched/sleep.c @@ -37,7 +37,8 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <unistd.h> #include <signal.h> diff --git a/nuttx/sched/task_activate.c b/nuttx/sched/task_activate.c index 12038960f..8e4b8b080 100644 --- a/nuttx/sched/task_activate.c +++ b/nuttx/sched/task_activate.c @@ -38,7 +38,7 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <sched.h> #include <debug.h> #include <nuttx/arch.h> diff --git a/nuttx/sched/task_deletecurrent.c b/nuttx/sched/task_deletecurrent.c index 4de621b2a..0945282c4 100644 --- a/nuttx/sched/task_deletecurrent.c +++ b/nuttx/sched/task_deletecurrent.c @@ -39,7 +39,6 @@ #include <nuttx/config.h> -#include <sys/types.h> #include <sched.h> #include "os_internal.h" #ifndef CONFIG_DISABLE_SIGNALS diff --git a/nuttx/sched/task_init.c b/nuttx/sched/task_init.c index 6c70bf435..98b12fb5c 100644 --- a/nuttx/sched/task_init.c +++ b/nuttx/sched/task_init.c @@ -38,7 +38,9 @@ ****************************************************************************/ #include <nuttx/config.h> + #include <sys/types.h> +#include <stdint.h> #include <sched.h> #include <nuttx/arch.h> @@ -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/nuttx/sched/task_setup.c b/nuttx/sched/task_setup.c index f54796e59..d7da288e7 100644 --- a/nuttx/sched/task_setup.c +++ b/nuttx/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/nuttx/sched/task_start.c b/nuttx/sched/task_start.c index 72e96516e..add6409e7 100644 --- a/nuttx/sched/task_start.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> @@ -38,10 +38,11 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> + #include <stdlib.h> #include <sched.h> #include <debug.h> + #include "os_internal.h" /**************************************************************************** diff --git a/nuttx/sched/timer_create.c b/nuttx/sched/timer_create.c index a616e3521..4394095fc 100644 --- a/nuttx/sched/timer_create.c +++ b/nuttx/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/nuttx/sched/timer_initialize.c b/nuttx/sched/timer_initialize.c index af430fd58..10856d800 100644 --- a/nuttx/sched/timer_initialize.c +++ b/nuttx/sched/timer_initialize.c @@ -38,10 +38,13 @@ ********************************************************************************/ #include <nuttx/config.h> +#include <nuttx/compiler.h> + +#include <sys/types.h> #include <time.h> #include <queue.h> #include <errno.h> -#include <nuttx/compiler.h> + #include "timer_internal.h" #ifndef CONFIG_DISABLE_POSIX_TIMERS diff --git a/nuttx/sched/timer_internal.h b/nuttx/sched/timer_internal.h index 39946a8d3..41676ef5a 100644 --- a/nuttx/sched/timer_internal.h +++ b/nuttx/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/nuttx/sched/timer_settime.c b/nuttx/sched/timer_settime.c index 1551ff3a7..6aceea27c 100644 --- a/nuttx/sched/timer_settime.c +++ b/nuttx/sched/timer_settime.c @@ -38,6 +38,8 @@ ********************************************************************************/ #include <nuttx/config.h> + +#include <stdint.h> #include <time.h> #include <string.h> #include <errno.h> @@ -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/nuttx/sched/wd_cancel.c b/nuttx/sched/wd_cancel.c index acf957163..f17e0d227 100644 --- a/nuttx/sched/wd_cancel.c +++ b/nuttx/sched/wd_cancel.c @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <assert.h> #include <wdog.h> #include <nuttx/arch.h> + #include "os_internal.h" #include "wd_internal.h" diff --git a/nuttx/sched/wd_create.c b/nuttx/sched/wd_create.c index dcd301a56..296ff5c3d 100644 --- a/nuttx/sched/wd_create.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -37,10 +37,12 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> + #include <wdog.h> #include <queue.h> #include <nuttx/arch.h> + #include "wd_internal.h" /**************************************************************************** diff --git a/nuttx/sched/wd_delete.c b/nuttx/sched/wd_delete.c index eebfc0dc8..3f39bf723 100644 --- a/nuttx/sched/wd_delete.c +++ b/nuttx/sched/wd_delete.c @@ -37,7 +37,7 @@ * Included Files ****************************************************************************/ -#include <sys/types.h> +#include <nuttx/config.h> #include <wdog.h> #include <queue.h> diff --git a/nuttx/sched/wd_gettime.c b/nuttx/sched/wd_gettime.c index 40322e00a..0d5a3a470 100644 --- a/nuttx/sched/wd_gettime.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <sys/types.h> +#include <nuttx/config.h> + #include <wdog.h> + #include "os_internal.h" #include "wd_internal.h" diff --git a/nuttx/sched/wd_initialize.c b/nuttx/sched/wd_initialize.c index a1d943079..8553582e0 100644 --- a/nuttx/sched/wd_initialize.c +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #include <nuttx/kmalloc.h> + #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/nuttx/sched/wd_internal.h b/nuttx/sched/wd_internal.h index 216d82079..c62467439 100644 --- a/nuttx/sched/wd_internal.h +++ b/nuttx/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 <spudmonkey@racsa.co.cr> * * 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 <nuttx/config.h> -#include <sys/types.h> + #include <wdog.h> #include <nuttx/compiler.h> -/************************************************************ +/************************************************************************ * 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/nuttx/sched/wd_start.c b/nuttx/sched/wd_start.c index 39525c0bc..31bc3bea0 100644 --- a/nuttx/sched/wd_start.c +++ b/nuttx/sched/wd_start.c @@ -39,6 +39,7 @@ #include <sys/types.h> +#include <stdint.h> #include <stdarg.h> #include <wdog.h> #include <unistd.h> @@ -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/nuttx/sched/work_cancel.c b/nuttx/sched/work_cancel.c index 92393dec3..9ef43994b 100755 --- a/nuttx/sched/work_cancel.c +++ b/nuttx/sched/work_cancel.c @@ -38,7 +38,6 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #include <assert.h> diff --git a/nuttx/sched/work_internal.h b/nuttx/sched/work_internal.h index c0b371b73..840577859 100755 --- a/nuttx/sched/work_internal.h +++ b/nuttx/sched/work_internal.h @@ -41,7 +41,6 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> #include <queue.h> #ifdef CONFIG_SCHED_WORKQUEUE diff --git a/nuttx/sched/work_queue.c b/nuttx/sched/work_queue.c index 144c32178..aa4d48889 100755 --- a/nuttx/sched/work_queue.c +++ b/nuttx/sched/work_queue.c @@ -38,8 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <queue.h> #include <assert.h> #include <errno.h> @@ -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/nuttx/sched/work_thread.c b/nuttx/sched/work_thread.c index 1a772b618..56673c9f0 100755 --- a/nuttx/sched/work_thread.c +++ b/nuttx/sched/work_thread.c @@ -38,8 +38,8 @@ ****************************************************************************/ #include <nuttx/config.h> -#include <sys/types.h> +#include <stdint.h> #include <unistd.h> #include <queue.h> #include <assert.h> @@ -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; |