diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-31 01:42:50 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2011-03-31 01:42:50 +0000 |
commit | fd57b2a0da0473e878eb1c2abef05de3be7c2e2d (patch) | |
tree | 942c9e6714349eb61faa27c17a71cf2c689cb65a | |
parent | 2d6e5ff6c4450662ffc8d1d8d2f46da0155d6905 (diff) | |
download | px4-nuttx-fd57b2a0da0473e878eb1c2abef05de3be7c2e2d.tar.gz px4-nuttx-fd57b2a0da0473e878eb1c2abef05de3be7c2e2d.tar.bz2 px4-nuttx-fd57b2a0da0473e878eb1c2abef05de3be7c2e2d.zip |
Move more files into subdirectories under lib/
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3445 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r-- | nuttx/ChangeLog | 5 | ||||
-rw-r--r-- | nuttx/Documentation/NuttxPortingGuide.html | 2 | ||||
-rw-r--r-- | nuttx/Makefile | 4 | ||||
-rw-r--r-- | nuttx/include/nuttx/pthread.h | 85 | ||||
-rw-r--r-- | nuttx/include/pthread.h | 12 | ||||
-rw-r--r-- | nuttx/lib/Makefile | 16 | ||||
-rw-r--r-- | nuttx/lib/pthread/Make.defs | 49 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrdestroy.c (renamed from nuttx/sched/pthread_attrdestroy.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrgetinheritsched.c (renamed from nuttx/sched/pthread_attrgetinheritsched.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrgetschedparam.c (renamed from nuttx/sched/pthread_attrgetschedparam.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrgetschedpolicy.c (renamed from nuttx/sched/pthread_attrgetschedpolicy.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrgetstacksize.c (renamed from nuttx/sched/pthread_attrgetstacksize.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrinit.c (renamed from nuttx/sched/pthread_attrinit.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrsetinheritsched.c (renamed from nuttx/sched/pthread_attrsetinheritsched.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrsetschedparam.c (renamed from nuttx/sched/pthread_attrsetschedparam.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrsetschedpolicy.c (renamed from nuttx/sched/pthread_attrsetschedpolicy.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_attrsetstacksize.c (renamed from nuttx/sched/pthread_attrsetstacksize.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_barrierattrdestroy.c (renamed from nuttx/sched/pthread_barrierattrdestroy.c) | 4 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_barrierattrgetpshared.c (renamed from nuttx/sched/pthread_barrierattrgetpshared.c) | 4 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_barrierattrinit.c (renamed from nuttx/sched/pthread_barrierattrinit.c) | 4 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_barrierattrsetpshared.c (renamed from nuttx/sched/pthread_barrierattrsetpshared.c) | 4 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_condattrdestroy.c (renamed from nuttx/sched/pthread_condattrdestroy.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_condattrinit.c (renamed from nuttx/sched/pthread_condattrinit.c) | 5 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_mutexattrdestroy.c (renamed from nuttx/sched/pthread_mutexattrdestroy.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_mutexattrgetpshared.c (renamed from nuttx/sched/pthread_mutexattrgetpshared.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_mutexattrgettype.c (renamed from nuttx/sched/pthread_mutexattrgettype.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_mutexattrinit.c (renamed from nuttx/sched/pthread_mutexattrinit.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_mutexattrsetpshared.c (renamed from nuttx/sched/pthread_mutexattrsetpshared.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/pthread/pthread_mutexattrsettype.c (renamed from nuttx/sched/pthread_mutexattrsettype.c) | 6 | ||||
-rw-r--r-- | nuttx/lib/semaphore/Make.defs (renamed from nuttx/tools/Makefile.mkconfig) | 13 | ||||
-rw-r--r-- | nuttx/lib/semaphore/sem_destroy.c (renamed from nuttx/sched/sem_destroy.c) | 18 | ||||
-rw-r--r-- | nuttx/lib/semaphore/sem_getvalue.c (renamed from nuttx/sched/sem_getvalue.c) | 18 | ||||
-rw-r--r-- | nuttx/lib/semaphore/sem_init.c (renamed from nuttx/sched/sem_init.c) | 19 | ||||
-rw-r--r-- | nuttx/sched/Makefile | 21 | ||||
-rw-r--r-- | nuttx/sched/pthread_create.c | 10 | ||||
-rw-r--r-- | nuttx/sched/pthread_internal.h | 15 | ||||
-rw-r--r-- | nuttx/syscall/syscall.csv | 27 | ||||
-rw-r--r-- | nuttx/tools/Makefile.host | 48 |
38 files changed, 293 insertions, 184 deletions
diff --git a/nuttx/ChangeLog b/nuttx/ChangeLog index 7d88af34b..020c83e02 100644 --- a/nuttx/ChangeLog +++ b/nuttx/ChangeLog @@ -1628,3 +1628,8 @@ the named app's /bin directory. * lib/: Move all source files into a subdirectory of lib/ named after the header file in which the library function is prototyped. + * sched/ and lib/pthread/: Move pthread attribute-related interfaces + from sched/ to lib/pthread where they more appropriately belong. + * sched/ and lib/semaphore/: Move some semaphore-related interfaces + from sched/ to lib/pthread where they more appropriately belong. + * syscall/: The beginnings of an options syscall interface. diff --git a/nuttx/Documentation/NuttxPortingGuide.html b/nuttx/Documentation/NuttxPortingGuide.html index 9aca6c345..285d274b5 100644 --- a/nuttx/Documentation/NuttxPortingGuide.html +++ b/nuttx/Documentation/NuttxPortingGuide.html @@ -916,7 +916,7 @@ include/ </p> <ul><pre> tools/ -|-- Makefile.mkconfig +|-- Makefile.host |-- configure.sh |-- incdir.sh |-- indent.sh diff --git a/nuttx/Makefile b/nuttx/Makefile index 8a8b44525..48693a9cd 100644 --- a/nuttx/Makefile +++ b/nuttx/Makefile @@ -199,7 +199,7 @@ all: $(BIN) # Build the mkconfig tool used to create include/nuttx/config.h tools/mkconfig: - @$(MAKE) -C tools -f Makefile.mkconfig TOPDIR="$(TOPDIR)" mkconfig + @$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" mkconfig # Create the include/nuttx/config.h file include/nuttx/config.h: $(TOPDIR)/.config tools/mkconfig @@ -353,7 +353,7 @@ subdir_clean: $(MAKE) -C $$dir TOPDIR="$(TOPDIR)" clean ; \ fi \ done - @$(MAKE) -C tools -f Makefile.mkconfig TOPDIR="$(TOPDIR)" clean + @$(MAKE) -C tools -f Makefile.host TOPDIR="$(TOPDIR)" clean @$(MAKE) -C mm -f Makefile.test TOPDIR="$(TOPDIR)" clean ifeq ($(CONFIG_BUILD_2PASS),y) @$(MAKE) -C $(CONFIG_PASS1_BUILDIR) TOPDIR="$(TOPDIR)" clean diff --git a/nuttx/include/nuttx/pthread.h b/nuttx/include/nuttx/pthread.h new file mode 100644 index 000000000..449c189cb --- /dev/null +++ b/nuttx/include/nuttx/pthread.h @@ -0,0 +1,85 @@ +/**************************************************************************** + * include/nuttx/pthread.h + * Non-standard, NuttX-specific pthread-related declarations. + * + * Copyright (C) 2011 Gregory Nutt. All rights reserved. + * Author: Gregory Nutt <spudmonkey@racsa.co.cr> + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +#ifndef __INCLUDE_NUTTX_PTHREAD_H +#define __INCLUDE_NUTTX_PTHREAD_H + +/**************************************************************************** + * Included Files + ****************************************************************************/ + +#include <nuttx/config.h> +#include <pthread.h> + +/**************************************************************************** + * Pre-Processor Definitions + ****************************************************************************/ + +/* Default pthread attribute initializer */ + +#define PTHREAD_ATTR_INITIALIZER \ +{ \ + PTHREAD_STACK_DEFAULT, /* stacksize */ \ + PTHREAD_DEFAULT_PRIORITY, /* priority */ \ + SCHED_RR, /* policy */ \ + PTHREAD_EXPLICIT_SCHED, /* inheritsched */ \ +} + +/**************************************************************************** + * Public Data + ****************************************************************************/ + +/* Default pthread attributes (see sched/pthread_create.c) */ + +extern pthread_attr_t g_default_pthread_attr; + +/**************************************************************************** + * Public Function Prototypes + ****************************************************************************/ + +#ifdef __cplusplus +#define EXTERN extern "C" +extern "C" { +#else +#define EXTERN extern +#endif + +#undef EXTERN +#ifdef __cplusplus +} +#endif + +#endif /* __INCLUDE_NUTTX_PTHREAD_H */ diff --git a/nuttx/include/pthread.h b/nuttx/include/pthread.h index b761678a6..974bd1f36 100644 --- a/nuttx/include/pthread.h +++ b/nuttx/include/pthread.h @@ -1,5 +1,5 @@ /******************************************************************************** - * pthread.h + * include/pthread.h * * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> @@ -33,8 +33,8 @@ * ********************************************************************************/ -#ifndef __PTHREAD_H -#define __PTHREAD_H +#ifndef __INCLUDE_PTHREAD_H +#define __INCLUDE_PTHREAD_H /******************************************************************************** * Included Files @@ -147,9 +147,7 @@ extern "C" { #define EXTERN extern #endif -/*----------------------------------------------------------* - PTHREAD-SPECIFIC TYPES - *----------------------------------------------------------*/ +/* pthread-specific types */ typedef int pthread_key_t; typedef FAR void *pthread_addr_t; @@ -393,5 +391,5 @@ EXTERN int pthread_sigmask(int how, FAR const sigset_t *set, FAR sigset_t *oset) } #endif -#endif /* __PTHREAD_H */ +#endif /* __INCLUDE_PTHREAD_H */ diff --git a/nuttx/lib/Makefile b/nuttx/lib/Makefile index 76bd1b74b..bfcc2468f 100644 --- a/nuttx/lib/Makefile +++ b/nuttx/lib/Makefile @@ -38,6 +38,8 @@ include stdio/Make.defs include stdlib/Make.defs include unistd/Make.defs include string/Make.defs +include pthread/Make.defs +include semaphore/Make.defs include math/Make.defs include net/Make.defs include time/Make.defs @@ -49,8 +51,9 @@ ASRCS = AOBJS = $(ASRCS:.S=$(OBJEXT)) CSRCS = $(STDIO_SRCS) $(STDLIB_SRCS) $(UNISTD_SRCS) $(STRING_SRCS) \ - $(MATH_SRCS) $(NET_SRCS) $(TIME_SRCS) $(LIBGEN_SRCS) \ - $(QUEUE_SRCS) $(MISC_SRCS) $(REGEX_SRCS) $(CRC_SRCS) $(DBG_SRCS) + $(PTHREAD_SRCS) $(SEM_SRCS) $(MATH_SRCS) $(NET_SRCS) \ + $(TIME_SRCS) $(LIBGEN_SRCS) $(QUEUE_SRCS) $(MISC_SRCS) \ + $(REGEX_SRCS) $(CRC_SRCS) $(DBG_SRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) @@ -61,13 +64,15 @@ STDIODEPPATH = --dep-path stdio STDLIBDEPPATH = --dep-path stdlib UNISTDDEPPATH = --dep-path unistd STRINGDEPPATH = --dep-path string +PTHREADDEPPATH = --dep-path pthread +SEMDEPPATH = --dep-path semaphore MATHDEPPATH = --dep-path math NETDEPPATH = --dep-path net TIMEDEPPATH = --dep-path time LIBGENDEPPATH = --dep-path libgen QUEUEDEPPATH = --dep-path queue MISCDEPPATH = --dep-path misc -VPATH = stdio:stdlib:unistd:string:math:net:time:libgen:queue:misc +VPATH = stdio:stdlib:unistd:string:pthread:semaphore:math:net:time:libgen:queue:misc BIN = liblib$(LIBEXT) @@ -86,8 +91,9 @@ $(BIN): $(OBJS) .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(STDIODEPPATH) $(STDLIBDEPPATH) \ - $(UNISTDDEPPATH) $(STRINGDEPPATH) $(MATHDEPPATH) $(NETDEPPATH) \ - $(TIMEDEPPATH) $(LIBGENDEPPATH) $(QUEUEDEPPATH) $(MISCDEPPATH) \ + $(UNISTDDEPPATH) $(STRINGDEPPATH) $(PTHREADDEPPATH) $(SEMDEPPATH) \ + $(MATHDEPPATH) $(NETDEPPATH) $(TIMEDEPPATH) $(LIBGENDEPPATH) \ + $(QUEUEDEPPATH) $(MISCDEPPATH) \ $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ diff --git a/nuttx/lib/pthread/Make.defs b/nuttx/lib/pthread/Make.defs new file mode 100644 index 000000000..47211f9b9 --- /dev/null +++ b/nuttx/lib/pthread/Make.defs @@ -0,0 +1,49 @@ +############################################################################ +# lib/pthread/Make.defs +# +# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 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. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \ + pthread_attrsetschedpolicy.c pthread_attrgetschedpolicy.c \ + pthread_attrsetinheritsched.c pthread_attrgetinheritsched.c \ + pthread_attrsetstacksize.c pthread_attrgetstacksize.c \ + pthread_attrsetschedparam.c pthread_attrgetschedparam.c \ + pthread_barrierattrinit.c pthread_barrierattrdestroy.c \ + pthread_barrierattrgetpshared.c pthread_barrierattrsetpshared.c \ + pthread_condattrinit.c pthread_condattrdestroy.c \ + pthread_mutexattrinit.c pthread_mutexattrdestroy.c \ + pthread_mutexattrgetpshared.c pthread_mutexattrsetpshared.c + +ifeq ($(CONFIG_MUTEX_TYPES),y) +PTHREAD_SRCS += pthread_mutexattrsettype.c pthread_mutexattrgettype.c +endif diff --git a/nuttx/sched/pthread_attrdestroy.c b/nuttx/lib/pthread/pthread_attrdestroy.c index bfa1a49a9..fdadab743 100644 --- a/nuttx/sched/pthread_attrdestroy.c +++ b/nuttx/lib/pthread/pthread_attrdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrdestroy.c + * lib/pthread/pthread_attrdestroy.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,6 @@ #include <string.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrgetinheritsched.c b/nuttx/lib/pthread/pthread_attrgetinheritsched.c index 7accfcdf7..c1b764faa 100644 --- a/nuttx/sched/pthread_attrgetinheritsched.c +++ b/nuttx/lib/pthread/pthread_attrgetinheritsched.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrgetinheritsched.c + * lib/pthread/pthread_attrgetinheritsched.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,6 @@ #include <string.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrgetschedparam.c b/nuttx/lib/pthread/pthread_attrgetschedparam.c index 513a941a3..fa456f61a 100644 --- a/nuttx/sched/pthread_attrgetschedparam.c +++ b/nuttx/lib/pthread/pthread_attrgetschedparam.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrgetschedparam.c + * lib/pthread/pthread_attrgetschedparam.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,6 @@ #include <sched.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrgetschedpolicy.c b/nuttx/lib/pthread/pthread_attrgetschedpolicy.c index de72ef8d6..b4f762b51 100644 --- a/nuttx/sched/pthread_attrgetschedpolicy.c +++ b/nuttx/lib/pthread/pthread_attrgetschedpolicy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_attrgetschedpolicy.c + * lib/pthread/pthread_attrgetschedpolicy.c * - * Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include <string.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrgetstacksize.c b/nuttx/lib/pthread/pthread_attrgetstacksize.c index 82c15004b..06e40b5fb 100644 --- a/nuttx/sched/pthread_attrgetstacksize.c +++ b/nuttx/lib/pthread/pthread_attrgetstacksize.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrgetstacksize.c + * lib/pthread/pthread_attrgetstacksize.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include <string.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrinit.c b/nuttx/lib/pthread/pthread_attrinit.c index ed260aa83..fc9ee0274 100644 --- a/nuttx/sched/pthread_attrinit.c +++ b/nuttx/lib/pthread/pthread_attrinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrinit.c + * lib/pthread/pthread_attrinit.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,7 @@ #include <debug.h> #include <errno.h> -#include "pthread_internal.h" +#include <nuttx/pthread.h> /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrsetinheritsched.c b/nuttx/lib/pthread/pthread_attrsetinheritsched.c index 9b0e6ac80..ebdc9b3e4 100644 --- a/nuttx/sched/pthread_attrsetinheritsched.c +++ b/nuttx/lib/pthread/pthread_attrsetinheritsched.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrsetinheritsched.c + * lib/pthread/pthread_attrsetinheritsched.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -45,8 +45,6 @@ #include <debug.h> #include <errno.h> -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/nuttx/sched/pthread_attrsetschedparam.c b/nuttx/lib/pthread/pthread_attrsetschedparam.c index cd806d72f..4f65bcd8c 100644 --- a/nuttx/sched/pthread_attrsetschedparam.c +++ b/nuttx/lib/pthread/pthread_attrsetschedparam.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrsetschedparam.c + * lib/pthread/pthread_attrsetschedparam.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,6 @@ #include <sched.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrsetschedpolicy.c b/nuttx/lib/pthread/pthread_attrsetschedpolicy.c index 93756f070..b4b1fd054 100644 --- a/nuttx/sched/pthread_attrsetschedpolicy.c +++ b/nuttx/lib/pthread/pthread_attrsetschedpolicy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrsetschedpolicy.c + * lib/pthread/pthread_attrsetschedpolicy.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,6 @@ #include <sched.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/nuttx/sched/pthread_attrsetstacksize.c b/nuttx/lib/pthread/pthread_attrsetstacksize.c index 659a35d47..a2de8ac78 100644 --- a/nuttx/sched/pthread_attrsetstacksize.c +++ b/nuttx/lib/pthread/pthread_attrsetstacksize.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_attrsetstacksize.c + * lib/pthread/pthread_attrsetstacksize.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -44,8 +44,6 @@ #include <debug.h> #include <errno.h> -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/nuttx/sched/pthread_barrierattrdestroy.c b/nuttx/lib/pthread/pthread_barrierattrdestroy.c index 813e95d8a..7498bc4f2 100644 --- a/nuttx/sched/pthread_barrierattrdestroy.c +++ b/nuttx/lib/pthread/pthread_barrierattrdestroy.c @@ -1,7 +1,7 @@ /******************************************************************************** - * sched/pthread_barrierattrdestroy.c + * lib/pthread/pthread_barrierattrdestroy.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/sched/pthread_barrierattrgetpshared.c b/nuttx/lib/pthread/pthread_barrierattrgetpshared.c index 0e2cf30df..f4b4f64c1 100644 --- a/nuttx/sched/pthread_barrierattrgetpshared.c +++ b/nuttx/lib/pthread/pthread_barrierattrgetpshared.c @@ -1,7 +1,7 @@ /******************************************************************************** - * sched/pthread_barrierattrgetpshared.c + * lib/pthread/pthread_barrierattrgetpshared.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/sched/pthread_barrierattrinit.c b/nuttx/lib/pthread/pthread_barrierattrinit.c index 3a0d346f1..47bbb8eb4 100644 --- a/nuttx/sched/pthread_barrierattrinit.c +++ b/nuttx/lib/pthread/pthread_barrierattrinit.c @@ -1,7 +1,7 @@ /******************************************************************************** - * sched/pthread_barrierattrinit.c + * lib/pthread/pthread_barrierattrinit.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/sched/pthread_barrierattrsetpshared.c b/nuttx/lib/pthread/pthread_barrierattrsetpshared.c index b13075791..a982eea39 100644 --- a/nuttx/sched/pthread_barrierattrsetpshared.c +++ b/nuttx/lib/pthread/pthread_barrierattrsetpshared.c @@ -1,7 +1,7 @@ /******************************************************************************** - * sched/pthread_barrierattrsetpshared.c + * lib/pthread/pthread_barrierattrsetpshared.c * - * Copyright (C) 2007, 2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007, 2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/sched/pthread_condattrdestroy.c b/nuttx/lib/pthread/pthread_condattrdestroy.c index 99e261ce2..c55dcd4e3 100644 --- a/nuttx/sched/pthread_condattrdestroy.c +++ b/nuttx/lib/pthread/pthread_condattrdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_condattrdestroy.c + * lib/pthread/pthread_condattrdestroy.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include <pthread.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Global Functions diff --git a/nuttx/sched/pthread_condattrinit.c b/nuttx/lib/pthread/pthread_condattrinit.c index 30e3f71ac..75f01a11b 100644 --- a/nuttx/sched/pthread_condattrinit.c +++ b/nuttx/lib/pthread/pthread_condattrinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_condattrinit.c + * lib/pthread/pthread_condattrinit.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include <pthread.h> #include <debug.h> #include <errno.h> -#include "pthread_internal.h" /**************************************************************************** * Global Functions diff --git a/nuttx/sched/pthread_mutexattrdestroy.c b/nuttx/lib/pthread/pthread_mutexattrdestroy.c index 64e6bbd75..59e81528b 100644 --- a/nuttx/sched/pthread_mutexattrdestroy.c +++ b/nuttx/lib/pthread/pthread_mutexattrdestroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_mutexattrdestroy.c + * lib/pthread/pthread_mutexattrdestroy.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include <errno.h> #include <debug.h> -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/nuttx/sched/pthread_mutexattrgetpshared.c b/nuttx/lib/pthread/pthread_mutexattrgetpshared.c index a70417cee..e5e09bbbe 100644 --- a/nuttx/sched/pthread_mutexattrgetpshared.c +++ b/nuttx/lib/pthread/pthread_mutexattrgetpshared.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_mutexattrgetpshared.c + * lib/pthread/pthread_mutexattrgetpshared.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include <errno.h> #include <debug.h> -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/nuttx/sched/pthread_mutexattrgettype.c b/nuttx/lib/pthread/pthread_mutexattrgettype.c index fb01c2383..93cbe3601 100644 --- a/nuttx/sched/pthread_mutexattrgettype.c +++ b/nuttx/lib/pthread/pthread_mutexattrgettype.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_mutexattrgettype.c + * lib/pthread/pthread_mutexattrgettype.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ #include <pthread.h> #include <errno.h> -#include "pthread_internal.h" - #ifdef CONFIG_MUTEX_TYPES /**************************************************************************** diff --git a/nuttx/sched/pthread_mutexattrinit.c b/nuttx/lib/pthread/pthread_mutexattrinit.c index 6d155d4ca..729b0b8e1 100644 --- a/nuttx/sched/pthread_mutexattrinit.c +++ b/nuttx/lib/pthread/pthread_mutexattrinit.c @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_mutexattrinit.c + * lib/pthread/pthread_mutexattrinit.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include <errno.h> #include <debug.h> -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/nuttx/sched/pthread_mutexattrsetpshared.c b/nuttx/lib/pthread/pthread_mutexattrsetpshared.c index 22b70e118..752e9faa0 100644 --- a/nuttx/sched/pthread_mutexattrsetpshared.c +++ b/nuttx/lib/pthread/pthread_mutexattrsetpshared.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_mutexattrsetpshared.c + * lib/pthread/pthread_mutexattrsetpshared.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include <errno.h> #include <debug.h> -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/nuttx/sched/pthread_mutexattrsettype.c b/nuttx/lib/pthread/pthread_mutexattrsettype.c index 0df24fda8..e095dd70c 100644 --- a/nuttx/sched/pthread_mutexattrsettype.c +++ b/nuttx/lib/pthread/pthread_mutexattrsettype.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/pthread_mutexattrsettype.c + * lib/pthread/pthread_mutexattrsettype.c * - * Copyright (C) 2008 Gregory Nutt. All rights reserved. + * Copyright (C) 2008, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ #include <pthread.h> #include <errno.h> -#include "pthread_internal.h" - #ifdef CONFIG_MUTEX_TYPES /**************************************************************************** diff --git a/nuttx/tools/Makefile.mkconfig b/nuttx/lib/semaphore/Make.defs index 42262d2b2..7ea64b20e 100644 --- a/nuttx/tools/Makefile.mkconfig +++ b/nuttx/lib/semaphore/Make.defs @@ -1,7 +1,7 @@ ############################################################################ -# Makefile.mkconfig +# lib/semaphore/Make.defs # -# Copyright (C) 2007, 2008 Gregory Nutt. All rights reserved. +# Copyright (C) 2011 Gregory Nutt. All rights reserved. # Author: Gregory Nutt <spudmonkey@racsa.co.cr> # # Redistribution and use in source and binary forms, with or without @@ -33,11 +33,4 @@ # ############################################################################ -all: mkconfig -default: mkconfig - -mkconfig: mkconfig.c - @gcc -O2 -Wall -o mkconfig mkconfig.c - -clean: - @rm -f mkconfig mkconfig.exe *~ +SEM_SRCS = sem_init.c sem_getvalue.c sem_destroy.c diff --git a/nuttx/sched/sem_destroy.c b/nuttx/lib/semaphore/sem_destroy.c index a0a7ca3d1..0d4fb9271 100644 --- a/nuttx/sched/sem_destroy.c +++ b/nuttx/lib/semaphore/sem_destroy.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/sem_destroy.c + * lib/semaphore/sem_destroy.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,7 @@ #include <nuttx/config.h> #include <semaphore.h> - -#include "sem_internal.h" +#include <errno.h> /**************************************************************************** * Definitions @@ -93,8 +92,6 @@ int sem_destroy (FAR sem_t *sem) { - int ret = ERROR; - /* Assure a valid semaphore is specified */ if (sem) @@ -117,8 +114,11 @@ int sem_destroy (FAR sem_t *sem) /* Release holders of the semaphore */ sem_destroyholder(sem); - ret = OK; + return OK; + } + else + { + errno = -EINVAL; + return ERROR; } - - return ret; } diff --git a/nuttx/sched/sem_getvalue.c b/nuttx/lib/semaphore/sem_getvalue.c index c78b9a50a..e1ad9ac0d 100644 --- a/nuttx/sched/sem_getvalue.c +++ b/nuttx/lib/semaphore/sem_getvalue.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/sem_getvalue.c + * lib/semaphore/sem_getvalue.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,7 @@ #include <nuttx/config.h> #include <semaphore.h> - -#include "sem_internal.h" +#include <errno.h> /**************************************************************************** * Definitions @@ -95,13 +94,14 @@ int sem_getvalue(FAR sem_t *sem, FAR int *sval) { - int ret = ERROR; - if (sem && sval) { *sval = sem->semcount; - ret = OK; + return OK; + } + else + { + errno = -EINVAL; + return ERROR; } - - return ret; } diff --git a/nuttx/sched/sem_init.c b/nuttx/lib/semaphore/sem_init.c index 1cc1f1df8..c75281bf0 100644 --- a/nuttx/sched/sem_init.c +++ b/nuttx/lib/semaphore/sem_init.c @@ -1,7 +1,7 @@ /**************************************************************************** - * sched/sem_init.c + * lib/sem/sem_init.c * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -39,11 +39,9 @@ #include <nuttx/config.h> -#include <stdint.h> #include <limits.h> #include <semaphore.h> - -#include "sem_internal.h" +#include <errno.h> /**************************************************************************** * Definitions @@ -96,8 +94,6 @@ int sem_init (FAR sem_t *sem, int pshared, unsigned int value) { - int ret = ERROR; - if (sem && value <= SEM_VALUE_MAX) { sem->semcount = (int16_t)value; @@ -108,8 +104,11 @@ int sem_init (FAR sem_t *sem, int pshared, unsigned int value) sem->hlist.holder = NULL; sem->hlist.counts = 0; #endif - ret = OK; + return OK; + } + else + { + errno = -EINVAL; + return ERROR; } - - return ret; } diff --git a/nuttx/sched/Makefile b/nuttx/sched/Makefile index 50ef997fc..ab83a8fee 100644 --- a/nuttx/sched/Makefile +++ b/nuttx/sched/Makefile @@ -100,22 +100,12 @@ ifneq ($(CONFIG_DISABLE_SIGNALS),y) MQUEUE_SRCS += mq_notify.c endif -PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \ - pthread_attrsetschedpolicy.c pthread_attrgetschedpolicy.c \ - pthread_attrsetinheritsched.c pthread_attrgetinheritsched.c \ - pthread_attrsetstacksize.c pthread_attrgetstacksize.c \ - pthread_attrsetschedparam.c pthread_attrgetschedparam.c \ - pthread_create.c pthread_exit.c pthread_join.c pthread_detach.c \ +PTHREAD_SRCS = pthread_create.c pthread_exit.c pthread_join.c pthread_detach.c \ pthread_yield.c pthread_getschedparam.c pthread_setschedparam.c \ - pthread_mutexattrinit.c pthread_mutexattrdestroy.c \ - pthread_mutexattrgetpshared.c pthread_mutexattrsetpshared.c \ pthread_mutexinit.c pthread_mutexdestroy.c \ pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c \ pthread_condinit.c pthread_conddestroy.c \ - pthread_condattrinit.c pthread_condattrdestroy.c \ pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c \ - pthread_barrierattrinit.c pthread_barrierattrdestroy.c \ - pthread_barrierattrgetpshared.c pthread_barrierattrsetpshared.c \ pthread_barrierinit.c pthread_barrierdestroy.c pthread_barrierwait.c \ pthread_cancel.c pthread_setcancelstate.c \ pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c pthread_keydelete.c \ @@ -124,14 +114,9 @@ PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \ ifneq ($(CONFIG_DISABLE_SIGNALS),y) PTHREAD_SRCS += pthread_condtimedwait.c pthread_kill.c pthread_sigmask.c endif -ifeq ($(CONFIG_MUTEX_TYPES),y) -PTHREAD_SRCS += pthread_mutexattrsettype.c pthread_mutexattrgettype.c -endif -SEM_SRCS = sem_initialize.c sem_init.c sem_destroy.c\ - sem_open.c sem_close.c sem_unlink.c \ - sem_wait.c sem_trywait.c sem_post.c sem_getvalue.c \ - sem_findnamed.c +SEM_SRCS = sem_initialize.c sem_open.c sem_close.c sem_unlink.c \ + sem_wait.c sem_trywait.c sem_post.c sem_findnamed.c ifneq ($(CONFIG_DISABLE_SIGNALS),y) SEM_SRCS += sem_waitirq.c endif diff --git a/nuttx/sched/pthread_create.c b/nuttx/sched/pthread_create.c index b49698122..bedb7d3ba 100644 --- a/nuttx/sched/pthread_create.c +++ b/nuttx/sched/pthread_create.c @@ -47,7 +47,9 @@ #include <debug.h> #include <errno.h> #include <queue.h> + #include <nuttx/kmalloc.h> +#include <nuttx/pthread.h> #include <nuttx/arch.h> #include "os_internal.h" @@ -69,13 +71,7 @@ /* Default pthread attributes */ -FAR pthread_attr_t g_default_pthread_attr = -{ - PTHREAD_STACK_DEFAULT, /* stacksize */ - PTHREAD_DEFAULT_PRIORITY, /* priority */ - SCHED_RR, /* policy */ - PTHREAD_EXPLICIT_SCHED, /* inheritsched */ -}; +pthread_attr_t g_default_pthread_attr = PTHREAD_ATTR_INITIALIZER; /**************************************************************************** * Private Variables diff --git a/nuttx/sched/pthread_internal.h b/nuttx/sched/pthread_internal.h index 1770ff1b5..6d8961e37 100644 --- a/nuttx/sched/pthread_internal.h +++ b/nuttx/sched/pthread_internal.h @@ -1,7 +1,7 @@ /**************************************************************************** - * pthread_internal.h + * sched/pthread_internal.h * - * Copyright (C) 2007-2009 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2009, 2011 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <spudmonkey@racsa.co.cr> * * Redistribution and use in source and binary forms, with or without @@ -33,8 +33,8 @@ * ****************************************************************************/ -#ifndef __PTHREAD_INTERNAL_H -#define __PTHREAD_INTERNAL_H +#ifndef __SCHED_PTHREAD_INTERNAL_H +#define __SCHED_PTHREAD_INTERNAL_H /**************************************************************************** * Included Files @@ -46,6 +46,7 @@ #include <stdint.h> #include <stdbool.h> #include <pthread.h> + #include <nuttx/compiler.h> /**************************************************************************** @@ -103,10 +104,6 @@ extern sem_t g_join_semaphore; extern uint8_t g_pthread_num_keys; -/* Default pthread attributes */ - -extern FAR pthread_attr_t g_default_pthread_attr; - /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -135,5 +132,5 @@ EXTERN int pthread_mutexattr_verifytype(int type); } #endif -#endif /* __PTHREAD_INTERNAL_H */ +#endif /* __SCHED_PTHREAD_INTERNAL_H */ diff --git a/nuttx/syscall/syscall.csv b/nuttx/syscall/syscall.csv index e488799cd..7cb60003a 100644 --- a/nuttx/syscall/syscall.csv +++ b/nuttx/syscall/syscall.csv @@ -3,7 +3,6 @@ "accept","sys/socket.h","int","int","struct sockaddr*","socklen_t*" "atexit","stdlib.h","int","void *(*)(void)" "bind","sys/socket.h","int","int","FAR const struct sockaddr*","socklen_t" -"chdir","unistd.h","int","FAR const char*" "clearenv","stdlib.h","int" "clock_getres","time.h","int","clockid_t","struct timespec*" "clock_gettime","time.h","int","clockid_t","struct timespec*" @@ -21,7 +20,6 @@ "fsync","unistd.h","int","int" "get_environ_ptr","stdlib.h","FAR char**"," void " "get_errno_ptr","errno.h","FAR int*" -"getcwd","unistd.h","FAR char*","FAR char*","size_t" "getenv","stdlib.h","FAR char*","FAR const char*" "getpid","unistd.h","pidt_t" "getsockopt","sys/socket.h","int","int","int","int","FAR void*","FAR socklen_t*" @@ -48,23 +46,9 @@ "opendir","dirent.h","FAR DIR*","FAR const char*" "pipe","unistd.h","int","int[2]" "poll","poll.h","int","FAR struct pollfd*","nfds_t","int" -"pthread_attr_destroy","pthread.h","int","pthread_attr_t*" -"pthread_attr_getinheritsched","pthread.h","int","FAR const pthread_attr_t*","FAR int*" -"pthread_attr_getschedparam","pthread.h","int","FAR pthread_attr_t*","FAR struct sched_param*" -"pthread_attr_getschedpolicy","pthread.h","int","FAR pthread_attr_t*","int*" -"pthread_attr_getstacksize","pthread.h","int","FAR pthread_attr_t*","long*" -"pthread_attr_init","pthread.h","int","FAR pthread_attr_t*" -"pthread_attr_setinheritsched","pthread.h","int","FAR pthread_attr_t*","int" -"pthread_attr_setschedparam","pthread.h","int","FAR pthread_attr_t*","FAR const struct sched_param*" -"pthread_attr_setschedpolicy","pthread.h","int","FAR pthread_attr_t*","int" -"pthread_attr_setstacksize","pthread.h","int","FAR pthread_attr_t*","long" "pthread_barrier_destroy","pthread.h","int","FAR pthread_barrier_t*" "pthread_barrier_init","pthread.h","int","FAR pthread_barrier_t*","FAR const pthread_barrierattr_t*","unsigned int" "pthread_barrier_wait","pthread.h","int","FAR pthread_barrier_t*" -"pthread_barrierattr_destroy","pthread.h","int","FAR pthread_barrierattr_t*" -"pthread_barrierattr_getpshared","pthread.h","int","FAR const pthread_barrierattr_t*","FAR int*" -"pthread_barrierattr_init","pthread.h","int","FAR pthread_barrierattr_t*" -"pthread_barrierattr_setpshared","pthread.h","int","FAR pthread_barrierattr_t*","int" "pthread_cancel","pthread.h","int","pthread_t" "pthread_cond_broadcast","pthread.h","int","FAR pthread_cond_t*" "pthread_cond_destroy","pthread.h","int","FAR pthread_cond_t*" @@ -72,8 +56,6 @@ "pthread_cond_signal","pthread.h","int","FAR pthread_cond_t*" "pthread_cond_timedwait","pthread.h","int","FAR pthread_cond_t*","FAR pthread_mutex_t*","FAR const struct timespec*" "pthread_cond_wait","pthread.h","int","FAR pthread_cond_t*","FAR pthread_mutex_t*" -"pthread_condattr_destroy","pthread.h","int","FAR pthread_condattr_t*" -"pthread_condattr_init","pthread.h","int","FAR pthread_condattr_t*" "pthread_create","pthread.h","int","FAR pthread_t*","FAR pthread_attr_t*","pthread_startroutine_t","pthread_addr_t" "pthread_detach","pthread.h","int","pthread_t" "pthread_exit","pthread.h","void","pthread_addr_t" @@ -88,12 +70,6 @@ "pthread_mutex_lock","pthread.h","int","FAR pthread_mutex_t*" "pthread_mutex_trylock","pthread.h","int","FAR pthread_mutex_t*" "pthread_mutex_unlock","pthread.h","int","FAR pthread_mutex_t*" -"pthread_mutexattr_destroy","pthread.h","int","FAR pthread_mutexattr_t*" -"pthread_mutexattr_getpshared","pthread.h","int","FAR pthread_mutexattr_t*","FAR int*" -"pthread_mutexattr_gettype","pthread.h","int","const pthread_mutexattr_t*","int*" -"pthread_mutexattr_init","pthread.h","int","FAR pthread_mutexattr_t*" -"pthread_mutexattr_setpshared","pthread.h","int","FAR pthread_mutexattr_t*","int" -"pthread_mutexattr_settype","pthread.h","int","pthread_mutexattr_t*","int" "pthread_once","pthread.h","int","FAR pthread_once_t*","CODE void (*)(void)" "pthread_setcancelstate","pthread.h","int","int","FAR int*" "pthread_setschedparam","pthread.h","int","pthread_t","int","FAR const struct sched_param*" @@ -128,9 +104,6 @@ "seekdir","dirent.h","void","FAR DIR*","off_t" "select","sys/select.h","int","int","FAR fd_set*","FAR fd_set*","FAR fd_set*","FAR struct timeval*" "sem_close","semaphore.h","int","FAR sem_t*" -"sem_destroy","semaphore.h","int","FAR sem_t*" -"sem_getvalue","semaphore.h","int","FAR sem_t*","FAR int*" -"sem_init","semaphore.h","int","FAR sem_t*","int","unsigned int value" "sem_open","semaphore.h","FAR sem_t*","FAR const char*","int","..." "sem_post","semaphore.h","int","FAR sem_t*" "sem_trywait","semaphore.h","int","FAR sem_t*" diff --git a/nuttx/tools/Makefile.host b/nuttx/tools/Makefile.host new file mode 100644 index 000000000..a5a83d4ae --- /dev/null +++ b/nuttx/tools/Makefile.host @@ -0,0 +1,48 @@ +############################################################################ +# Makefile.host +# +# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt <spudmonkey@racsa.co.cr> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in +# the documentation and/or other materials provided with the +# distribution. +# 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. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS +# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE +# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, +# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS +# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED +# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN +# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# +############################################################################ + +all: mkconfig mksyscall +default: mkconfig mksyscall + +CFLAGS = -O2 -Wall + +mkconfig: mkconfig.c + @gcc $(CFLAGS) -o mkconfig mkconfig.c + +mksyscall: mksyscall.c + @gcc $(CFLAGS) -o mksyscall mksyscall.c + +clean: + @rm -f mkconfig mksyscall mkconfig.exe mksyscall.exe *~ |