diff --git a/cpu/msp430/mtarch.h b/cpu/msp430/mtarch.h index 68913d866..313c55861 100644 --- a/cpu/msp430/mtarch.h +++ b/cpu/msp430/mtarch.h @@ -27,13 +27,15 @@ * SUCH DAMAGE. * * This file is part of the Contiki operating system. - * - * @(#)$Id: mtarch.h,v 1.3 2008/11/21 10:28:32 fros4943 Exp $ */ #ifndef __MTARCH_H__ #define __MTARCH_H__ +#include "contiki.h" + +#ifndef MTARCH_STACKSIZE #define MTARCH_STACKSIZE 128 +#endif /* MTARCH_STACKSIZE */ struct mtarch_thread { unsigned short stack[MTARCH_STACKSIZE]; @@ -46,6 +48,4 @@ struct mt_thread; int mtarch_stack_usage(struct mt_thread *t); - #endif /* __MTARCH_H__ */ - diff --git a/cpu/native/mtarch.c b/cpu/native/mtarch.c index e9df427d0..a774e3ba5 100644 --- a/cpu/native/mtarch.c +++ b/cpu/native/mtarch.c @@ -33,6 +33,12 @@ * $Id: mtarch.c,v 1.2 2007/04/03 18:37:15 oliverschmidt Exp $ */ +#include "sys/mt.h" + +#ifndef MTARCH_STACKSIZE +#define MTARCH_STACKSIZE 4096 +#endif /* MTARCH_STACKSIZE */ + #if defined(_WIN32) || defined(__CYGWIN__) #define WIN32_LEAN_AND_MEAN @@ -52,7 +58,7 @@ static void *main_fiber; #include struct mtarch_t { - char stack[4096]; + char stack[MTARCH_STACKSIZE]; ucontext_t context; }; @@ -61,8 +67,6 @@ static ucontext_t *running_context; #endif /* _WIN32 || __CYGWIN__ || __linux */ -#include "mtarch.h" - /*--------------------------------------------------------------------------*/ void mtarch_init(void) diff --git a/examples/multi-threading/multi-threading.c b/examples/multi-threading/multi-threading.c index d52ec75bc..d8439f5bc 100644 --- a/examples/multi-threading/multi-threading.c +++ b/examples/multi-threading/multi-threading.c @@ -48,6 +48,7 @@ #include "contiki.h" #include "sys/mt.h" +#include static char *ptr;