From a52144381736f15ec23ca4e245bf8c022df8d861 Mon Sep 17 00:00:00 2001
From: patacongo
tools/ -|-- Makefile.mkconfig +|-- Makefile.host |-- configure.sh |-- incdir.sh |-- indent.sh diff --git a/Makefile b/Makefile index 8a8b445252..48693a9cd3 100644 --- a/Makefile +++ b/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/include/nuttx/pthread.h b/include/nuttx/pthread.h new file mode 100644 index 0000000000..449c189cbc --- /dev/null +++ b/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+ * + * 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 +#include + +/**************************************************************************** + * 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/include/pthread.h b/include/pthread.h index b761678a6c..974bd1f36b 100644 --- a/include/pthread.h +++ b/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 @@ -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/lib/Makefile b/lib/Makefile index 76bd1b74bd..bfcc2468fc 100644 --- a/lib/Makefile +++ b/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/lib/pthread/Make.defs b/lib/pthread/Make.defs new file mode 100644 index 0000000000..47211f9b93 --- /dev/null +++ b/lib/pthread/Make.defs @@ -0,0 +1,49 @@ +############################################################################ +# lib/pthread/Make.defs +# +# Copyright (C) 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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/sched/pthread_attrdestroy.c b/lib/pthread/pthread_attrdestroy.c similarity index 96% rename from sched/pthread_attrdestroy.c rename to lib/pthread/pthread_attrdestroy.c index bfa1a49a91..fdadab7432 100644 --- a/sched/pthread_attrdestroy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrgetinheritsched.c b/lib/pthread/pthread_attrgetinheritsched.c similarity index 96% rename from sched/pthread_attrgetinheritsched.c rename to lib/pthread/pthread_attrgetinheritsched.c index 7accfcdf74..c1b764faa3 100644 --- a/sched/pthread_attrgetinheritsched.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -43,7 +43,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrgetschedparam.c b/lib/pthread/pthread_attrgetschedparam.c similarity index 96% rename from sched/pthread_attrgetschedparam.c rename to lib/pthread/pthread_attrgetschedparam.c index 513a941a38..fa456f61a4 100644 --- a/sched/pthread_attrgetschedparam.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrgetschedpolicy.c b/lib/pthread/pthread_attrgetschedpolicy.c similarity index 96% rename from sched/pthread_attrgetschedpolicy.c rename to lib/pthread/pthread_attrgetschedpolicy.c index de72ef8d66..b4f762b519 100644 --- a/sched/pthread_attrgetschedpolicy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrgetstacksize.c b/lib/pthread/pthread_attrgetstacksize.c similarity index 96% rename from sched/pthread_attrgetstacksize.c rename to lib/pthread/pthread_attrgetstacksize.c index 82c15004b4..06e40b5fbe 100644 --- a/sched/pthread_attrgetstacksize.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrinit.c b/lib/pthread/pthread_attrinit.c similarity index 96% rename from sched/pthread_attrinit.c rename to lib/pthread/pthread_attrinit.c index ed260aa831..fc9ee02745 100644 --- a/sched/pthread_attrinit.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,7 @@ #include #include -#include "pthread_internal.h" +#include /**************************************************************************** * Definitions diff --git a/sched/pthread_attrsetinheritsched.c b/lib/pthread/pthread_attrsetinheritsched.c similarity index 96% rename from sched/pthread_attrsetinheritsched.c rename to lib/pthread/pthread_attrsetinheritsched.c index 9b0e6ac800..ebdc9b3e45 100644 --- a/sched/pthread_attrsetinheritsched.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -45,8 +45,6 @@ #include #include -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/sched/pthread_attrsetschedparam.c b/lib/pthread/pthread_attrsetschedparam.c similarity index 96% rename from sched/pthread_attrsetschedparam.c rename to lib/pthread/pthread_attrsetschedparam.c index cd806d72f3..4f65bcd8cb 100644 --- a/sched/pthread_attrsetschedparam.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrsetschedpolicy.c b/lib/pthread/pthread_attrsetschedpolicy.c similarity index 96% rename from sched/pthread_attrsetschedpolicy.c rename to lib/pthread/pthread_attrsetschedpolicy.c index 93756f0705..b4b1fd0543 100644 --- a/sched/pthread_attrsetschedpolicy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -44,7 +44,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Definitions diff --git a/sched/pthread_attrsetstacksize.c b/lib/pthread/pthread_attrsetstacksize.c similarity index 96% rename from sched/pthread_attrsetstacksize.c rename to lib/pthread/pthread_attrsetstacksize.c index 659a35d471..a2de8ac78d 100644 --- a/sched/pthread_attrsetstacksize.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -44,8 +44,6 @@ #include #include -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/sched/pthread_barrierattrdestroy.c b/lib/pthread/pthread_barrierattrdestroy.c similarity index 97% rename from sched/pthread_barrierattrdestroy.c rename to lib/pthread/pthread_barrierattrdestroy.c index 813e95d8a1..7498bc4f23 100644 --- a/sched/pthread_barrierattrdestroy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread_barrierattrgetpshared.c b/lib/pthread/pthread_barrierattrgetpshared.c similarity index 97% rename from sched/pthread_barrierattrgetpshared.c rename to lib/pthread/pthread_barrierattrgetpshared.c index 0e2cf30df3..f4b4f64c13 100644 --- a/sched/pthread_barrierattrgetpshared.c +++ b/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 * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread_barrierattrinit.c b/lib/pthread/pthread_barrierattrinit.c similarity index 97% rename from sched/pthread_barrierattrinit.c rename to lib/pthread/pthread_barrierattrinit.c index 3a0d346f19..47bbb8eb42 100644 --- a/sched/pthread_barrierattrinit.c +++ b/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 * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread_barrierattrsetpshared.c b/lib/pthread/pthread_barrierattrsetpshared.c similarity index 97% rename from sched/pthread_barrierattrsetpshared.c rename to lib/pthread/pthread_barrierattrsetpshared.c index b130757914..a982eea393 100644 --- a/sched/pthread_barrierattrsetpshared.c +++ b/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 * * Redistribution and use in source and binary forms, with or without diff --git a/sched/pthread_condattrdestroy.c b/lib/pthread/pthread_condattrdestroy.c similarity index 95% rename from sched/pthread_condattrdestroy.c rename to lib/pthread/pthread_condattrdestroy.c index 99e261ce20..c55dcd4e3f 100644 --- a/sched/pthread_condattrdestroy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Global Functions diff --git a/sched/pthread_condattrinit.c b/lib/pthread/pthread_condattrinit.c similarity index 95% rename from sched/pthread_condattrinit.c rename to lib/pthread/pthread_condattrinit.c index 30e3f71ace..75f01a11b6 100644 --- a/sched/pthread_condattrinit.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -42,7 +42,6 @@ #include #include #include -#include "pthread_internal.h" /**************************************************************************** * Global Functions diff --git a/sched/pthread_mutexattrdestroy.c b/lib/pthread/pthread_mutexattrdestroy.c similarity index 96% rename from sched/pthread_mutexattrdestroy.c rename to lib/pthread/pthread_mutexattrdestroy.c index 64e6bbd759..59e81528be 100644 --- a/sched/pthread_mutexattrdestroy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include #include -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/sched/pthread_mutexattrgetpshared.c b/lib/pthread/pthread_mutexattrgetpshared.c similarity index 96% rename from sched/pthread_mutexattrgetpshared.c rename to lib/pthread/pthread_mutexattrgetpshared.c index a70417ceed..e5e09bbbe1 100644 --- a/sched/pthread_mutexattrgetpshared.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include #include -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/sched/pthread_mutexattrgettype.c b/lib/pthread/pthread_mutexattrgettype.c similarity index 96% rename from sched/pthread_mutexattrgettype.c rename to lib/pthread/pthread_mutexattrgettype.c index fb01c23833..93cbe36019 100644 --- a/sched/pthread_mutexattrgettype.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ #include #include -#include "pthread_internal.h" - #ifdef CONFIG_MUTEX_TYPES /**************************************************************************** diff --git a/sched/pthread_mutexattrinit.c b/lib/pthread/pthread_mutexattrinit.c similarity index 96% rename from sched/pthread_mutexattrinit.c rename to lib/pthread/pthread_mutexattrinit.c index 6d155d4ca5..729b0b8e14 100644 --- a/sched/pthread_mutexattrinit.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include #include -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/sched/pthread_mutexattrsetpshared.c b/lib/pthread/pthread_mutexattrsetpshared.c similarity index 96% rename from sched/pthread_mutexattrsetpshared.c rename to lib/pthread/pthread_mutexattrsetpshared.c index 22b70e118d..752e9faa03 100644 --- a/sched/pthread_mutexattrsetpshared.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -43,8 +43,6 @@ #include #include -#include "pthread_internal.h" - /**************************************************************************** * Definitions ****************************************************************************/ diff --git a/sched/pthread_mutexattrsettype.c b/lib/pthread/pthread_mutexattrsettype.c similarity index 96% rename from sched/pthread_mutexattrsettype.c rename to lib/pthread/pthread_mutexattrsettype.c index 0df24fda88..e095dd70c3 100644 --- a/sched/pthread_mutexattrsettype.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -41,8 +41,6 @@ #include #include -#include "pthread_internal.h" - #ifdef CONFIG_MUTEX_TYPES /**************************************************************************** diff --git a/tools/Makefile.mkconfig b/lib/semaphore/Make.defs similarity index 88% rename from tools/Makefile.mkconfig rename to lib/semaphore/Make.defs index 42262d2b2a..7ea64b20e3 100644 --- a/tools/Makefile.mkconfig +++ b/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 # # 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/sched/sem_destroy.c b/lib/semaphore/sem_destroy.c similarity index 95% rename from sched/sem_destroy.c rename to lib/semaphore/sem_destroy.c index a0a7ca3d17..0d4fb92712 100644 --- a/sched/sem_destroy.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,7 @@ #include #include - -#include "sem_internal.h" +#include /**************************************************************************** * 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/sched/sem_getvalue.c b/lib/semaphore/sem_getvalue.c similarity index 95% rename from sched/sem_getvalue.c rename to lib/semaphore/sem_getvalue.c index c78b9a50a2..e1ad9ac0d6 100644 --- a/sched/sem_getvalue.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -40,8 +40,7 @@ #include #include - -#include "sem_internal.h" +#include /**************************************************************************** * 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/sched/sem_init.c b/lib/semaphore/sem_init.c similarity index 95% rename from sched/sem_init.c rename to lib/semaphore/sem_init.c index 1cc1f1df87..c75281bf07 100644 --- a/sched/sem_init.c +++ b/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 * * Redistribution and use in source and binary forms, with or without @@ -39,11 +39,9 @@ #include -#include #include #include - -#include "sem_internal.h" +#include /**************************************************************************** * 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/sched/Makefile b/sched/Makefile index 50ef997fca..ab83a8fee8 100644 --- a/sched/Makefile +++ b/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/sched/pthread_create.c b/sched/pthread_create.c index b49698122a..bedb7d3baa 100644 --- a/sched/pthread_create.c +++ b/sched/pthread_create.c @@ -47,7 +47,9 @@ #include #include #include + #include +#include #include #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/sched/pthread_internal.h b/sched/pthread_internal.h index 1770ff1b50..6d8961e376 100644 --- a/sched/pthread_internal.h +++ b/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 * * 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 #include #include + #include /**************************************************************************** @@ -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/syscall/syscall.csv b/syscall/syscall.csv index e488799cdd..7cb60003a8 100644 --- a/syscall/syscall.csv +++ b/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/tools/Makefile.host b/tools/Makefile.host new file mode 100644 index 0000000000..a5a83d4ae3 --- /dev/null +++ b/tools/Makefile.host @@ -0,0 +1,48 @@ +############################################################################ +# Makefile.host +# +# Copyright (C) 2007, 2008, 2011 Gregory Nutt. All rights reserved. +# Author: Gregory Nutt +# +# 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 *~