Finish nxflat test Makefiles
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1913 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
6b4b78dfd4
commit
680b476d38
12 changed files with 35 additions and 40 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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):
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue