Skip to content
Snippets Groups Projects
Commit cf87e647 authored by Ludwig Knüpfer's avatar Ludwig Knüpfer
Browse files

make native includes RIOT posix compatible

parent de3b85ff
No related branches found
No related tags found
No related merge requests found
...@@ -11,6 +11,8 @@ DEP = $(SRC:%.c=$(BINDIR)%.d) ...@@ -11,6 +11,8 @@ DEP = $(SRC:%.c=$(BINDIR)%.d)
INCLUDES += -I$(RIOTBOARD)/native/include/ INCLUDES += -I$(RIOTBOARD)/native/include/
EXCLUDES := -I$(RIOTBASE)/sys/posix/%
$(BINDIR)native_drivers.a: $(OBJ) $(BINDIR)native_drivers.a: $(OBJ)
@$(AR) rcs $(BINDIR)${ARCH} $(OBJ) @$(AR) rcs $(BINDIR)${ARCH} $(OBJ)
...@@ -19,7 +21,7 @@ $(BINDIR)native_drivers.a: $(OBJ) ...@@ -19,7 +21,7 @@ $(BINDIR)native_drivers.a: $(OBJ)
# compile and generate dependency info # compile and generate dependency info
$(BINDIR)%.o: %.c $(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 @$(CC) $(CFLAGS) $(INCLUDES) $(BOARDINCLUDE) $(PROJECTINCLUDE) $(CPUINCLUDE) -MM $*.c > $(BINDIR)$*.d
@printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d @printf "$(BINDIR)" | cat - $(BINDIR)$*.d > /tmp/riot_out && mv /tmp/riot_out $(BINDIR)$*.d
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
*/ */
#ifndef CPUCONF_H_ #ifndef CPUCONF_H_
#define CPUCONF_H_ #define CPUCONF_H_
#include <signal.h>
/* TODO: tighten stack sizes */ /* TODO: tighten stack sizes */
#ifdef __MACH__ /* OSX */ #ifdef __MACH__ /* OSX */
......
...@@ -22,50 +22,14 @@ ...@@ -22,50 +22,14 @@
#ifndef _CPU_H #ifndef _CPU_H
#define _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" #include "cpu-conf.h"
/* TODO: choose better value? */ /* TODO: choose better value? */
#define F_CPU 1000000 #define F_CPU 1000000
/* TODO: remove once these have been removed from RIOT: */
void dINT(void); void dINT(void);
void eINT(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 #endif //_CPU_H
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#ifndef _NATIVE_INTERNAL_H #ifndef _NATIVE_INTERNAL_H
#define _NATIVE_INTERNAL_H #define _NATIVE_INTERNAL_H
//#include <signal.h> #include <signal.h>
/** /**
* internal functions * internal functions
...@@ -56,5 +56,44 @@ extern const char *_progname; ...@@ -56,5 +56,44 @@ extern const char *_progname;
extern fd_set _native_rfds; extern fd_set _native_rfds;
#endif #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 */ #endif /* _NATIVE_INTERNAL_H */
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#define ENABLE_DEBUG (0) #define ENABLE_DEBUG (0)
#include "debug.h" #include "debug.h"
#include "transceiver.h" #include "transceiver.h"
#include "msg.h"
#include "tap.h" #include "tap.h"
#include "nativenet.h" #include "nativenet.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment