From cf3d515a6b4826a39f541224868e3a83b657ffbc Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 4 Apr 2011 21:02:15 +0000 Subject: [PATCH] Fix a couple of recently introduced build problems git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3463 42af7a65-404d-4744-a932-0658087f49c3 --- drivers/Makefile | 6 +++--- include/nuttx/pthread.h | 5 ++++- lib/pthread/pthread_attrinit.c | 10 ++++++++++ 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/drivers/Makefile b/drivers/Makefile index 01143a0715..68f3427548 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -115,7 +115,7 @@ endif endif CSRCS += $(SERIAL_CSRCS) $(NET_CSRCS) $(PIPE_CSRCS) $(USBDEV_CSRCS) \ $(USBHOST_CSRCS) $(MMCSD_CSRCS) $(LCD_CSRCS) $(BCH_CSRCS) \ - $(MTD_CSRCS) + $(MTD_CSRCS) $(I2C_CSRCS) COBJS = $(CSRCS:.c=$(OBJEXT)) SRCS = $(ASRCS) $(CSRCS) @@ -123,7 +123,7 @@ OBJS = $(AOBJS) $(COBJS) BIN = libdrivers$(LIBEXT) -VPATH = serial:net:pipes:usbdev:usbhost:mmcsd:lcd:bch:mtd +VPATH = serial:net:pipes:usbdev:usbhost:mmcsd:lcd:bch:mtd:i2c all: $(BIN) @@ -141,7 +141,7 @@ $(BIN): $(OBJS) .depend: Makefile $(SRCS) @$(MKDEP) $(ROOTDEPPATH) $(SERIALDEPPATH) $(NETDEPPATH) $(PIPEDEPPATH) \ $(USBDEVDEPPATH) $(USBHOSTDEPPATH) $(MMCSDDEPPATH) $(LCDDEPPATH) \ - $(BCHDEPPATH) $(MTDDEPPATH) \ + $(BCHDEPPATH) $(MTDDEPPATH) $(I2CDEPPATH)\ $(CC) -- $(CFLAGS) -- $(SRCS) >Make.dep @touch $@ diff --git a/include/nuttx/pthread.h b/include/nuttx/pthread.h index 449c189cbc..8165f1b843 100644 --- a/include/nuttx/pthread.h +++ b/include/nuttx/pthread.h @@ -43,6 +43,7 @@ #include #include +#include /**************************************************************************** * Pre-Processor Definitions @@ -62,7 +63,9 @@ * Public Data ****************************************************************************/ -/* Default pthread attributes (see sched/pthread_create.c) */ +/* Default pthread attributes (see sched/pthread_create.c). This global + * can only be shared within the kernel- or within the user- address space. + */ extern pthread_attr_t g_default_pthread_attr; diff --git a/lib/pthread/pthread_attrinit.c b/lib/pthread/pthread_attrinit.c index fc9ee02745..7df73e54b4 100644 --- a/lib/pthread/pthread_attrinit.c +++ b/lib/pthread/pthread_attrinit.c @@ -58,6 +58,16 @@ * Global Variables ****************************************************************************/ +/* Default pthread attributes (see included/nuttx/pthread.h). When configured + * to build separate kernel- and user-address spaces, this global is + * duplicated in each address spaced. This copy can only be shared within + * the user address space. + */ + +#if defined(CONFIG_NUTTX_KERNEL) && !defined(__KERNEL__) +pthread_attr_t g_default_pthread_attr = PTHREAD_ATTR_INITIALIZER; +#endif + /**************************************************************************** * Private Variables ****************************************************************************/