Still working toward clean 8051 link
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@25 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
3a4de8b8a8
commit
fb61b0b76b
10
Makefile
10
Makefile
@ -42,12 +42,11 @@ ARCH_SRC = $(ARCH_DIR)/src
|
|||||||
|
|
||||||
SUBDIRS = sched lib $(ARCH_SRC) mm fs drivers examples/$(CONFIG_EXAMPLE)
|
SUBDIRS = sched lib $(ARCH_SRC) mm fs drivers examples/$(CONFIG_EXAMPLE)
|
||||||
|
|
||||||
LINKOBJS = $(ARCH_SRC)/up_head$(OBJEXT)
|
|
||||||
LINKLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT) mm/libmm$(LIBEXT) \
|
LINKLIBS = sched/libsched$(LIBEXT) $(ARCH_SRC)/libarch$(LIBEXT) mm/libmm$(LIBEXT) \
|
||||||
fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) lib/liblib$(LIBEXT) \
|
fs/libfs$(LIBEXT) drivers/libdrivers$(LIBEXT) lib/liblib$(LIBEXT) \
|
||||||
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||||
|
|
||||||
BIN = nuttx
|
BIN = nuttx$(EXEEXT)
|
||||||
|
|
||||||
all: $(BIN)
|
all: $(BIN)
|
||||||
.PHONY: clean context clean_context distclean
|
.PHONY: clean context clean_context distclean
|
||||||
@ -83,9 +82,6 @@ lib/liblib$(LIBEXT): context
|
|||||||
$(ARCH_SRC)/libarch$(LIBEXT): context
|
$(ARCH_SRC)/libarch$(LIBEXT): context
|
||||||
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) libarch$(LIBEXT)
|
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) libarch$(LIBEXT)
|
||||||
|
|
||||||
$(ARCH_SRC)/up_head$(OBJEXT): context
|
|
||||||
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) up_head$(OBJEXT)
|
|
||||||
|
|
||||||
mm/libmm$(LIBEXT): context
|
mm/libmm$(LIBEXT): context
|
||||||
$(MAKE) -C mm TOPDIR=$(TOPDIR) libmm$(LIBEXT)
|
$(MAKE) -C mm TOPDIR=$(TOPDIR) libmm$(LIBEXT)
|
||||||
|
|
||||||
@ -98,8 +94,8 @@ drivers/libdrivers$(LIBEXT): context
|
|||||||
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT): context
|
examples/$(CONFIG_EXAMPLE)/lib$(CONFIG_EXAMPLE)$(LIBEXT): context
|
||||||
$(MAKE) -C examples/$(CONFIG_EXAMPLE) TOPDIR=$(TOPDIR) lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
$(MAKE) -C examples/$(CONFIG_EXAMPLE) TOPDIR=$(TOPDIR) lib$(CONFIG_EXAMPLE)$(LIBEXT)
|
||||||
|
|
||||||
$(BIN): context depend $(LINKOBJS) $(LINKLIBS)
|
$(BIN): context depend $(LINKLIBS)
|
||||||
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) LINKOBJS="$(LINKOBJS)" LINKLIBS="$(LINKLIBS)" $(BIN)
|
$(MAKE) -C $(ARCH_SRC) TOPDIR=$(TOPDIR) LINKLIBS="$(LINKLIBS)" $(BIN)
|
||||||
|
|
||||||
depend:
|
depend:
|
||||||
@for dir in $(SUBDIRS) ; do \
|
@for dir in $(SUBDIRS) ; do \
|
||||||
|
@ -62,7 +62,7 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
|
|
||||||
General OS setup
|
General OS setup
|
||||||
|
|
||||||
CONFIG_EXAMPLE - identifies the subdirectgory in examples
|
CONFIG_EXAMPLE - identifies the subdirectory in examples
|
||||||
that will be used in the build
|
that will be used in the build
|
||||||
CONFIG_DEBUG - enables built-in debug options
|
CONFIG_DEBUG - enables built-in debug options
|
||||||
CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
@ -82,7 +82,21 @@ defconfig -- This is a configuration file similar to the Linux
|
|||||||
CONFIG_DEV_CONSOLE - Set if architecture-specific logic
|
CONFIG_DEV_CONSOLE - Set if architecture-specific logic
|
||||||
provides /dev/console. Enables stdout, stderr, stdin.
|
provides /dev/console. Enables stdout, stderr, stdin.
|
||||||
|
|
||||||
Allow for artchitecture optimized implementations
|
The following can be used to disable categories of APIs supported
|
||||||
|
by the OS. If the compiler supports weak functions, then it
|
||||||
|
should not be necessary to disable functions unless you want to
|
||||||
|
restrict usage of those APIs.
|
||||||
|
|
||||||
|
There are certain dependency relationships in these features.
|
||||||
|
|
||||||
|
o mq_notify logic depends on signals to awaken tasks
|
||||||
|
waiting for queues to become full or empty.
|
||||||
|
o pthread_condtimedwait() depends on signals to wake
|
||||||
|
up waiting tasks.
|
||||||
|
|
||||||
|
CONFIG_DISABLE_SIGNALS, CONFIG_DISABLE_MQUEUE
|
||||||
|
|
||||||
|
Allow for architecture optimized implementations
|
||||||
|
|
||||||
The architecture can provide optimized versions of the
|
The architecture can provide optimized versions of the
|
||||||
following to improve sysem performance
|
following to improve sysem performance
|
||||||
|
@ -42,7 +42,7 @@ else
|
|||||||
-fomit-frame-pointer
|
-fomit-frame-pointer
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float
|
ARCHCPUFLAGS = -mapcs-32 -mcpu=arm7tdmi -msoft-float -fno-builtin
|
||||||
ARCHPICFLAGS = -fpic
|
ARCHPICFLAGS = -fpic
|
||||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||||
ARCHDEFINES =
|
ARCHDEFINES =
|
||||||
@ -62,6 +62,7 @@ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
|||||||
|
|
||||||
OBJEXT = .o
|
OBJEXT = .o
|
||||||
LIBEXT = .a
|
LIBEXT = .a
|
||||||
|
EXEEXT =
|
||||||
|
|
||||||
ifeq ("${CONFIG_DEBUG}","y")
|
ifeq ("${CONFIG_DEBUG}","y")
|
||||||
LDFLAGS += -g
|
LDFLAGS += -g
|
||||||
|
@ -77,7 +77,7 @@ CONFIG_UART_MODEM_2STOP=0
|
|||||||
#
|
#
|
||||||
# General OS setup
|
# General OS setup
|
||||||
#
|
#
|
||||||
# CONFIG_EXAMPLE - identifies the subdirectgory in examples
|
# CONFIG_EXAMPLE - identifies the subdirectory in examples
|
||||||
# that will be used in the build
|
# that will be used in the build
|
||||||
# CONFIG_DEBUG - enables built-in debug options
|
# CONFIG_DEBUG - enables built-in debug options
|
||||||
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
@ -111,7 +111,25 @@ CONFIG_JULIAN_TIME=n
|
|||||||
CONFIG_DEV_CONSOLE=y
|
CONFIG_DEV_CONSOLE=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Allow for artchitecture optimized implementations
|
# The following can be used to disable categories of
|
||||||
|
# APIs supported by the OS. If the compiler supports
|
||||||
|
# weak functions, then it should not be necessary to
|
||||||
|
# disable functions unless you want to restrict usage
|
||||||
|
# of those APIs.
|
||||||
|
#
|
||||||
|
# There are certain dependency relationships in these
|
||||||
|
# features.
|
||||||
|
#
|
||||||
|
# o mq_notify logic depends on signals to awaken tasks
|
||||||
|
# waiting for queues to become full or empty.
|
||||||
|
# o pthread_condtimedwait() depends on signals to wake
|
||||||
|
# up waiting tasks.
|
||||||
|
#
|
||||||
|
CONFIG_DISABLE_SIGNALS=n
|
||||||
|
CONFIG_DISABLE_MQUEUE=n
|
||||||
|
|
||||||
|
#
|
||||||
|
# Allow for architecture optimized implementations
|
||||||
#
|
#
|
||||||
# The architecture can provide optimized versions of the
|
# The architecture can provide optimized versions of the
|
||||||
# following to improve sysem performance
|
# following to improve sysem performance
|
||||||
|
@ -59,7 +59,7 @@ OBJS = $(AOBJS) $(COBJS)
|
|||||||
LDFLAGS = $(ARCHSCRIPT)
|
LDFLAGS = $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS =
|
EXTRA_LIBS =
|
||||||
|
|
||||||
LINKOBJS =
|
LINKOBJS = up_head$(OBJEXT)
|
||||||
LINKLIBS =
|
LINKLIBS =
|
||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
||||||
@ -68,7 +68,7 @@ LIBGCC = ${shell $(CC) -print-libgcc-file-name}
|
|||||||
|
|
||||||
all: up_head.o libarch$(LIBEXT)
|
all: up_head.o libarch$(LIBEXT)
|
||||||
|
|
||||||
$(AOBJS) up_head.o: %.o: %.S
|
$(AOBJS) $(LINKOBJS): %.o: %.S
|
||||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||||
|
|
||||||
$(COBJS): %.o: %.c
|
$(COBJS): %.o: %.c
|
||||||
@ -80,10 +80,9 @@ libarch$(LIBEXT): $(OBJS)
|
|||||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||||
done ; )
|
done ; )
|
||||||
|
|
||||||
nuttx:
|
nuttx: $(LINKOBJS)
|
||||||
$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ \
|
$(LD) --entry=__start $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
||||||
$(addprefix $(TOPDIR)/,$(LINKOBJS)) \
|
--start-group $(LDLIBS) --end-group $(EXTRA_LIBS) $(LIBGCC)
|
||||||
--start-group $(LDLIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group
|
|
||||||
@$(NM) $(TOPDIR)/$@ | \
|
@$(NM) $(TOPDIR)/$@ | \
|
||||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||||
sort > $(TOPDIR)/System.map
|
sort > $(TOPDIR)/System.map
|
||||||
|
@ -41,7 +41,7 @@ else
|
|||||||
ARCHOPTIMIZATION = -O2
|
ARCHOPTIMIZATION = -O2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ARCHCPUFLAGS =
|
ARCHCPUFLAGS = -fno-builtin
|
||||||
ARCHPICFLAGS = -fpic
|
ARCHPICFLAGS = -fpic
|
||||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow
|
||||||
ARCHDEFINES =
|
ARCHDEFINES =
|
||||||
@ -61,6 +61,7 @@ CFLAGS = $(ARCHWARNINGS) $(ARCHOPTIMIZATION) \
|
|||||||
|
|
||||||
OBJEXT = .o
|
OBJEXT = .o
|
||||||
LIBEXT = .a
|
LIBEXT = .a
|
||||||
|
EXEEXT =
|
||||||
|
|
||||||
ifeq ("${CONFIG_DEBUG}","y")
|
ifeq ("${CONFIG_DEBUG}","y")
|
||||||
LDFLAGS += -g
|
LDFLAGS += -g
|
||||||
|
@ -44,7 +44,7 @@ CONFIG_ARCH_SIM=y
|
|||||||
#
|
#
|
||||||
# General OS setup
|
# General OS setup
|
||||||
#
|
#
|
||||||
# CONFIG_EXAMPLE - identifies the subdirectgory in examples
|
# CONFIG_EXAMPLE - identifies the subdirectory in examples
|
||||||
# that will be used in the build
|
# that will be used in the build
|
||||||
# CONFIG_DEBUG - enables built-in debug options
|
# CONFIG_DEBUG - enables built-in debug options
|
||||||
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
# CONFIG_DEBUG_VERBOSE - enables verbose debug output
|
||||||
@ -73,12 +73,30 @@ CONFIG_SCHED_INSTRUMENTATION=n
|
|||||||
CONFIG_TASK_NAME_SIZE=32
|
CONFIG_TASK_NAME_SIZE=32
|
||||||
CONFIG_START_YEAR=2007
|
CONFIG_START_YEAR=2007
|
||||||
CONFIG_START_MONTH=2
|
CONFIG_START_MONTH=2
|
||||||
CONFIG_START_DAY=13
|
CONFIG_START_DAY=27
|
||||||
CONFIG_JULIAN_TIME=n
|
CONFIG_JULIAN_TIME=n
|
||||||
CONFIG_DEV_CONSOLE=y
|
CONFIG_DEV_CONSOLE=y
|
||||||
|
|
||||||
#
|
#
|
||||||
# Allow for artchitecture optimized implementations
|
# The following can be used to disable categories of
|
||||||
|
# APIs supported by the OS. If the compiler supports
|
||||||
|
# weak functions, then it should not be necessary to
|
||||||
|
# disable functions unless you want to restrict usage
|
||||||
|
# of those APIs.
|
||||||
|
#
|
||||||
|
# There are certain dependency relationships in these
|
||||||
|
# features.
|
||||||
|
#
|
||||||
|
# o mq_notify logic depends on signals to awaken tasks
|
||||||
|
# waiting for queues to become full or empty.
|
||||||
|
# o pthread_condtimedwait() depends on signals to wake
|
||||||
|
# up waiting tasks.
|
||||||
|
#
|
||||||
|
CONFIG_DISABLE_SIGNALS=n
|
||||||
|
CONFIG_DISABLE_MQUEUE=n
|
||||||
|
|
||||||
|
#
|
||||||
|
# Allow for architecture optimized implementations
|
||||||
#
|
#
|
||||||
# The architecture can provide optimized versions of the
|
# The architecture can provide optimized versions of the
|
||||||
# following to improve sysem performance
|
# following to improve sysem performance
|
||||||
|
@ -51,10 +51,10 @@ COBJS = $(CSRCS:.c=$(OBJEXT))
|
|||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
OBJS = $(AOBJS) $(COBJS)
|
OBJS = $(AOBJS) $(COBJS)
|
||||||
|
|
||||||
LDFLAGS = $(ARCHSCRIPT)
|
LDFLAGS = $(ARCHSCRIPT)
|
||||||
EXTRA_LIBS = -lc
|
EXTRA_LIBS = -lc
|
||||||
|
|
||||||
LINKOBJS =
|
LINKOBJS = up_head$(OBJEXT)
|
||||||
LINKLIBS =
|
LINKLIBS =
|
||||||
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
LDPATHES = $(addprefix -L$(TOPDIR)/,$(dir $(LINKLIBS)))
|
||||||
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
LDLIBS = $(patsubst lib%,-l%,$(basename $(notdir $(LINKLIBS))))
|
||||||
@ -64,7 +64,7 @@ all: up_head$(OBJEXT) libarch$(LIBEXT)
|
|||||||
$(AOBJS): %$(OBJEXT): %.S
|
$(AOBJS): %$(OBJEXT): %.S
|
||||||
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
$(CC) -c $(CFLAGS) -D__ASSEMBLY__ $< -o $@
|
||||||
|
|
||||||
$(COBJS) up_head$(OBJEXT): %$(OBJEXT): %.c
|
$(COBJS) $(LINKOBJS): %$(OBJEXT): %.c
|
||||||
$(CC) -c $(CFLAGS) $< -o $@
|
$(CC) -c $(CFLAGS) $< -o $@
|
||||||
|
|
||||||
libarch$(LIBEXT): $(OBJS)
|
libarch$(LIBEXT): $(OBJS)
|
||||||
@ -73,10 +73,9 @@ libarch$(LIBEXT): $(OBJS)
|
|||||||
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
{ echo "$(AR) $@ $obj FAILED!" ; exit 1 ; } ; \
|
||||||
done ; )
|
done ; )
|
||||||
|
|
||||||
nuttx:
|
nuttx: $(LINKOBJS)
|
||||||
$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ \
|
$(CC) $(LDFLAGS) $(LDPATHES) -o $(TOPDIR)/$@ $(LINKOBJS) \
|
||||||
$(addprefix $(TOPDIR)/,$(LINKOBJS)) \
|
-Wl,--start-group $(LDLIBS) -Wl,--end-group $(EXTRA_LIBS)
|
||||||
-Wl,--start-group $(LDLIBS) $(EXTRA_LIBS) -Wl,--end-group
|
|
||||||
@$(NM) $(TOPDIR)/$@ | \
|
@$(NM) $(TOPDIR)/$@ | \
|
||||||
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | \
|
||||||
sort > $(TOPDIR)/System.map
|
sort > $(TOPDIR)/System.map
|
||||||
|
@ -40,8 +40,14 @@ MKDEP = $(TOPDIR)/tools/mkdeps.sh
|
|||||||
|
|
||||||
ASRCS =
|
ASRCS =
|
||||||
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
AOBJS = $(ASRCS:.S=$(OBJEXT))
|
||||||
CSRCS = main.c dev_null.c mutex.c cancel.c sem.c cond.c \
|
CSRCS = main.c dev_null.c mutex.c cancel.c sem.c cond.c
|
||||||
timedwait.c mqueue.c sighand.c
|
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||||
|
CSRCS += timedwait.c sighand.c
|
||||||
|
endif
|
||||||
|
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
|
||||||
|
CSRCS += mqueue.c
|
||||||
|
endif
|
||||||
|
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
|
@ -120,17 +120,25 @@ static int user_main(int argc, char *argv[])
|
|||||||
|
|
||||||
cond_test();
|
cond_test();
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
/* Verify pthreads and condition variable timed waits */
|
/* Verify pthreads and condition variable timed waits */
|
||||||
|
|
||||||
timedwait_test();
|
timedwait_test();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
/* Verify pthreads and message queues */
|
/* Verify pthreads and message queues */
|
||||||
|
|
||||||
mqueue_test();
|
mqueue_test();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
/* Verify signal handlers */
|
/* Verify signal handlers */
|
||||||
|
|
||||||
sighand_test();
|
sighand_test();
|
||||||
|
#endif
|
||||||
|
|
||||||
|
printf("user_main: Exitting\n");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -73,6 +73,7 @@
|
|||||||
|
|
||||||
# define FAR
|
# define FAR
|
||||||
# define NEAR
|
# define NEAR
|
||||||
|
# define DSEG
|
||||||
|
|
||||||
/* Select the large, 32-bit addressing model */
|
/* Select the large, 32-bit addressing model */
|
||||||
|
|
||||||
@ -127,6 +128,12 @@
|
|||||||
#define FAR __xdata
|
#define FAR __xdata
|
||||||
#define NEAR __data
|
#define NEAR __data
|
||||||
|
|
||||||
|
#if defined(SDCC_MODEL_SMALL)
|
||||||
|
# define DSEG __data
|
||||||
|
#else
|
||||||
|
# define DSEG __xdata
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Select small, 16-bit address model */
|
/* Select small, 16-bit address model */
|
||||||
|
|
||||||
# define CONFIG_SMALL_MEMORY 1
|
# define CONFIG_SMALL_MEMORY 1
|
||||||
@ -159,6 +166,7 @@
|
|||||||
|
|
||||||
# define FAR
|
# define FAR
|
||||||
# define NEAR
|
# define NEAR
|
||||||
|
# define DSEG
|
||||||
|
|
||||||
# undef CONFIG_SMALL_MEMORY
|
# undef CONFIG_SMALL_MEMORY
|
||||||
# undef CONFIG_HAVE_INLINE
|
# undef CONFIG_HAVE_INLINE
|
||||||
|
@ -102,9 +102,13 @@ typedef enum tstate_e
|
|||||||
|
|
||||||
TSTATE_TASK_INACTIVE = 4, /* BLOCKED - Initialized but not yet activated */
|
TSTATE_TASK_INACTIVE = 4, /* BLOCKED - Initialized but not yet activated */
|
||||||
TSTATE_WAIT_SEM = 5, /* BLOCKED - Waiting for a semaphore */
|
TSTATE_WAIT_SEM = 5, /* BLOCKED - Waiting for a semaphore */
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
TSTATE_WAIT_SIG = 6, /* BLOCKED - Waiting for a signal */
|
TSTATE_WAIT_SIG = 6, /* BLOCKED - Waiting for a signal */
|
||||||
TSTATE_WAIT_MQNOTEMPTY = 7, /* BLOCKED - Waiting for a MQ to become not empty. */
|
#endif
|
||||||
TSTATE_WAIT_MQNOTFULL = 8 /* BLOCKED - Waiting for a MQ to become not full. */
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
|
TSTATE_WAIT_MQNOTEMPTY, /* BLOCKED - Waiting for a MQ to become not empty. */
|
||||||
|
TSTATE_WAIT_MQNOTFULL /* BLOCKED - Waiting for a MQ to become not full. */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
typedef enum tstate_e tstate_t;
|
typedef enum tstate_e tstate_t;
|
||||||
|
|
||||||
@ -113,8 +117,22 @@ typedef enum tstate_e tstate_t;
|
|||||||
#define FIRST_READY_TO_RUN_STATE TSTATE_TASK_READYTORUN
|
#define FIRST_READY_TO_RUN_STATE TSTATE_TASK_READYTORUN
|
||||||
#define LAST_READY_TO_RUN_STATE TSTATE_TASK_RUNNING
|
#define LAST_READY_TO_RUN_STATE TSTATE_TASK_RUNNING
|
||||||
#define FIRST_BLOCKED_STATE TSTATE_TASK_INACTIVE
|
#define FIRST_BLOCKED_STATE TSTATE_TASK_INACTIVE
|
||||||
#define LAST_BLOCKED_STATE TSTATE_WAIT_MQNOTFULL
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
#define NUM_TASK_STATES 9
|
# define LAST_BLOCKED_STATE TSTATE_WAIT_MQNOTFULL
|
||||||
|
# ifndef CONFIG_DISABLE_SIGNALS
|
||||||
|
# define NUM_TASK_STATES 9
|
||||||
|
# else
|
||||||
|
# define NUM_TASK_STATES 8
|
||||||
|
# endif
|
||||||
|
#else
|
||||||
|
# ifndef CONFIG_DISABLE_SIGNALS
|
||||||
|
# define LAST_BLOCKED_STATE TSTATE_WAIT_SIG
|
||||||
|
# define NUM_TASK_STATES 7
|
||||||
|
# else
|
||||||
|
# define LAST_BLOCKED_STATE TSTATE_WAIT_SEM
|
||||||
|
# define NUM_TASK_STATES 6
|
||||||
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
/* The following is the form of a thread start-up function */
|
/* The following is the form of a thread start-up function */
|
||||||
|
|
||||||
@ -192,6 +210,7 @@ struct _TCB
|
|||||||
|
|
||||||
/* POSIX Signal Control Fields **************************************/
|
/* POSIX Signal Control Fields **************************************/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
sigset_t sigprocmask; /* Signals that are blocked */
|
sigset_t sigprocmask; /* Signals that are blocked */
|
||||||
sigset_t sigwaitmask; /* Waiting for pending signals */
|
sigset_t sigwaitmask; /* Waiting for pending signals */
|
||||||
sq_queue_t sigactionq; /* List of actions for signals */
|
sq_queue_t sigactionq; /* List of actions for signals */
|
||||||
@ -199,11 +218,14 @@ struct _TCB
|
|||||||
sq_queue_t sigpendactionq; /* List of pending signal actions */
|
sq_queue_t sigpendactionq; /* List of pending signal actions */
|
||||||
sq_queue_t sigpostedq; /* List of posted signals */
|
sq_queue_t sigpostedq; /* List of posted signals */
|
||||||
siginfo_t sigunbinfo; /* Signal info when task unblocked */
|
siginfo_t sigunbinfo; /* Signal info when task unblocked */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* POSIX Named Message Queue Fields *********************************/
|
/* POSIX Named Message Queue Fields *********************************/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
sq_queue_t msgdesq; /* List of opened message queues */
|
sq_queue_t msgdesq; /* List of opened message queues */
|
||||||
FAR msgq_t *msgwaitq; /* Waiting for this message queue */
|
FAR msgq_t *msgwaitq; /* Waiting for this message queue */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Library related fields *******************************************/
|
/* Library related fields *******************************************/
|
||||||
|
|
||||||
|
@ -67,9 +67,11 @@ SIGNAL_SRCS = sig_initialize.c \
|
|||||||
sig_releasependingsignal.c sig_lowest.c sig_mqnotempty.c \
|
sig_releasependingsignal.c sig_lowest.c sig_mqnotempty.c \
|
||||||
sig_cleanup.c sig_received.c sig_deliver.c
|
sig_cleanup.c sig_received.c sig_deliver.c
|
||||||
MQUEUE_SRCS = mq_open.c mq_close.c mq_unlink.c mq_send.c mq_receive.c \
|
MQUEUE_SRCS = mq_open.c mq_close.c mq_unlink.c mq_send.c mq_receive.c \
|
||||||
mq_notify.c mq_setattr.c mq_getattr.c \
|
mq_setattr.c mq_getattr.c mq_initialize.c mq_descreate.c \
|
||||||
mq_initialize.c mq_descreate.c mq_findnamed.c \
|
mq_findnamed.c mq_msgfree.c mq_msgqfree.c
|
||||||
mq_msgfree.c mq_msgqfree.c
|
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||||
|
MQUEUE_SRCS += mq_notify.c
|
||||||
|
endif
|
||||||
PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \
|
PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \
|
||||||
pthread_attrsetschedpolicy.c pthread_attrgetschedpolicy.c \
|
pthread_attrsetschedpolicy.c pthread_attrgetschedpolicy.c \
|
||||||
pthread_attrsetinheritsched.c pthread_attrgetinheritsched.c \
|
pthread_attrsetinheritsched.c pthread_attrgetinheritsched.c \
|
||||||
@ -83,19 +85,28 @@ PTHREAD_SRCS = pthread_attrinit.c pthread_attrdestroy.c \
|
|||||||
pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c \
|
pthread_mutexlock.c pthread_mutextrylock.c pthread_mutexunlock.c \
|
||||||
pthread_condinit.c pthread_conddestroy.c \
|
pthread_condinit.c pthread_conddestroy.c \
|
||||||
pthread_condattrinit.c pthread_condattrdestroy.c \
|
pthread_condattrinit.c pthread_condattrdestroy.c \
|
||||||
pthread_condwait.c pthread_condtimedwait.c \
|
pthread_condwait.c pthread_condsignal.c pthread_condbroadcast.c \
|
||||||
pthread_condsignal.c pthread_condbroadcast.c \
|
|
||||||
pthread_cancel.c pthread_setcancelstate.c \
|
pthread_cancel.c pthread_setcancelstate.c \
|
||||||
pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c pthread_keydelete.c \
|
pthread_keycreate.c pthread_setspecific.c pthread_getspecific.c pthread_keydelete.c \
|
||||||
pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c \
|
pthread_initialize.c pthread_completejoin.c pthread_findjoininfo.c \
|
||||||
pthread_removejoininfo.c
|
pthread_removejoininfo.c
|
||||||
|
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||||
|
PTHREAD_SRCS += pthread_condtimedwait.c
|
||||||
|
endif
|
||||||
SEM_SRCS = sem_initialize.c sem_init.c sem_destroy.c\
|
SEM_SRCS = sem_initialize.c sem_init.c sem_destroy.c\
|
||||||
sem_open.c sem_close.c sem_unlink.c \
|
sem_open.c sem_close.c sem_unlink.c \
|
||||||
sem_wait.c sem_trywait.c sem_post.c sem_getvalue.c \
|
sem_wait.c sem_trywait.c sem_post.c sem_getvalue.c \
|
||||||
sem_waitirq.c sem_findnamed.c
|
sem_waitirq.c sem_findnamed.c
|
||||||
IRQ_SRCS = irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c
|
IRQ_SRCS = irq_initialize.c irq_attach.c irq_dispatch.c irq_unexpectedisr.c
|
||||||
|
|
||||||
CSRCS = $(MISC_SRCS) $(TSK_SRCS) $(SCHED_SRCS) $(WDOG_SRCS) $(TIME_SRCS) \
|
CSRCS = $(MISC_SRCS) $(TSK_SRCS) $(SCHED_SRCS) $(WDOG_SRCS) $(TIME_SRCS) \
|
||||||
$(SIGNAL_SRCS) $(MQUEUE_SRCS) $(PTHREAD_SRCS) $(SEM_SRCS) $(IRQ_SRCS)
|
$(PTHREAD_SRCS) $(SEM_SRCS) $(IRQ_SRCS)
|
||||||
|
ifneq ($(CONFIG_DISABLE_SIGNALS),y)
|
||||||
|
CSRCS += $(SIGNAL_SRCS)
|
||||||
|
endif
|
||||||
|
ifneq ($(CONFIG_DISABLE_MQUEUE),y)
|
||||||
|
CSRCS += $(MQUEUE_SRCS)
|
||||||
|
endif
|
||||||
COBJS = $(CSRCS:.c=$(OBJEXT))
|
COBJS = $(CSRCS:.c=$(OBJEXT))
|
||||||
|
|
||||||
SRCS = $(ASRCS) $(CSRCS)
|
SRCS = $(ASRCS) $(CSRCS)
|
||||||
|
@ -138,6 +138,7 @@ int mq_close(mqd_t mqdes)
|
|||||||
* the message queue via this mqdes.
|
* the message queue via this mqdes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
if (msgq->ntmqdes == mqdes)
|
if (msgq->ntmqdes == mqdes)
|
||||||
{
|
{
|
||||||
msgq->ntpid = INVALID_PROCESS_ID;
|
msgq->ntpid = INVALID_PROCESS_ID;
|
||||||
@ -145,6 +146,7 @@ int mq_close(mqd_t mqdes)
|
|||||||
msgq->ntvalue.sival_int = 0;
|
msgq->ntvalue.sival_int = 0;
|
||||||
msgq->ntmqdes = NULL;
|
msgq->ntmqdes = NULL;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Decrement the connection count on the message queue. */
|
/* Decrement the connection count on the message queue. */
|
||||||
|
|
||||||
|
@ -119,10 +119,12 @@ struct msgq_s
|
|||||||
sint16 nwaitnotempty; /* Number tasks waiting for not empty */
|
sint16 nwaitnotempty; /* Number tasks waiting for not empty */
|
||||||
ubyte maxmsgsize; /* Max size of message in message queue */
|
ubyte maxmsgsize; /* Max size of message in message queue */
|
||||||
boolean unlinked; /* TRUE if the msg queue has been unlinked */
|
boolean unlinked; /* TRUE if the msg queue has been unlinked */
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */
|
FAR struct mq_des *ntmqdes; /* Notification: Owning mqdes (NULL if none) */
|
||||||
pid_t ntpid; /* Notification: Receiving Task's PID */
|
pid_t ntpid; /* Notification: Receiving Task's PID */
|
||||||
int ntsigno; /* Notification: Signal number */
|
int ntsigno; /* Notification: Signal number */
|
||||||
union sigval ntvalue; /* Notification: Signal value */
|
union sigval ntvalue; /* Notification: Signal value */
|
||||||
|
#endif
|
||||||
char name[1]; /* Start of the queue name */
|
char name[1]; /* Start of the queue name */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -189,7 +189,9 @@ mqd_t mq_open(const char *mq_name, int oflags, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
msgq->nconnect = 1;
|
msgq->nconnect = 1;
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
msgq->ntpid = INVALID_PROCESS_ID;
|
msgq->ntpid = INVALID_PROCESS_ID;
|
||||||
|
#endif
|
||||||
strcpy(msgq->name, mq_name);
|
strcpy(msgq->name, mq_name);
|
||||||
|
|
||||||
/* Add the new message queue to the list of
|
/* Add the new message queue to the list of
|
||||||
|
@ -37,17 +37,19 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
#include <nuttx/kmalloc.h>
|
#include <nuttx/kmalloc.h>
|
||||||
#include <sys/types.h> /* uint32, etc. */
|
#include <sys/types.h> /* uint32, etc. */
|
||||||
#include <mqueue.h>
|
#include <mqueue.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
#include "sig_internal.h"
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
#include "mq_internal.h"
|
# include "sig_internal.h"
|
||||||
|
#endif
|
||||||
|
#include "mq_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
@ -339,6 +341,7 @@ int mq_send(mqd_t mqdes, const void *msg, size_t msglen, int prio)
|
|||||||
* message queue
|
* message queue
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
if (msgq->ntmqdes)
|
if (msgq->ntmqdes)
|
||||||
{
|
{
|
||||||
/* Remove the message notification data from the message queue. */
|
/* Remove the message notification data from the message queue. */
|
||||||
@ -366,7 +369,7 @@ int mq_send(mqd_t mqdes, const void *msg, size_t msglen, int prio)
|
|||||||
sig_mqnotempty(pid, signo, sival_ptr);
|
sig_mqnotempty(pid, signo, sival_ptr);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* Check if any tasks are waiting for the MQ not empty event. */
|
/* Check if any tasks are waiting for the MQ not empty event. */
|
||||||
|
|
||||||
saved_state = irqsave();
|
saved_state = irqsave();
|
||||||
|
@ -135,7 +135,7 @@ typedef struct pidhash_s pidhash_t;
|
|||||||
|
|
||||||
struct tasklist_s
|
struct tasklist_s
|
||||||
{
|
{
|
||||||
NEAR dq_queue_t *list; /* Pointer to the task list */
|
DSEG dq_queue_t *list; /* Pointer to the task list */
|
||||||
boolean prioritized; /* TRUE if the list is prioritized */
|
boolean prioritized; /* TRUE if the list is prioritized */
|
||||||
};
|
};
|
||||||
typedef struct tasklist_s tasklist_t;
|
typedef struct tasklist_s tasklist_t;
|
||||||
@ -177,19 +177,25 @@ extern dq_queue_t g_waitingforsemaphore;
|
|||||||
|
|
||||||
/* This is the list of all tasks that are blocked waiting for a signal */
|
/* This is the list of all tasks that are blocked waiting for a signal */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
extern dq_queue_t g_waitingforsignal;
|
extern dq_queue_t g_waitingforsignal;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is the list of all tasks that are blocked waiting for a message
|
/* This is the list of all tasks that are blocked waiting for a message
|
||||||
* queue to become non-empty.
|
* queue to become non-empty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
extern dq_queue_t g_waitingformqnotempty;
|
extern dq_queue_t g_waitingformqnotempty;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is the list of all tasks that are blocked waiting for a message
|
/* This is the list of all tasks that are blocked waiting for a message
|
||||||
* queue to become non-full.
|
* queue to become non-full.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
extern dq_queue_t g_waitingformqnotfull;
|
extern dq_queue_t g_waitingformqnotfull;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This the list of all tasks that have been initialized, but not yet
|
/* This the list of all tasks that have been initialized, but not yet
|
||||||
* activated. NOTE: This is the only list that is not prioritized.
|
* activated. NOTE: This is the only list that is not prioritized.
|
||||||
@ -241,7 +247,7 @@ extern STATUS _task_init(FAR _TCB *tcb, const char *name, int priority,
|
|||||||
extern boolean sched_addreadytorun(FAR _TCB *rtrtcb);
|
extern boolean sched_addreadytorun(FAR _TCB *rtrtcb);
|
||||||
extern boolean sched_removereadytorun(FAR _TCB *rtrtcb);
|
extern boolean sched_removereadytorun(FAR _TCB *rtrtcb);
|
||||||
extern boolean sched_addprioritized(FAR _TCB *newTcb,
|
extern boolean sched_addprioritized(FAR _TCB *newTcb,
|
||||||
NEAR dq_queue_t *list);
|
DSEG dq_queue_t *list);
|
||||||
extern boolean sched_mergepending(void);
|
extern boolean sched_mergepending(void);
|
||||||
extern void sched_addblocked(FAR _TCB *btcb, tstate_t task_state);
|
extern void sched_addblocked(FAR _TCB *btcb, tstate_t task_state);
|
||||||
extern void sched_removeblocked(FAR _TCB *btcb);
|
extern void sched_removeblocked(FAR _TCB *btcb);
|
||||||
|
@ -37,23 +37,25 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <nuttx/arch.h>
|
#include <nuttx/arch.h>
|
||||||
#include <nuttx/compiler.h>
|
#include <nuttx/compiler.h>
|
||||||
#include <nuttx/fs.h>
|
#include <nuttx/fs.h>
|
||||||
#include <nuttx/lib.h>
|
#include <nuttx/lib.h>
|
||||||
#include <nuttx/os_external.h>
|
#include <nuttx/os_external.h>
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
#include "sig_internal.h"
|
#include "sig_internal.h"
|
||||||
#include "wd_internal.h"
|
#include "wd_internal.h"
|
||||||
#include "sem_internal.h"
|
#include "sem_internal.h"
|
||||||
#include "mq_internal.h"
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
#include "pthread_internal.h"
|
# include "mq_internal.h"
|
||||||
#include "clock_internal.h"
|
#endif
|
||||||
#include "irq_internal.h"
|
#include "pthread_internal.h"
|
||||||
|
#include "clock_internal.h"
|
||||||
|
#include "irq_internal.h"
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
@ -99,19 +101,25 @@ dq_queue_t g_waitingforsemaphore;
|
|||||||
|
|
||||||
/* This is the list of all tasks that are blocked waiting for a signal */
|
/* This is the list of all tasks that are blocked waiting for a signal */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
dq_queue_t g_waitingforsignal;
|
dq_queue_t g_waitingforsignal;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is the list of all tasks that are blocked waiting for a message
|
/* This is the list of all tasks that are blocked waiting for a message
|
||||||
* queue to become non-empty.
|
* queue to become non-empty.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
dq_queue_t g_waitingformqnotempty;
|
dq_queue_t g_waitingformqnotempty;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This is the list of all tasks that are blocked waiting for a message
|
/* This is the list of all tasks that are blocked waiting for a message
|
||||||
* queue to become non-full.
|
* queue to become non-full.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
dq_queue_t g_waitingformqnotfull;
|
dq_queue_t g_waitingformqnotfull;
|
||||||
|
#endif
|
||||||
|
|
||||||
/* This the list of all tasks that have been initialized, but not yet
|
/* This the list of all tasks that have been initialized, but not yet
|
||||||
* activated. NOTE: This is the only list that is not prioritized.
|
* activated. NOTE: This is the only list that is not prioritized.
|
||||||
@ -156,9 +164,13 @@ const tasklist_t g_tasklisttable[NUM_TASK_STATES] =
|
|||||||
{ &g_readytorun, TRUE }, /* TSTATE_TASK_RUNNING */
|
{ &g_readytorun, TRUE }, /* TSTATE_TASK_RUNNING */
|
||||||
{ &g_inactivetasks, FALSE }, /* TSTATE_TASK_INACTIVE */
|
{ &g_inactivetasks, FALSE }, /* TSTATE_TASK_INACTIVE */
|
||||||
{ &g_waitingforsemaphore, TRUE }, /* TSTATE_WAIT_SEM */
|
{ &g_waitingforsemaphore, TRUE }, /* TSTATE_WAIT_SEM */
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
{ &g_waitingforsignal, FALSE }, /* TSTATE_WAIT_SIG */
|
{ &g_waitingforsignal, FALSE }, /* TSTATE_WAIT_SIG */
|
||||||
|
#endif
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
{ &g_waitingformqnotempty, TRUE }, /* TSTATE_WAIT_MQNOTEMPTY */
|
{ &g_waitingformqnotempty, TRUE }, /* TSTATE_WAIT_MQNOTEMPTY */
|
||||||
{ &g_waitingformqnotfull, TRUE } /* TSTATE_WAIT_MQNOTFULL */
|
{ &g_waitingformqnotfull, TRUE } /* TSTATE_WAIT_MQNOTFULL */
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
@ -200,9 +212,13 @@ void os_start(void)
|
|||||||
dq_init(&g_readytorun);
|
dq_init(&g_readytorun);
|
||||||
dq_init(&g_pendingtasks);
|
dq_init(&g_pendingtasks);
|
||||||
dq_init(&g_waitingforsemaphore);
|
dq_init(&g_waitingforsemaphore);
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
dq_init(&g_waitingforsignal);
|
dq_init(&g_waitingforsignal);
|
||||||
|
#endif
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
dq_init(&g_waitingformqnotfull);
|
dq_init(&g_waitingformqnotfull);
|
||||||
dq_init(&g_waitingformqnotempty);
|
dq_init(&g_waitingformqnotempty);
|
||||||
|
#endif
|
||||||
dq_init(&g_inactivetasks);
|
dq_init(&g_inactivetasks);
|
||||||
sq_init(&g_delayeddeallocations);
|
sq_init(&g_delayeddeallocations);
|
||||||
|
|
||||||
@ -300,12 +316,14 @@ void os_start(void)
|
|||||||
|
|
||||||
/* Initialize the signal facility (if in link) */
|
/* Initialize the signal facility (if in link) */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
|
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
|
||||||
if (sig_initialize != NULL)
|
if (sig_initialize != NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
sig_initialize();
|
sig_initialize();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize the semaphore facility. (if in link) */
|
/* Initialize the semaphore facility. (if in link) */
|
||||||
|
|
||||||
@ -318,12 +336,14 @@ void os_start(void)
|
|||||||
|
|
||||||
/* Initialize the named message queue facility (if in link) */
|
/* Initialize the named message queue facility (if in link) */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_MQUEUE
|
||||||
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
|
#ifdef CONFIG_HAVE_WEAKFUNCTIONS
|
||||||
if (mq_initialize != NULL)
|
if (mq_initialize != NULL)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
mq_initialize();
|
mq_initialize();
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Initialize the thread-specific data facility (if in link) */
|
/* Initialize the thread-specific data facility (if in link) */
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
* match the state associated with the list.
|
* match the state associated with the list.
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
boolean sched_addprioritized(FAR _TCB *tcb, NEAR dq_queue_t *list)
|
boolean sched_addprioritized(FAR _TCB *tcb, DSEG dq_queue_t *list)
|
||||||
{
|
{
|
||||||
FAR _TCB *next;
|
FAR _TCB *next;
|
||||||
FAR _TCB *prev;
|
FAR _TCB *prev;
|
||||||
|
@ -308,8 +308,10 @@ STATUS _task_init(FAR _TCB *tcb, const char *name, int priority,
|
|||||||
|
|
||||||
/* Initialize other (non-zero) elements of the TCB */
|
/* Initialize other (non-zero) elements of the TCB */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
tcb->sigprocmask = ALL_SIGNAL_SET;
|
tcb->sigprocmask = ALL_SIGNAL_SET;
|
||||||
tcb->task_state = TSTATE_TASK_INVALID;
|
#endif
|
||||||
|
tcb->task_state = TSTATE_TASK_INVALID;
|
||||||
|
|
||||||
/* Initialize the processor-specific portion of the TCB */
|
/* Initialize the processor-specific portion of the TCB */
|
||||||
|
|
||||||
|
@ -37,13 +37,15 @@
|
|||||||
* Included Files
|
* Included Files
|
||||||
************************************************************/
|
************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <nuttx/os_external.h>
|
#include <nuttx/os_external.h>
|
||||||
#include "os_internal.h"
|
#include "os_internal.h"
|
||||||
#include "sig_internal.h"
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
|
# include "sig_internal.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
/************************************************************
|
/************************************************************
|
||||||
* Definitions
|
* Definitions
|
||||||
@ -156,7 +158,9 @@ STATUS task_delete(pid_t pid)
|
|||||||
|
|
||||||
/* Deallocate anything left in the TCB's queues */
|
/* Deallocate anything left in the TCB's queues */
|
||||||
|
|
||||||
|
#ifndef CONFIG_DISABLE_SIGNALS
|
||||||
sig_cleanup(dtcb); /* Deallocate Signal lists */
|
sig_cleanup(dtcb); /* Deallocate Signal lists */
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Deallocate its TCB */
|
/* Deallocate its TCB */
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user