diff --git a/boards/native/drivers/Makefile b/boards/native/drivers/Makefile index f0516a8530a66865184b917e8a329f72c41b921b..6e2c0a70b38ded97dfc4af8a8b74877d85c6485d 100644 --- a/boards/native/drivers/Makefile +++ b/boards/native/drivers/Makefile @@ -11,6 +11,8 @@ DEP = $(SRC:%.c=$(BINDIR)%.d) INCLUDES += -I$(RIOTBOARD)/native/include/ +EXCLUDES := -I$(RIOTBASE)/sys/posix/% + $(BINDIR)native_drivers.a: $(OBJ) @$(AR) rcs $(BINDIR)${ARCH} $(OBJ) @@ -19,7 +21,7 @@ $(BINDIR)native_drivers.a: $(OBJ) # compile and generate dependency info $(BINDIR)%.o: %.c - $(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o + $(CC) $(CFLAGS) $(filter-out $(EXCLUDES),$(INCLUDES)) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -c $*.c -o $(BINDIR)$*.o @$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d diff --git a/cpu/native/include/cpu-conf.h b/cpu/native/include/cpu-conf.h index 4ddd47a91ab6535a9430edb5480b0be65f3c2460..edec5b5770768db0b926ac516d1e89443c36d8e8 100644 --- a/cpu/native/include/cpu-conf.h +++ b/cpu/native/include/cpu-conf.h @@ -15,7 +15,6 @@ */ #ifndef CPUCONF_H_ #define CPUCONF_H_ -#include <signal.h> /* TODO: tighten stack sizes */ #ifdef __MACH__ /* OSX */ diff --git a/cpu/native/include/cpu.h b/cpu/native/include/cpu.h index 80e91d1e77e01d8b2cf2ed545b127b423fe37e6f..160a12eb2a94f34f83e6acb62e8b6a0b61015cfa 100644 --- a/cpu/native/include/cpu.h +++ b/cpu/native/include/cpu.h @@ -22,50 +22,14 @@ #ifndef _CPU_H #define _CPU_H -#include <sys/param.h> - -/* enable signal handler register access on different platforms - * check here for more: - * http://sourceforge.net/p/predef/wiki/OperatingSystems/ - */ -#ifdef BSD // BSD = (FreeBSD, Darwin, ...) -#ifndef _XOPEN_SOURCE -#define _XOPEN_SOURCE -#include <ucontext.h> -#undef _XOPEN_SOURCE -#else -#include <ucontext.h> -#endif -#elif defined(__linux__) -#ifndef _GNU_SOURCE -#define GNU_SOURCE -#include <ucontext.h> -#undef GNU_SOURCE -#else -#include <ucontext.h> -#endif -#endif // BSD/Linux - -#include "kernel_internal.h" -#include "sched.h" - #include "cpu-conf.h" /* TODO: choose better value? */ #define F_CPU 1000000 +/* TODO: remove once these have been removed from RIOT: */ void dINT(void); void eINT(void); -/** - * register interrupt handler handler for interrupt sig - */ -int register_interrupt(int sig, void (*handler)(void)); - -/** - * unregister interrupt handler for interrupt sig - */ -int unregister_interrupt(int sig); - /** @} */ #endif //_CPU_H diff --git a/cpu/native/include/native_internal.h b/cpu/native/include/native_internal.h index e7cf8c84eb581dfd7529ba0662278525c368252f..5ddc85f4db0bf94bd0a3aec4fe1c830ea2f17965 100644 --- a/cpu/native/include/native_internal.h +++ b/cpu/native/include/native_internal.h @@ -12,7 +12,7 @@ #ifndef _NATIVE_INTERNAL_H #define _NATIVE_INTERNAL_H -//#include <signal.h> +#include <signal.h> /** * internal functions @@ -56,5 +56,44 @@ extern const char *_progname; extern fd_set _native_rfds; #endif + +/** + * register interrupt handler handler for interrupt sig + */ +int register_interrupt(int sig, void (*handler)(void)); + +/** + * unregister interrupt handler for interrupt sig + */ +int unregister_interrupt(int sig); + +//#include <sys/param.h> + +/* enable signal handler register access on different platforms + * check here for more: + * http://sourceforge.net/p/predef/wiki/OperatingSystems/ + */ +#ifdef BSD // BSD = (FreeBSD, Darwin, ...) +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE +#include <ucontext.h> +#undef _XOPEN_SOURCE +#else +#include <ucontext.h> +#endif +#elif defined(__linux__) +#ifndef _GNU_SOURCE +#define GNU_SOURCE +#include <ucontext.h> +#undef GNU_SOURCE +#else +#include <ucontext.h> +#endif +#endif // BSD/Linux + +#include "kernel_internal.h" +#include "sched.h" + + /** @} */ #endif /* _NATIVE_INTERNAL_H */ diff --git a/cpu/native/net/interface.c b/cpu/native/net/interface.c index 70e8475bbc83e501105d428efa5d946776b4b364..a0fedc884535612c6374e20e3849452507a5d402 100644 --- a/cpu/native/net/interface.c +++ b/cpu/native/net/interface.c @@ -27,6 +27,7 @@ #define ENABLE_DEBUG (0) #include "debug.h" #include "transceiver.h" +#include "msg.h" #include "tap.h" #include "nativenet.h"