diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-20 13:27:43 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-06-20 13:27:43 +0000 |
commit | da5f1cc34dbdad2acc578e73e7891589b7bd5a3e (patch) | |
tree | 4a6b6fd455f2dbaa8111e2e7e450baac8362a975 /nuttx | |
parent | 33a230525902b2cc0bfd731d632e7b3ec0f1fafb (diff) | |
download | px4-nuttx-da5f1cc34dbdad2acc578e73e7891589b7bd5a3e.tar.gz px4-nuttx-da5f1cc34dbdad2acc578e73e7891589b7bd5a3e.tar.bz2 px4-nuttx-da5f1cc34dbdad2acc578e73e7891589b7bd5a3e.zip |
Finish nxflat test Makefiles
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1913 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx')
-rw-r--r-- | nuttx/examples/nxflat/tests/Make.defs | 6 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/Makefile | 2 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/errno/Makefile | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/hello++/Makefile | 18 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/hello/Makefile | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/longjmp/Makefile | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/mutex/Makefile | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/mutex/mutex.c | 13 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/pthread/Makefile | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/signal/Makefile | 4 | ||||
-rw-r--r-- | nuttx/examples/nxflat/tests/task/Makefile | 4 | ||||
-rw-r--r-- | nuttx/include/signal.h | 8 |
12 files changed, 35 insertions, 40 deletions
diff --git a/nuttx/examples/nxflat/tests/Make.defs b/nuttx/examples/nxflat/tests/Make.defs index 3f4445a7a..9277ce9cb 100644 --- a/nuttx/examples/nxflat/tests/Make.defs +++ b/nuttx/examples/nxflat/tests/Make.defs @@ -39,6 +39,8 @@ NXFLATCXX = $(CXX) NXFLATCXXFLAGS = $(CXXPICFLAGS) NXFLATLD = $(LD) -NXFLATLDFLAGS1 = -e main -NXFLATLDFLAGS2 = -e main -T $(TOPDIR)/examples/nxflat/tests/nxflat.ld -no-check-sections +NXFLATLDFLAGS1 = -r -d -warn-common +NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T $(TOPDIR)/examples/nxflat/tests/nxflat.ld -no-check-sections + +LDNXFLATFLAGS = -e main -s 2048 diff --git a/nuttx/examples/nxflat/tests/Makefile b/nuttx/examples/nxflat/tests/Makefile index 35ad4644e..979bbc92b 100644 --- a/nuttx/examples/nxflat/tests/Makefile +++ b/nuttx/examples/nxflat/tests/Makefile @@ -35,7 +35,7 @@ # Most of these do no build yet #SUBDIRS = errno hello hello++ longjmp mutex pthread signal task -SUBDIRS = errno hello pthread task +SUBDIRS = errno hello mutex pthread task define DIR_template $(1)_$(2): diff --git a/nuttx/examples/nxflat/tests/errno/Makefile b/nuttx/examples/nxflat/tests/errno/Makefile index ad409e758..40544a1e0 100644 --- a/nuttx/examples/nxflat/tests/errno/Makefile +++ b/nuttx/examples/nxflat/tests/errno/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/hello++/Makefile b/nuttx/examples/nxflat/tests/hello++/Makefile index 6d8388f23..f9419cf6c 100644 --- a/nuttx/examples/nxflat/tests/hello++/Makefile +++ b/nuttx/examples/nxflat/tests/hello++/Makefile @@ -59,7 +59,7 @@ R2SRC3 = $(BIN3)-thunk.S R2OBJ3 = $(R2SRC3:.S=.o) #R1SRCS4 = $(BIN4).c -#R1OBJS4 = $(R1SRCS4:.c=.o) +#R1OBJS4 = $(R1SRCS4:.c=.o) #R2SRC4 = $(BIN4)-thunk.S #R2OBJ4 = $(R2SRC4:.S=.o) @@ -91,7 +91,7 @@ $(LIBSTDC_STUBS_LIB): # not statically initialized. $(BIN1).r1: $(R1OBJS1) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC1): $(BIN1).r1 $(MKNXFLAT) -o $@ $^ @@ -100,10 +100,10 @@ $(BIN1).r2: $(R2OBJ1) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS1) $(R2OBJ1) $(BIN1): $(BIN1).r2 - touch $(BIN1) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ $(BIN2).r1: $(R1OBJS2) $(LIBSTDC_STUBS_LIB) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC2): $(BIN2).r1 $(MKNXFLAT) -o $@ $^ @@ -112,7 +112,7 @@ $(BIN2).r2: $(R2OBJ2) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS2) $(R2OBJ2) (BIN2): $(BIN2).r2 - touch $(BIN2) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ # BIN3 and BIN4 require that we include --cxx in the xflat-ld command. # This will instruct xflat-ld that we want it to put togethe the correct @@ -121,7 +121,7 @@ $(BIN2).r2: $(R2OBJ2) # BIN3 is equivalent to BIN2 except that is uses static initializers $(BIN3).r1: $(R1OBJS3) $(LIBSTDC_STUBS_LIB) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC3): $(BIN3).r1 $(MKNXFLAT) -o $@ $^ @@ -130,14 +130,14 @@ $(BIN3).r2: $(R2OBJ3) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS3) $(R2OBJ3) $(BIN3): $(BIN3).r2 - touch $(BIN3) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ # BIN4 is similar to BIN3 except that it uses the streams code from libstdc++ # # NOTE: libstdc++ is not available for XFLAT as of this writing # #$(BIN4).r1: $(R1OBJS4) $(LIBSTDC_STUBS_LIB) -# $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ +# $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ # #$(R2SRC4): $(BIN4).r1 # $(MKNXFLAT) -o $@ $^ @@ -146,7 +146,7 @@ $(BIN3): $(BIN3).r2 # $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS4) $(R2OBJ4) # #$(BIN4): $(BIN4).r2 -# touch $(BIN4) # For now +# $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(ALL_BIN) $(DERIVED) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/hello/Makefile b/nuttx/examples/nxflat/tests/hello/Makefile index 80912c075..7aea72240 100644 --- a/nuttx/examples/nxflat/tests/hello/Makefile +++ b/nuttx/examples/nxflat/tests/hello/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/longjmp/Makefile b/nuttx/examples/nxflat/tests/longjmp/Makefile index fcca4c827..9ad186791 100644 --- a/nuttx/examples/nxflat/tests/longjmp/Makefile +++ b/nuttx/examples/nxflat/tests/longjmp/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/mutex/Makefile b/nuttx/examples/nxflat/tests/mutex/Makefile index e52bcfb48..f4b58987b 100644 --- a/nuttx/examples/nxflat/tests/mutex/Makefile +++ b/nuttx/examples/nxflat/tests/mutex/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/mutex/mutex.c b/nuttx/examples/nxflat/tests/mutex/mutex.c index dc42331ee..1553f0487 100644 --- a/nuttx/examples/nxflat/tests/mutex/mutex.c +++ b/nuttx/examples/nxflat/tests/mutex/mutex.c @@ -40,7 +40,6 @@ #include <stdio.h> #include <stdlib.h> #include <pthread.h> -#include <signal.h> /**************************************************************************** * Private Data @@ -89,14 +88,6 @@ static void thread_func(void *parameter) } } -static void signal_handler(int signo) -{ - printf("\tThread1\tThread2\n"); - printf("Loops\t%ld\t%ld\n", nloops[0], nloops[1]); - printf("Errors\t%ld\t%ld\n", nerrors[0], nerrors[1]); - exit(0); -} - /**************************************************************************** * Public Functions ****************************************************************************/ @@ -107,10 +98,6 @@ int main(int argc, char **argv, char **envp) printf("Starting threads\n"); - /* Set up to catch control-C interrupt */ - - (void)signal(SIGINT, signal_handler); - /* Initialize the mutex */ pthread_mutex_init(&mut, NULL); diff --git a/nuttx/examples/nxflat/tests/pthread/Makefile b/nuttx/examples/nxflat/tests/pthread/Makefile index c4ffbd7c7..7008ec776 100644 --- a/nuttx/examples/nxflat/tests/pthread/Makefile +++ b/nuttx/examples/nxflat/tests/pthread/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/signal/Makefile b/nuttx/examples/nxflat/tests/signal/Makefile index 197a410e6..c613cb0f1 100644 --- a/nuttx/examples/nxflat/tests/signal/Makefile +++ b/nuttx/examples/nxflat/tests/signal/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/examples/nxflat/tests/task/Makefile b/nuttx/examples/nxflat/tests/task/Makefile index 6fe0bd3e6..07254dba1 100644 --- a/nuttx/examples/nxflat/tests/task/Makefile +++ b/nuttx/examples/nxflat/tests/task/Makefile @@ -54,7 +54,7 @@ $(R2OBJ): %.o: %.S $(NXFLATCC) -c $(NXFLATCFLAGS) $< -o $@ $(BIN).r1: $(R1OBJS) - $(NXFLATLD) -r $(NXFLATLDFLAGS1) -o $@ $^ + $(NXFLATLD) $(NXFLATLDFLAGS1) -o $@ $^ $(R2SRC): $(BIN).r1 $(MKNXFLAT) -o $@ $^ @@ -63,7 +63,7 @@ $(BIN).r2: $(R2OBJ) $(NXFLATLD) $(NXFLATLDFLAGS2) -o $@ $(R1OBJS) $(R2OBJ) $(BIN): $(BIN).r2 - touch $(BIN) # For now + $(LDNXFLAT) $(LDNXFLATFLAGS) -o $@ $^ clean: rm -f $(BIN) $(R2SRC) *.o *.r1 *.r2 *~ .*.swp core diff --git a/nuttx/include/signal.h b/nuttx/include/signal.h index cd548f71a..96f90be12 100644 --- a/nuttx/include/signal.h +++ b/nuttx/include/signal.h @@ -67,8 +67,12 @@ #define SIGRTMIN 0 /* First real time signal */ #define SIGRTMAX 31 /* Last real time signal */ -/* A few of the real time signals are used within the OS: */ +/* A few of the real time signals are used within the OS. The reset are all + * user signals: + */ +#define SIGUSR1 0 /* User signal 1 */ +#define SIGUSR2 1 /* User signal 2 */ #define SIGALRM 2 /* Default signal used with POSIX timers (used only */ /* no other signal is provided) */ #define SIGCONDTIMEDOUT 3 /* Used in the implementation of */ @@ -104,6 +108,7 @@ /* Special values of sigaction (all treated like NULL) */ +#define SIG_ERR ((CODE void*)-1) #define SIG_DFL ((CODE void*)0) #define SIG_IGN ((CODE void*)0) @@ -158,6 +163,7 @@ struct sigaction sigset_t sa_mask; int sa_flags; }; + #define sa_handler sa_u._sa_handler #define sa_sigaction sa_u._sa_sigaction |