diff --git a/boards/iot-lab_M3/auto_init_ng_netif/netif_board.c b/boards/iot-lab_M3/auto_init_ng_netif/netif_board.c
new file mode 100644
index 0000000000000000000000000000000000000000..79bdb3a5dd18a6e61ed46201c8021550457ca00f
--- /dev/null
+++ b/boards/iot-lab_M3/auto_init_ng_netif/netif_board.c
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2015 Freie Universität Berlin
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @ingroup     boards_iot-lab_M3
+ * @{
+ *
+ * @file
+ * @brief       Network device initialization code
+ *
+ * @author      Hauke Petersen <hauke.petersen@fu-berlin.de>
+ *
+ * @}
+ */
+
+#include <stdio.h>
+
+#include "board.h"
+#include "auto_init.h"
+#include "ng_at86rf2xx.h"
+#include "net/ng_nomac.h"
+#include "net/ng_netbase.h"
+
+#define ENABLE_DEBUG (0)
+#include "debug.h"
+
+/**
+ * @brief   Define stack parameters for the MAC layer thread
+ * @{
+ */
+#define MAC_STACKSIZE           (THREAD_STACKSIZE_DEFAULT)
+#define MAC_PRIO                (THREAD_PRIORITY_MAIN - 3)
+/** @} */
+
+/**
+ * @brief   Device descriptor for the Atmel radio
+ */
+static ng_at86rf2xx_t radio;
+
+/**
+ * @brief   Stack for the MAC layer thread
+ */
+static char nomac_stack[MAC_STACKSIZE];
+
+
+void auto_init_ng_netif(void)
+{
+    /* initialize the radio */
+    DEBUG("Initializing AT86RF231 radio\n");
+    ng_at86rf2xx_init(&radio, AT86RF231_SPI, AT86RF231_SPI_CLK,
+                      AT86RF231_CS, AT86RF231_INT,
+                      AT86RF231_SLEEP, AT86RF231_RESET);
+    /* starting NOMAC */
+    DEBUG("Starting the MAC layer\n");
+    ng_nomac_init(nomac_stack, sizeof(nomac_stack), MAC_PRIO, "at86rf233",
+                  (ng_netdev_t *)(&radio));
+    DEBUG("Auto init of on-board radio complete\n");
+}
diff --git a/boards/qemu-i386/include/cpu-conf.h b/boards/qemu-i386/include/cpu-conf.h
index 295733099ad88ddf66824d6ebcd06d187caae754..a273115f1189e1483ebda950925b63b376b08896 100644
--- a/boards/qemu-i386/include/cpu-conf.h
+++ b/boards/qemu-i386/include/cpu-conf.h
@@ -25,12 +25,11 @@ extern "C" {
 
 /* FIXME: This file is just a filler. The numbers are entirely random ... */
 
-#define KERNEL_CONF_STACKSIZE_DEFAULT      (8192)
-#define KERNEL_CONF_STACKSIZE_IDLE         (8192)
-#define KERNEL_CONF_STACKSIZE_PRINTF       (8192)
-#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (8192)
-
-#define MINIMUM_STACK_SIZE                 (8192)
+#define THREAD_STACKSIZE_DEFAULT                 (8192)
+#define THREAD_STACKSIZE_IDLE                    (8192)
+#define THREAD_EXTRA_STACKSIZE_PRINTF            (8192)
+#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT      (8192)
+#define THREAD_STACKSIZE_MINIMUM                 (8192)
 
 #define UART0_BUFSIZE                      (16)
 
diff --git a/boards/samr21-xpro/auto_init_ng_netif/netif_board.c b/boards/samr21-xpro/auto_init_ng_netif/netif_board.c
index 4bcb41e7fb54e326898748e5a43a75577f450591..01555cb5173c4bc9512d85d0fa5dbaf443c0bff5 100644
--- a/boards/samr21-xpro/auto_init_ng_netif/netif_board.c
+++ b/boards/samr21-xpro/auto_init_ng_netif/netif_board.c
@@ -33,8 +33,8 @@
  * @brief   Define stack parameters for the MAC layer thread
  * @{
  */
-#define MAC_STACKSIZE           (KERNEL_CONF_STACKSIZE_DEFAULT)
-#define MAC_PRIO                (PRIORITY_MAIN - 3)
+#define MAC_STACKSIZE           (THREAD_STACKSIZE_DEFAULT)
+#define MAC_PRIO                (THREAD_PRIORITY_MAIN - 3)
 /** @} */
 
 /**
diff --git a/core/include/debug.h b/core/include/debug.h
index b6613b361c156aac7838b91e5986437074c09bc9..9dec9e2d513a5529303e2e97d48fe90b52baa063 100644
--- a/core/include/debug.h
+++ b/core/include/debug.h
@@ -57,7 +57,7 @@ extern "C" {
 #include "cpu-conf.h"
 #define DEBUG_PRINT(...) \
     do { \
-        if ((sched_active_thread == NULL) || (sched_active_thread->stack_size > KERNEL_CONF_STACKSIZE_PRINTF)) { \
+        if ((sched_active_thread == NULL) || (sched_active_thread->stack_size > THREAD_EXTRA_STACKSIZE_PRINTF)) { \
             printf(__VA_ARGS__); \
         } \
         else { \
diff --git a/core/include/kernel.h b/core/include/kernel.h
index fab35c4bbf52151b2c9ceb9e1a4a623fae393cf5..45842c0117df3863e572d49656dd1f79e711db4c 100644
--- a/core/include/kernel.h
+++ b/core/include/kernel.h
@@ -37,57 +37,7 @@
  extern "C" {
 #endif
 
-/**
- * @def KERNEL_CONF_STACKSIZE_DEFAULT
- * @brief A reasonable default stack size that will suffice most smaller tasks
- */
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#error KERNEL_CONF_STACKSIZE_DEFAULT must be defined per CPU
-#endif
-
-/**
- * @def KERNEL_CONF_STACKSIZE_IDLE
- * @brief Size of the idle task's stack in bytes
- */
-#ifndef KERNEL_CONF_STACKSIZE_IDLE
-#error KERNEL_CONF_STACKSIZE_IDLE must be defined per CPU
-#endif
-
-/**
- * @def KERNEL_CONF_STACKSIZE_PRINTF
- * @ingroup conf
- * @brief Size of the task's printf stack in bytes
- */
-#ifndef KERNEL_CONF_STACKSIZE_PRINTF
-#error KERNEL_CONF_STACKSIZE_PRINTF must be defined per CPU
-#endif
-
-/**
- * @def KERNEL_CONF_STACKSIZE_MAIN
- * @brief Size of the main task's stack in bytes
- */
-#ifndef KERNEL_CONF_STACKSIZE_MAIN
-#define KERNEL_CONF_STACKSIZE_MAIN      (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
-#endif
-
 /* ------------------------------------------------------------------------- */
-/**
- * @def PRIORITY_MIN
- * @brief Least priority a thread can have
- */
-#define PRIORITY_MIN            (SCHED_PRIO_LEVELS-1)
-
-/**
- * @def PRIORITY_IDLE
- * @brief Priority of the idle thread
- */
-#define PRIORITY_IDLE           PRIORITY_MIN
-
-/**
- * @def PRIORITY_MAIN
- * @brief Priority of the main thread
- */
-#define PRIORITY_MAIN           (PRIORITY_MIN - (SCHED_PRIO_LEVELS/2))
 
 /**
  * @def LPM_PREVENT_SLEEP_UART
diff --git a/core/include/thread.h b/core/include/thread.h
index aa7f8724b2d8342db493a6e90a0a26ef60f6ec15..c3bcbf337fea7071dc89dc34ca07e21491f811b2 100644
--- a/core/include/thread.h
+++ b/core/include/thread.h
@@ -35,13 +35,64 @@
  */
 #define STATUS_NOT_FOUND (-1)
 
+ /**
+ * @def THREAD_STACKSIZE_DEFAULT
+ * @brief A reasonable default stack size that will suffice most smaller tasks
+ */
+#ifndef THREAD_STACKSIZE_DEFAULT
+#error THREAD_STACKSIZE_DEFAULT must be defined per CPU
+#endif
+
+/**
+ * @def THREAD_STACKSIZE_IDLE
+ * @brief Size of the idle task's stack in bytes
+ */
+#ifndef THREAD_STACKSIZE_IDLE
+#error THREAD_STACKSIZE_IDLE must be defined per CPU
+#endif
+
+/**
+ * @def THREAD_EXTRA_STACKSIZE_PRINTF
+ * @ingroup conf
+ * @brief Size of the task's printf stack in bytes
+ */
+#ifndef THREAD_EXTRA_STACKSIZE_PRINTF
+#error THREAD_EXTRA_STACKSIZE_PRINTF must be defined per CPU
+#endif
+
+/**
+ * @def THREAD_STACKSIZE_MAIN
+ * @brief Size of the main task's stack in bytes
+ */
+#ifndef THREAD_STACKSIZE_MAIN
+#define THREAD_STACKSIZE_MAIN      (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
+#endif
+
 /**
  * @brief Minimum stack size
  */
-#ifndef MINIMUM_STACK_SIZE
-#define MINIMUM_STACK_SIZE  (sizeof(tcb_t))
+#ifndef THREAD_STACKSIZE_MINIMUM
+#define THREAD_STACKSIZE_MINIMUM  (sizeof(tcb_t))
 #endif
 
+/**
+ * @def THREAD_PRIORITY_MIN
+ * @brief Least priority a thread can have
+ */
+#define THREAD_PRIORITY_MIN            (SCHED_PRIO_LEVELS-1)
+
+/**
+ * @def THREAD_PRIORITY_IDLE
+ * @brief Priority of the idle thread
+ */
+#define THREAD_PRIORITY_IDLE           (THREAD_PRIORITY_MIN)
+
+/**
+ * @def THREAD_PRIORITY_MAIN
+ * @brief Priority of the main thread
+ */
+#define THREAD_PRIORITY_MAIN           (THREAD_PRIORITY_MIN - (SCHED_PRIO_LEVELS/2))
+
 /**
  * @brief Creates a new thread
  *
@@ -56,7 +107,7 @@
  * A low value for *priority* number means the thread having a high priority
  * with 0 being the highest possible priority.
  *
- * The lowest possible priority is *PRIORITY_IDLE - 1*. The value is depending
+ * The lowest possible priority is *THREAD_PRIORITY_IDLE - 1*. The value is depending
  * on the platforms architecture, e.g. 30 in 32-bit systems, 14 in 16-bit systems.
  *
  *
diff --git a/core/kernel_init.c b/core/kernel_init.c
index 678f9759e8b4016306ae38a1cb6a43de4e90b6eb..b18bdb0027cca946b6f61510ba325387674e5fd8 100644
--- a/core/kernel_init.c
+++ b/core/kernel_init.c
@@ -76,8 +76,8 @@ static void *idle_thread(void *arg)
 const char *main_name = "main";
 const char *idle_name = "idle";
 
-static char main_stack[KERNEL_CONF_STACKSIZE_MAIN];
-static char idle_stack[KERNEL_CONF_STACKSIZE_IDLE];
+static char main_stack[THREAD_STACKSIZE_MAIN];
+static char idle_stack[THREAD_STACKSIZE_IDLE];
 
 void kernel_init(void)
 {
@@ -86,12 +86,12 @@ void kernel_init(void)
 
     hwtimer_init();
 
-    if (thread_create(idle_stack, sizeof(idle_stack), PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_thread, NULL, idle_name) < 0) {
-        LOG_ERROR("kernel_init(): error creating idle task.\n");
+    if (thread_create(idle_stack, sizeof(idle_stack), THREAD_PRIORITY_IDLE, CREATE_WOUT_YIELD | CREATE_STACKTEST, idle_thread, NULL, idle_name) < 0) {
+        printf("kernel_init(): error creating idle task.\n");
     }
 
-    if (thread_create(main_stack, sizeof(main_stack), PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST, main_trampoline, NULL, main_name) < 0) {
-        LOG_ERROR("kernel_init(): error creating main task.\n");
+    if (thread_create(main_stack, sizeof(main_stack), THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST, main_trampoline, NULL, main_name) < 0) {
+        printf("kernel_init(): error creating main task.\n");
     }
 
     LOG_INFO("kernel_init(): jumping into first task...\n");
diff --git a/core/msg.c b/core/msg.c
index 85cf33e657b3e148ff1f3b4a8ad25fbc9cd33c18..850fad03b8f253e3ed25b2f504d3b13dedf01a8f 100644
--- a/core/msg.c
+++ b/core/msg.c
@@ -351,7 +351,7 @@ static int _msg_receive(msg_t *m, int block)
         *m = *sender_msg;
 
         /* remove sender from queue */
-        uint16_t sender_prio = PRIORITY_IDLE;
+        uint16_t sender_prio = THREAD_PRIORITY_IDLE;
         if (sender->status != STATUS_REPLY_BLOCKED) {
             sender->wait_data = NULL;
             sched_set_status(sender, STATUS_PENDING);
@@ -359,7 +359,7 @@ static int _msg_receive(msg_t *m, int block)
         }
 
         restoreIRQ(state);
-        if (sender_prio < PRIORITY_IDLE) {
+        if (sender_prio < THREAD_PRIORITY_IDLE) {
             sched_switch(sender_prio);
         }
         return 1;
diff --git a/cpu/atmega2560/include/cpu-conf.h b/cpu/atmega2560/include/cpu-conf.h
index 4e92af4c7ab432fd72b3ed1ee3b01d4774a6159e..78c7141ae0c6d969aab59cfcf1223368a16bb1da 100644
--- a/cpu/atmega2560/include/cpu-conf.h
+++ b/cpu/atmega2560/include/cpu-conf.h
@@ -31,13 +31,13 @@ extern "C" {
  * size tested sucessfully even with pretty small stacks.k
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (128)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (128)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (256)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (256)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (128)
+#define THREAD_STACKSIZE_IDLE      (128)
 /** @} */
 
 /**
diff --git a/cpu/cc2538/include/cpu-conf.h b/cpu/cc2538/include/cpu-conf.h
index 13edbfdd57d663bf30cd9d069e661e3a672f17e6..b02353d7fb2ef9a9ac22491fba4c8e7a9fb464c6 100644
--- a/cpu/cc2538/include/cpu-conf.h
+++ b/cpu/cc2538/include/cpu-conf.h
@@ -36,13 +36,13 @@ extern "C" {
  * @name Kernel configuration
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    1024
+#define THREAD_EXTRA_STACKSIZE_PRINTF    1024
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   1024
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   1024
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      512
+#define THREAD_STACKSIZE_IDLE      512
 /** @} */
 
 /**
diff --git a/cpu/k60/include/cpu-conf.h b/cpu/k60/include/cpu-conf.h
index 68b33647d536da3de161df106ca20aa948044071..182ab9715e136628a23e57d669b93b69f32bfd52 100644
--- a/cpu/k60/include/cpu-conf.h
+++ b/cpu/k60/include/cpu-conf.h
@@ -82,13 +82,13 @@ extern "C"
  * TODO: Tune this
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (1024)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (1024)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/kw2x/include/cpu-conf.h b/cpu/kw2x/include/cpu-conf.h
index 2d5d5b4dcd63eaeba6e5a85d2163389849f80430..4fa2df79abd49aa16c41c0976e94b191dd6c2fbe 100644
--- a/cpu/kw2x/include/cpu-conf.h
+++ b/cpu/kw2x/include/cpu-conf.h
@@ -47,13 +47,13 @@ extern "C"
  *
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF     (1024)
+#define THREAD_EXTRA_STACKSIZE_PRINTF     (1024)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT    (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT    (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE       (256)
+#define THREAD_STACKSIZE_IDLE       (256)
 /** @} */
 
 /**
diff --git a/cpu/lpc1768/include/cpu-conf.h b/cpu/lpc1768/include/cpu-conf.h
index 23d65c1eae8de9d2bc38ff7e231af165794b9e3b..6d71a8f809dd547be0526259f4c6eeb05a299398 100644
--- a/cpu/lpc1768/include/cpu-conf.h
+++ b/cpu/lpc1768/include/cpu-conf.h
@@ -36,13 +36,13 @@ extern "C" {
  * TODO: measure and adjust for the Cortex-M3
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (1024)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (1024)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/lpc2387/include/cpu-conf.h b/cpu/lpc2387/include/cpu-conf.h
index 16745eb7439724cf171cd536eaceae58cf443cfd..29129fcbfe0092ef5e9aeab11cc2d2217ddad055 100644
--- a/cpu/lpc2387/include/cpu-conf.h
+++ b/cpu/lpc2387/include/cpu-conf.h
@@ -43,14 +43,14 @@ extern "C" {
  * @name Kernel configuration
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT  (4096)
-#define KERNEL_CONF_STACKSIZE_PRINTF        (2048)
+#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT  (4096)
+#define THREAD_EXTRA_STACKSIZE_PRINTF        (2048)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (512)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (512)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (160)
+#define THREAD_STACKSIZE_IDLE      (160)
 /** @} */
 
 /**
diff --git a/cpu/mc1322x/include/cpu-conf.h b/cpu/mc1322x/include/cpu-conf.h
index 28c966f1b5a3cb3d023ef2d9a0118304506c7134..2cfe4d1e4c46fef10f6bf97f3c014c23114260b9 100644
--- a/cpu/mc1322x/include/cpu-conf.h
+++ b/cpu/mc1322x/include/cpu-conf.h
@@ -40,14 +40,14 @@ extern "C" {
  * @name Kernel configuration
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT  (4096)
-#define KERNEL_CONF_STACKSIZE_PRINTF        (2048)
+#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT  (4096)
+#define THREAD_EXTRA_STACKSIZE_PRINTF        (2048)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (512)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (512)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE  (160)
+#define THREAD_STACKSIZE_IDLE  (160)
 /** @} */
 
 /**
diff --git a/cpu/msp430-common/include/cpu-conf.h b/cpu/msp430-common/include/cpu-conf.h
index cb3fa35ceee694766c3b5bda1eb69309c7159808..9ddff3d20cd05d57d4d94529d31977d0bd752c97 100644
--- a/cpu/msp430-common/include/cpu-conf.h
+++ b/cpu/msp430-common/include/cpu-conf.h
@@ -17,14 +17,14 @@ extern "C" {
  * @name Kernel configuration
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (256)
-#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT (KERNEL_CONF_STACKSIZE_PRINTF)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (256)
+#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT (THREAD_EXTRA_STACKSIZE_PRINTF)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (256)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (256)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (96)
+#define THREAD_STACKSIZE_IDLE      (96)
 #define MSP430_ISR_STACK_SIZE           (256)
 
 #define RX_BUF_SIZE (3)
diff --git a/cpu/native/include/cpu-conf.h b/cpu/native/include/cpu-conf.h
index 3cf26d05e66c72c83d9d6eca47ca3ba952a6c5e5..ffa9e7207444df7411631759e04b6b2fc74ea5d5 100644
--- a/cpu/native/include/cpu-conf.h
+++ b/cpu/native/include/cpu-conf.h
@@ -22,28 +22,28 @@ extern "C" {
 
 /* TODO: tighten stack sizes */
 #ifdef __MACH__ /* OSX */
-#define KERNEL_CONF_STACKSIZE_DEFAULT       (163840)
-#define KERNEL_CONF_STACKSIZE_IDLE          (163840)
-#define KERNEL_CONF_STACKSIZE_PRINTF        (163840)
-#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT  (163840)
+#define THREAD_STACKSIZE_DEFAULT       (163840)
+#define THREAD_STACKSIZE_IDLE          (163840)
+#define THREAD_EXTRA_STACKSIZE_PRINTF        (163840)
+#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT  (163840)
 /* for core/include/thread.h */
-#define MINIMUM_STACK_SIZE              (163840)
+#define THREAD_STACKSIZE_MINIMUM              (163840)
 /* undefine the TRANSCEIVER_STACK_SIZE (2048 or 512) defined in transceiver.h */
 #ifdef TRANSCEIVER_STACK_SIZE
 #undef TRANSCEIVER_STACK_SIZE
 #endif
 #define TRANSCEIVER_STACK_SIZE          (163840)
 /* native internal */
-#define MINIMUM_STACK_SIZE              (163840)
+#define THREAD_STACKSIZE_MINIMUM              (163840)
 #define NATIVE_ISR_STACKSIZE            (163840)
 
 #else /* Linux etc. */
-#define KERNEL_CONF_STACKSIZE_DEFAULT       (8192)
-#define KERNEL_CONF_STACKSIZE_IDLE          (8192)
-#define KERNEL_CONF_STACKSIZE_PRINTF        (8192)
-#define KERNEL_CONF_STACKSIZE_PRINTF_FLOAT  (8192)
+#define THREAD_STACKSIZE_DEFAULT       (8192)
+#define THREAD_STACKSIZE_IDLE          (8192)
+#define THREAD_EXTRA_STACKSIZE_PRINTF        (8192)
+#define THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT  (8192)
 /* for core/include/thread.h */
-#define MINIMUM_STACK_SIZE              (8192)
+#define THREAD_STACKSIZE_MINIMUM              (8192)
 /* undefine the TRANSCEIVER_STACK_SIZE (2048 or 512) defined in transceiver.h */
 #ifdef TRANSCEIVER_STACK_SIZE
 #undef TRANSCEIVER_STACK_SIZE
diff --git a/cpu/nrf51822/include/cpu-conf.h b/cpu/nrf51822/include/cpu-conf.h
index 21654f91c56fb8ba588f2e53e76c3fcb49367df7..b0481980961309105dcfc121ee2c8275cc1335a2 100644
--- a/cpu/nrf51822/include/cpu-conf.h
+++ b/cpu/nrf51822/include/cpu-conf.h
@@ -30,13 +30,13 @@ extern "C" {
  * @name Kernel configuration
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (512)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (512)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/sam3x8e/include/cpu-conf.h b/cpu/sam3x8e/include/cpu-conf.h
index bf5d646d7fec21dd9754531ae35ca9e19f0f62bb..ccd8f7edd6163ad7090c7b435abddd35dfb032d7 100644
--- a/cpu/sam3x8e/include/cpu-conf.h
+++ b/cpu/sam3x8e/include/cpu-conf.h
@@ -30,13 +30,13 @@ extern "C" {
  * TODO: measure and adjust for the cortex-m3
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (2500)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (2500)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (2500)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (2500)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (512)
+#define THREAD_STACKSIZE_IDLE      (512)
 /** @} */
 
 /**
diff --git a/cpu/samd21/include/cpu-conf.h b/cpu/samd21/include/cpu-conf.h
index f78e6e6c358741e656b8b25855414b91774dc4df..ea02b51a79da7bb90a0d90c1724e71dc85a4b882 100644
--- a/cpu/samd21/include/cpu-conf.h
+++ b/cpu/samd21/include/cpu-conf.h
@@ -30,13 +30,13 @@ extern "C" {
  * TODO: measure and adjust for the cortex-m0
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (512)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (512)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/stm32f0/include/cpu-conf.h b/cpu/stm32f0/include/cpu-conf.h
index 9083771dd450ec1dc2bff45956cd7e401a98322b..05ff0c7935988b757427354b12d1ceb3c2a01a16 100644
--- a/cpu/stm32f0/include/cpu-conf.h
+++ b/cpu/stm32f0/include/cpu-conf.h
@@ -41,13 +41,13 @@ extern "C" {
  * TODO: measure and adjust for the Cortex-M0
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (512)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (512)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (512)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (512)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (192)
+#define THREAD_STACKSIZE_IDLE      (192)
 /** @} */
 
 /**
diff --git a/cpu/stm32f1/include/cpu-conf.h b/cpu/stm32f1/include/cpu-conf.h
index 6cbf818b0ca23fb1a293b6c9501ff4cdcd7c3ccb..c28dc74311ab32eb0aca69282d70d7a7e8aaec7e 100644
--- a/cpu/stm32f1/include/cpu-conf.h
+++ b/cpu/stm32f1/include/cpu-conf.h
@@ -35,13 +35,13 @@ extern "C" {
  * TODO: measure and adjust for the cortex-m3
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (1024)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (1024)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/stm32f3/include/cpu-conf.h b/cpu/stm32f3/include/cpu-conf.h
index 1b22573140b8d3a3a3d0a8088e7d0986df21b60c..f469fb4572d21a74e5595ecc8e8357ae189caaaf 100644
--- a/cpu/stm32f3/include/cpu-conf.h
+++ b/cpu/stm32f3/include/cpu-conf.h
@@ -34,13 +34,13 @@
  * TODO: measure and adjust for the Cortex-M4f
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (1024)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (1024)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/stm32f4/include/cpu-conf.h b/cpu/stm32f4/include/cpu-conf.h
index c77ccf14113da423fe52d0d4b9d099ec776f787c..ef4ba0b0a93b1bbdaa1e7a03e4b188bcae6bad8b 100644
--- a/cpu/stm32f4/include/cpu-conf.h
+++ b/cpu/stm32f4/include/cpu-conf.h
@@ -33,13 +33,13 @@
  * TODO: measure and adjust for the Cortex-M4f
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (2500)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (2500)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (2500)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (2500)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (512)
+#define THREAD_STACKSIZE_IDLE      (512)
 /** @} */
 
 /**
diff --git a/cpu/stm32l1/include/cpu-conf.h b/cpu/stm32l1/include/cpu-conf.h
index b9ec2c6766c84b32dcf988f8d62468ae410ffdf3..b6badbc600f8f967548d62e2a97b78c3c26d88d0 100644
--- a/cpu/stm32l1/include/cpu-conf.h
+++ b/cpu/stm32l1/include/cpu-conf.h
@@ -32,13 +32,13 @@ extern "C" {
  *
  * @{
  */
-#define KERNEL_CONF_STACKSIZE_PRINTF    (1024)
+#define THREAD_EXTRA_STACKSIZE_PRINTF    (1024)
 
-#ifndef KERNEL_CONF_STACKSIZE_DEFAULT
-#define KERNEL_CONF_STACKSIZE_DEFAULT   (1024)
+#ifndef THREAD_STACKSIZE_DEFAULT
+#define THREAD_STACKSIZE_DEFAULT   (1024)
 #endif
 
-#define KERNEL_CONF_STACKSIZE_IDLE      (256)
+#define THREAD_STACKSIZE_IDLE      (256)
 /** @} */
 
 /**
diff --git a/cpu/x86/x86_hwtimer.c b/cpu/x86/x86_hwtimer.c
index 9484e1a6267e9c487a4706dc07661c9e01a71a54..d077fe36597901d514d15b44db0d2bfa6dd1b7a0 100644
--- a/cpu/x86/x86_hwtimer.c
+++ b/cpu/x86/x86_hwtimer.c
@@ -166,7 +166,7 @@ void x86_init_hwtimer(void)
 
 static void (*hwtimer_callback)(int timer);
 
-static char hwtimer_stack[KERNEL_CONF_STACKSIZE_DEFAULT];
+static char hwtimer_stack[THREAD_STACKSIZE_DEFAULT];
 static kernel_pid_t hwtimer_pid = KERNEL_PID_UNDEF;
 
 struct alarm_time {
diff --git a/doc/doxygen/src/mainpage.txt b/doc/doxygen/src/mainpage.txt
index 9212b8de3d46fee131c6128b3985609573c39d8f..b57330f6b47a9f76c63c1ce842d136421b24062b 100644
--- a/doc/doxygen/src/mainpage.txt
+++ b/doc/doxygen/src/mainpage.txt
@@ -138,24 +138,24 @@
  * `cpu-conf.` (which should be provided by the implementation for all
  * supported MCUs). The constants for these stack sizes are
  *
- * * `KERNEL_CONF_STACKSIZE_IDLE`
- * * `KERNEL_CONF_STACKSIZE_DEFAULT`
- * * `KERNEL_CONF_STACKSIZE_PRINTF`
- * * `KERNEL_CONF_STACKSIZE_MAIN`
+ * * `THREAD_STACKSIZE_IDLE`
+ * * `THREAD_STACKSIZE_DEFAULT`
+ * * `THREAD_EXTRA_STACKSIZE_PRINTF`
+ * * `THREAD_STACKSIZE_MAIN`
  *
  * and can be used by including `kernel.h`. ARM based platforms additionally
- * define `KERNEL_CONF_STACKSIZE_PRINTF_FLOAT`, because newlibs printf
+ * define `THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT`, because newlibs printf
  * implementation uses more memory for printing floating point numbers.
  *
- * `KERNEL_CONF_STACKSIZE_IDLE` is the stack size for the idle thread and
- * probably the smallest sensible stack size. `KERNEL_CONF_STACKSIZE_DEFAULT`
+ * `THREAD_STACKSIZE_IDLE` is the stack size for the idle thread and
+ * probably the smallest sensible stack size. `THREAD_STACKSIZE_DEFAULT`
  * is a default size for any typical thread, _not_ using printf.
- * `KERNEL_CONF_STACKSIZE_PRINTF` defines additional stack space needed if the
+ * `THREAD_EXTRA_STACKSIZE_PRINTF` defines additional stack space needed if the
  * thread needs to call printf (which requires additional memory when using
- * newlib). `KERNEL_CONF_STACKSIZE_MAIN` is the stack size for the main thread
+ * newlib). `THREAD_STACKSIZE_MAIN` is the stack size for the main thread
  * and probably a good size for your application. (Note, that on most
  * non-newlib dependent platforms this will probably equal
- * `KERNEL_CONF_STACKSIZE_DEFAULT`.
+ * `THREAD_STACKSIZE_DEFAULT`.
  *
  * ####The IPC
  *
diff --git a/drivers/cc110x_legacy_csma/cc1100_phy.c b/drivers/cc110x_legacy_csma/cc1100_phy.c
index 639cb501630ce97da0942fcc2b31bcfd80e062ac..b3d3419d05c4761f7fd58fdee6bf05bea3b3a855 100644
--- a/drivers/cc110x_legacy_csma/cc1100_phy.c
+++ b/drivers/cc110x_legacy_csma/cc1100_phy.c
@@ -42,7 +42,7 @@
 #include "msg.h"
 #include "debug.h"
 
-#define PRIORITY_CC1100         PRIORITY_MAIN-1
+#define PRIORITY_CC1100         THREAD_PRIORITY_MAIN-1
 
 #define MSG_POLL 12346
 
@@ -83,7 +83,7 @@ static timex_t cc1100_watch_dog_period;
 static kernel_pid_t cc1100_event_handler_pid;
 static void *cc1100_event_handler_function(void *);
 
-static char event_handler_stack[KERNEL_CONF_STACKSIZE_MAIN];
+static char event_handler_stack[THREAD_STACKSIZE_MAIN];
 
 /*---------------------------------------------------------------------------*/
 /*              Sequence number buffer management data structures */
diff --git a/examples/ccn-lite-client/main.c b/examples/ccn-lite-client/main.c
index 77481acc9524581f54c402102493a0f4fcfb2659..862e2523c07ee255fcaefa549c1c2597b36e163d 100644
--- a/examples/ccn-lite-client/main.c
+++ b/examples/ccn-lite-client/main.c
@@ -44,10 +44,10 @@
 
 static const char DEFAULT_INTEREST[] = "/ccnx/0.7.1/doc/technical/CanonicalOrder.txt";
 
-char relay_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char relay_stack[THREAD_STACKSIZE_MAIN];
 
 #if RIOT_CCN_APPSERVER
-char appserver_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char appserver_stack[THREAD_STACKSIZE_MAIN];
 #endif
 static volatile kernel_pid_t _relay_pid = KERNEL_PID_UNDEF, _appserver_pid = KERNEL_PID_UNDEF;
 
@@ -72,7 +72,7 @@ static int riot_ccn_appserver(int argc, char **argv)
 
     _appserver_pid = thread_create(
             appserver_stack, sizeof(appserver_stack),
-            PRIORITY_MAIN - 1, CREATE_STACKTEST,
+            THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
             ccnl_riot_appserver_start, (void *) &_relay_pid, "appserver");
     DEBUG("ccn-lite appserver on thread_id %" PRIkernel_pid "...\n", _appserver_pid);
 
@@ -186,7 +186,7 @@ static int riot_ccn_relay_start(void)
 
     _relay_pid = thread_create(
             relay_stack, sizeof(relay_stack),
-            PRIORITY_MAIN - 2, CREATE_STACKTEST,
+            THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
             ccnl_riot_relay_start, NULL, "relay");
     DEBUG("ccn-lite relay on thread_id %" PRIkernel_pid "...\n", _relay_pid);
 
diff --git a/examples/ccn-lite-relay/main.c b/examples/ccn-lite-relay/main.c
index 6684116026d98e4a97f9d8bd94a74021f068e3d8..e7dc9b62d8e918222b3e947ea297960bc21e8cd6 100644
--- a/examples/ccn-lite-relay/main.c
+++ b/examples/ccn-lite-relay/main.c
@@ -33,7 +33,7 @@
 
 static kernel_pid_t _relay_pid = KERNEL_PID_UNDEF;
 
-char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char t2_stack[THREAD_STACKSIZE_MAIN];
 
 void set_address_handler(uint16_t a)
 {
@@ -75,7 +75,7 @@ int main(void)
 
     _relay_pid = thread_getpid();
 
-    thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN + 1,
+    thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN + 1,
                   CREATE_STACKTEST, second_thread, NULL, "helper thread");
 
     printf("starting ccn-lite relay...\n");
diff --git a/examples/default/main.c b/examples/default/main.c
index 0829513c4b2f6d0de3c873e117d69345667950c4..186df320edb08735b85eac49f3e21c9c07f547c2 100644
--- a/examples/default/main.c
+++ b/examples/default/main.c
@@ -49,7 +49,7 @@
 
 #define SND_BUFFER_SIZE     (100)
 #define RCV_BUFFER_SIZE     (64)
-#define RADIO_STACK_SIZE    (KERNEL_CONF_STACKSIZE_MAIN)
+#define RADIO_STACK_SIZE    (THREAD_STACKSIZE_MAIN)
 
 #ifdef MODULE_TRANSCEIVER
 
@@ -121,7 +121,7 @@ void init_transceiver(void)
     kernel_pid_t radio_pid = thread_create(
                         radio_stack_buffer,
                         sizeof(radio_stack_buffer),
-                        PRIORITY_MAIN - 2,
+                        THREAD_PRIORITY_MAIN - 2,
                         CREATE_STACKTEST,
                         radio,
                         NULL,
diff --git a/examples/ipc_pingpong/main.c b/examples/ipc_pingpong/main.c
index de2bec1972cc9f2980f392c960f431fcfe8bd811..f3fd69daf9abaa52d4c759225f6ea6ca2b32762b 100644
--- a/examples/ipc_pingpong/main.c
+++ b/examples/ipc_pingpong/main.c
@@ -41,7 +41,7 @@ void *second_thread(void *arg)
     return NULL;
 }
 
-char second_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char second_thread_stack[THREAD_STACKSIZE_MAIN];
 
 int main(void)
 {
@@ -51,7 +51,7 @@ int main(void)
     msg_t m;
 
     kernel_pid_t pid = thread_create(second_thread_stack, sizeof(second_thread_stack),
-                            PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                            THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                             second_thread, NULL, "pong");
 
     m.content.value = 1;
diff --git a/examples/riot_and_cpp/main.cpp b/examples/riot_and_cpp/main.cpp
index 4e03c8738e4b60e918685e9a36f9b266253d925e..0c7ba560429b98e531f461884bb01c1481877a46 100644
--- a/examples/riot_and_cpp/main.cpp
+++ b/examples/riot_and_cpp/main.cpp
@@ -37,7 +37,7 @@ extern "C" {
 using namespace std;
 
 /* thread's stack */
-char threadA_stack [KERNEL_CONF_STACKSIZE_MAIN];
+char threadA_stack [THREAD_STACKSIZE_MAIN];
 
 /* thread's function */
 void *threadA_func(void *arg);
diff --git a/examples/rpl_udp/rpl.c b/examples/rpl_udp/rpl.c
index 43d43649692afa789386154dd87bf2eca2d8a42c..0973238995ae1fb5f7510e77a410324977d2c96f 100644
--- a/examples/rpl_udp/rpl.c
+++ b/examples/rpl_udp/rpl.c
@@ -144,7 +144,7 @@ int rpl_udp_init(int argc, char **argv)
         DEBUGF("Start monitor\n");
         kernel_pid_t monitor_pid = thread_create(monitor_stack_buffer,
                                                  sizeof(monitor_stack_buffer),
-                                                 PRIORITY_MAIN - 2,
+                                                 THREAD_PRIORITY_MAIN - 2,
                                                  CREATE_STACKTEST,
                                                  rpl_udp_monitor,
                                                  NULL,
diff --git a/examples/rpl_udp/rpl_udp.h b/examples/rpl_udp/rpl_udp.h
index bb23537167b5626e563e0b9d41f37029efc69ecd..a650b659f5d08e92766711c22a91b6ec3fa704d7 100644
--- a/examples/rpl_udp/rpl_udp.h
+++ b/examples/rpl_udp/rpl_udp.h
@@ -17,7 +17,7 @@ extern "C" {
 
 #define RADIO_CHANNEL   (10)
 
-#define MONITOR_STACK_SIZE  (KERNEL_CONF_STACKSIZE_MAIN)
+#define MONITOR_STACK_SIZE  (THREAD_STACKSIZE_MAIN)
 #define RCV_BUFFER_SIZE     (32)
 
 /* RPL shell command handlers */
diff --git a/examples/rpl_udp/udp.c b/examples/rpl_udp/udp.c
index c2401bb18f1967883938df8723cf56dacf1f897e..a58e2a629ea4d8257511f4b984b65779b1b03ae3 100644
--- a/examples/rpl_udp/udp.c
+++ b/examples/rpl_udp/udp.c
@@ -35,7 +35,7 @@
 #define UDP_BUFFER_SIZE     (128)
 #define SERVER_PORT     (0xFF01)
 
-static char udp_server_stack_buffer[KERNEL_CONF_STACKSIZE_MAIN];
+static char udp_server_stack_buffer[THREAD_STACKSIZE_MAIN];
 char addr_str[IPV6_MAX_ADDR_STR_LEN];
 
 static void *init_udp_server(void *);
@@ -48,7 +48,7 @@ int udp_server(int argc, char **argv)
 
     kernel_pid_t udp_server_thread_pid = thread_create(udp_server_stack_buffer,
                                                        sizeof(udp_server_stack_buffer),
-                                                       PRIORITY_MAIN, CREATE_STACKTEST,
+                                                       THREAD_PRIORITY_MAIN, CREATE_STACKTEST,
                                                        init_udp_server,
                                                        NULL,
                                                        "init_udp_server");
diff --git a/pkg/openwsn/0003-Fix-old-style-definitions.patch b/pkg/openwsn/0003-Fix-old-style-definitions.patch
index 97e9b66e57e96c88725d7aa5ee3e144cb37abe30..d5434b89f4923db3416d7fe22626e2f54afeed0e 100644
Binary files a/pkg/openwsn/0003-Fix-old-style-definitions.patch and b/pkg/openwsn/0003-Fix-old-style-definitions.patch differ
diff --git a/pkg/openwsn/0005-fixes-to-RIOT-adaption.patch b/pkg/openwsn/0005-fixes-to-RIOT-adaption.patch
index 55f8c44eb1949c746dab1a1d62f4dacf4c18794a..ddf8e7e896a6f7e1b65af11f57438162c480cea4 100644
Binary files a/pkg/openwsn/0005-fixes-to-RIOT-adaption.patch and b/pkg/openwsn/0005-fixes-to-RIOT-adaption.patch differ
diff --git a/sys/auto_init/netif/auto_init_kw2xrf.c b/sys/auto_init/netif/auto_init_kw2xrf.c
index a2bd4e2de1b51196ec2cbf7fa27ec33e61caebf6..e3819078eb6559e8f5325e755149b629c6b9f2ed 100644
--- a/sys/auto_init/netif/auto_init_kw2xrf.c
+++ b/sys/auto_init/netif/auto_init_kw2xrf.c
@@ -35,8 +35,8 @@
  * @brief   Define stack parameters for the MAC layer thread
  * @{
  */
-#define KW2XRF_MAC_STACKSIZE     (KERNEL_CONF_STACKSIZE_DEFAULT)
-#define KW2XRF_MAC_PRIO          (PRIORITY_MAIN - 3)
+#define KW2XRF_MAC_STACKSIZE     (THREAD_STACKSIZE_DEFAULT)
+#define KW2XRF_MAC_PRIO          (THREAD_PRIORITY_MAIN - 3)
 
 #define KW2XRF_NUM (sizeof(kw2xrf_params)/sizeof(kw2xrf_params[0]))
 
diff --git a/sys/auto_init/netif/auto_init_ng_at86rf2xx.c b/sys/auto_init/netif/auto_init_ng_at86rf2xx.c
index 0cd4cf72c5db62be1c97259d4288033cd1d9f6f9..de872d1ba147c7fcf0b32e4ce2119a80c89dd209 100644
--- a/sys/auto_init/netif/auto_init_ng_at86rf2xx.c
+++ b/sys/auto_init/netif/auto_init_ng_at86rf2xx.c
@@ -33,8 +33,8 @@
  * @brief   Define stack parameters for the MAC layer thread
  * @{
  */
-#define AT86RF2XX_MAC_STACKSIZE     (KERNEL_CONF_STACKSIZE_DEFAULT)
-#define AT86RF2XX_MAC_PRIO          (PRIORITY_MAIN - 3)
+#define AT86RF2XX_MAC_STACKSIZE     (THREAD_STACKSIZE_DEFAULT)
+#define AT86RF2XX_MAC_PRIO          (THREAD_PRIORITY_MAIN - 3)
 
 #define AT86RF2XX_NUM (sizeof(at86rf2xx_params)/sizeof(at86rf2xx_params[0]))
 
diff --git a/sys/auto_init/netif/auto_init_xbee.c b/sys/auto_init/netif/auto_init_xbee.c
index 0c8798e2d5ad58c7c90f1971c61a609efc0d1475..4fc932abc382d0293a401223986691a19ed4aa95 100644
--- a/sys/auto_init/netif/auto_init_xbee.c
+++ b/sys/auto_init/netif/auto_init_xbee.c
@@ -37,8 +37,8 @@ static xbee_t xbee_devs[XBEE_NUM];
  * @brief   Define stack parameters for the MAC layer thread
  * @{
  */
-#define XBEE_MAC_STACKSIZE           (KERNEL_CONF_STACKSIZE_DEFAULT)
-#define XBEE_MAC_PRIO                (PRIORITY_MAIN - 3)
+#define XBEE_MAC_STACKSIZE           (THREAD_STACKSIZE_DEFAULT)
+#define XBEE_MAC_PRIO                (THREAD_PRIORITY_MAIN - 3)
 
 /**
  * @brief   Stacks for the MAC layer threads
diff --git a/sys/cpp11-compat/include/riot/thread.hpp b/sys/cpp11-compat/include/riot/thread.hpp
index 05a9ffae9fa82d80d2b7a63a8f97a912110716dc..8430f09d135ab25450944edca42647a40457b6bd 100644
--- a/sys/cpp11-compat/include/riot/thread.hpp
+++ b/sys/cpp11-compat/include/riot/thread.hpp
@@ -47,7 +47,7 @@ namespace riot {
 
 namespace {
 constexpr kernel_pid_t thread_uninitialized = -1;
-constexpr size_t stack_size = KERNEL_CONF_STACKSIZE_MAIN;
+constexpr size_t stack_size = THREAD_STACKSIZE_MAIN;
 }
 
 struct thread_data {
@@ -228,7 +228,7 @@ thread::thread(F&& f, Args&&... args)
   std::unique_ptr<func_and_args> p(
     new func_and_args(m_data.get(), forward<F>(f), forward<Args>(args)...));
   m_handle = thread_create(
-    m_data->stack, stack_size, PRIORITY_MAIN - 1, 0, // CREATE_WOUT_YIELD
+    m_data->stack, stack_size, THREAD_PRIORITY_MAIN - 1, 0, // CREATE_WOUT_YIELD
     &thread_proxy<func_and_args>, p.get(), "riot_cpp_thread");
   if (m_handle >= 0) {
     p.release();
diff --git a/sys/include/net/ng_ipv6.h b/sys/include/net/ng_ipv6.h
index b7415de35c3b44529c81f79a6f4fee4973c110e5..f30cf59250f3978f3e9d5b12a6a4371dfde25a24 100644
--- a/sys/include/net/ng_ipv6.h
+++ b/sys/include/net/ng_ipv6.h
@@ -45,14 +45,14 @@ extern "C" {
  * @brief   Default stack size to use for the IPv6 thread
  */
 #ifndef NG_IPV6_STACK_SIZE
-#define NG_IPV6_STACK_SIZE (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define NG_IPV6_STACK_SIZE (THREAD_STACKSIZE_DEFAULT)
 #endif
 
 /**
  * @brief   Default priority for the IPv6 thread
  */
 #ifndef NG_IPV6_PRIO
-#define NG_IPV6_PRIO            (PRIORITY_MAIN - 3)
+#define NG_IPV6_PRIO            (THREAD_PRIORITY_MAIN - 3)
 #endif
 
 /**
diff --git a/sys/include/net/ng_pktdump.h b/sys/include/net/ng_pktdump.h
index e69d3946a4737240d5fd6f4db8f6a335af3a9fe0..d3ca43fd3ad3aba9e2cb4307ef521e77934f98d7 100644
--- a/sys/include/net/ng_pktdump.h
+++ b/sys/include/net/ng_pktdump.h
@@ -39,14 +39,14 @@ extern "C" {
  * @brief   Priority of the pktdump thread
  */
 #ifndef NG_PKTDUMP_PRIO
-#define NG_PKTDUMP_PRIO                 (PRIORITY_MAIN - 1)
+#define NG_PKTDUMP_PRIO                 (THREAD_PRIORITY_MAIN - 1)
 #endif
 
 /**
  * @brief   Stack size used for the pktdump thread
  */
 #ifndef NG_PKTDUMP_STACKSIZE
-#define NG_PKTDUMP_STACKSIZE            (KERNEL_CONF_STACKSIZE_MAIN)
+#define NG_PKTDUMP_STACKSIZE            (THREAD_STACKSIZE_MAIN)
 #endif
 
 /**
diff --git a/sys/include/net/ng_sixlowpan.h b/sys/include/net/ng_sixlowpan.h
index 5af14b2018be46edb10c114c94724deae57cd4d0..d05524eaf44d41231cf95e80bc753867b3d26cda 100644
--- a/sys/include/net/ng_sixlowpan.h
+++ b/sys/include/net/ng_sixlowpan.h
@@ -34,14 +34,14 @@ extern "C" {
  * @brief   Default stack size to use for the 6LoWPAN thread
  */
 #ifndef NG_SIXLOWPAN_STACK_SIZE
-#define NG_SIXLOWPAN_STACK_SIZE  (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define NG_SIXLOWPAN_STACK_SIZE  (THREAD_STACKSIZE_DEFAULT)
 #endif
 
 /**
  * @brief   Default priority for the 6LoWPAN thread
  */
 #ifndef NG_SIXLOWPAN_PRIO
-#define NG_SIXLOWPAN_PRIO   (PRIORITY_MAIN - 4)
+#define NG_SIXLOWPAN_PRIO   (THREAD_PRIORITY_MAIN - 4)
 #endif
 
 /**
diff --git a/sys/include/net/ng_udp.h b/sys/include/net/ng_udp.h
index 6fd38620697e6ff53b4a89e6449335b3b6a55bbb..1c21c9a7364f4a4dc90fbf8f71be38180947ff09 100644
--- a/sys/include/net/ng_udp.h
+++ b/sys/include/net/ng_udp.h
@@ -42,14 +42,14 @@ extern "C" {
  * @brief   Priority of the pktdump thread
  */
 #ifndef NG_UDP_PRIO
-#define NG_UDP_PRIO             (PRIORITY_MAIN - 2)
+#define NG_UDP_PRIO             (THREAD_PRIORITY_MAIN - 2)
 #endif
 
 /**
  * @brief   Default stack size to use for the UDP thread
  */
 #ifndef NG_UDP_STACK_SIZE
-#define NG_UDP_STACK_SIZE       (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define NG_UDP_STACK_SIZE       (THREAD_STACKSIZE_DEFAULT)
 #endif
 
 /**
diff --git a/sys/include/transceiver.h b/sys/include/transceiver.h
index 6fbf018cb0b56a292a4c314565db705decdec957..b06918deb308992e5ee45b8792976691c05b40a4 100644
--- a/sys/include/transceiver.h
+++ b/sys/include/transceiver.h
@@ -95,7 +95,7 @@ extern "C" {
  * @brief Stack size for transceiver thread
  */
 #ifndef TRANSCEIVER_STACK_SIZE
-#define TRANSCEIVER_STACK_SIZE      (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define TRANSCEIVER_STACK_SIZE      (THREAD_STACKSIZE_DEFAULT)
 #endif
 
 /**
diff --git a/sys/net/ccn_lite/ccnl-riot-compat.c b/sys/net/ccn_lite/ccnl-riot-compat.c
index 30913caf9c7231919c621f49beaffecceee745de..b471e7b944709820b478222b548989935dfaa586 100644
--- a/sys/net/ccn_lite/ccnl-riot-compat.c
+++ b/sys/net/ccn_lite/ccnl-riot-compat.c
@@ -40,7 +40,7 @@ radio_packet_t p;
 transceiver_command_t tcmd;
 msg_t mesg, rep;
 
-char relay_helper_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char relay_helper_stack[THREAD_STACKSIZE_MAIN];
 
 int riot_send_transceiver(uint8_t *buf, uint16_t size, uint16_t to)
 {
@@ -117,7 +117,7 @@ void *ccnl_riot_relay_helper_start(void *);
 kernel_pid_t riot_start_helper_thread(void)
 {
     return thread_create(relay_helper_stack, sizeof(relay_helper_stack),
-                         PRIORITY_MAIN - 2, CREATE_STACKTEST,
+                         THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
                          ccnl_riot_relay_helper_start, NULL, "relay-helper");
 }
 
diff --git a/sys/net/include/rpl.h b/sys/net/include/rpl.h
index e2cfd01676087fc7f2e90ce85db9e03adae5febd..3168483cbf759cc14b2e3c18fcaaf34679866392 100644
--- a/sys/net/include/rpl.h
+++ b/sys/net/include/rpl.h
@@ -42,7 +42,7 @@ extern "C" {
 #define CC1100_RADIO_MODE CC1100_MODE_WOR
 
 #define RPL_PKT_RECV_BUF_SIZE 16
-#define RPL_PROCESS_STACKSIZE KERNEL_CONF_STACKSIZE_MAIN
+#define RPL_PROCESS_STACKSIZE THREAD_STACKSIZE_MAIN
 
 /* global variables */
 extern kernel_pid_t rpl_process_pid;
diff --git a/sys/net/link_layer/ping/ping.c b/sys/net/link_layer/ping/ping.c
index 06989764a06d52a94461ab7a3938ff5e36d1ff67..ffe3c4ba57f998b8e5b841161da88c4308fa8913 100644
--- a/sys/net/link_layer/ping/ping.c
+++ b/sys/net/link_layer/ping/ping.c
@@ -34,7 +34,7 @@
 /*--------------------------------------------------------------------------------------*/
 /* interal defines */
 #define RCV_BUFFER_SIZE     (64)
-#define RADIO_STACK_SIZE    (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define RADIO_STACK_SIZE    (THREAD_STACKSIZE_DEFAULT)
 #define MAX_PROB_STATS      (64)
 
 /* internal prototypes */
@@ -71,7 +71,7 @@ void l2_ping_init(void)
     mutex_init(&ping_sender_mutex);
     kernel_pid_t l2_pkt_handler_pid = thread_create(l2_pkt_handler_stack_buffer,
                                                     RADIO_STACK_SIZE,
-                                                    PRIORITY_MAIN - 2,
+                                                    THREAD_PRIORITY_MAIN - 2,
                                                     CREATE_STACKTEST,
                                                     l2_pkt_handler, NULL,
                                                     "l2_pkt_handler");
diff --git a/sys/net/network_layer/sixlowpan/border/border.c b/sys/net/network_layer/sixlowpan/border/border.c
index bfb4cdf15c685d85a84b3266bb06d808ccc38160..808b1f932cde888b4ebded152d0c5c1ccf48ee69 100644
--- a/sys/net/network_layer/sixlowpan/border/border.c
+++ b/sys/net/network_layer/sixlowpan/border/border.c
@@ -41,7 +41,7 @@
 #define ENABLE_DEBUG    (0)
 #include "debug.h"
 
-#define READER_STACK_SIZE   (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define READER_STACK_SIZE   (THREAD_STACKSIZE_DEFAULT)
 
 char serial_reader_stack[READER_STACK_SIZE];
 kernel_pid_t serial_reader_pid = KERNEL_PID_UNDEF;
@@ -130,10 +130,10 @@ int sixlowpan_lowpan_border_init(int if_id)
 
     serial_reader_pid = thread_create(
                             serial_reader_stack, READER_STACK_SIZE,
-                            PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                            THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                             serial_reader_f, "serial_reader");
     ip_process_pid = thread_create(ip_process_buf, IP_PROCESS_STACKSIZE,
-                                   PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                   THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                    border_process_lowpan,
                                    "border_process_lowpan");
 
diff --git a/sys/net/network_layer/sixlowpan/border/flowcontrol.c b/sys/net/network_layer/sixlowpan/border/flowcontrol.c
index 56a0d086801264ba81d4eb97f83593ee94f945fc..d8900456263b57670750ca01b5b97859bd3263ec 100644
--- a/sys/net/network_layer/sixlowpan/border/flowcontrol.c
+++ b/sys/net/network_layer/sixlowpan/border/flowcontrol.c
@@ -59,7 +59,7 @@ ipv6_addr_t init_threeway_handshake(void)
     synack->type = BORDER_PACKET_CONF_TYPE;
     synack->conftype = BORDER_CONF_SYNACK;
 
-    sending_slot_pid = thread_create(sending_slot_stack, SENDING_SLOT_STACK_SIZE, PRIORITY_MAIN - 1, CREATE_SLEEPING, sending_slot, "sending slot");
+    sending_slot_pid = thread_create(sending_slot_stack, SENDING_SLOT_STACK_SIZE, THREAD_PRIORITY_MAIN - 1, CREATE_SLEEPING, sending_slot, "sending slot");
     flowcontrol_send_over_uart((border_packet_t *)synack, sizeof(border_conf_header_t));
 
     synack_seqnum = synack->seq_num;
diff --git a/sys/net/network_layer/sixlowpan/border/flowcontrol.h b/sys/net/network_layer/sixlowpan/border/flowcontrol.h
index 49d059f56444b901f6e1b5a0145fda8e12e45723..013291606ed122caf7c9c4bb3f3db28308222b66 100644
--- a/sys/net/network_layer/sixlowpan/border/flowcontrol.h
+++ b/sys/net/network_layer/sixlowpan/border/flowcontrol.h
@@ -43,7 +43,7 @@ extern "C" {
 #define BORDER_RWS                (1)
 #define BORDER_SL_TIMEOUT         (500) // microseconds, maybe smaller
 
-#define SENDING_SLOT_STACK_SIZE     (MINIMUM_STACK_SIZE + 256)
+#define SENDING_SLOT_STACK_SIZE     (THREAD_STACKSIZE_MINIMUM + 256)
 
 typedef struct {
     /* Sender state */
diff --git a/sys/net/network_layer/sixlowpan/ip.h b/sys/net/network_layer/sixlowpan/ip.h
index eddf12aa821c58ddb86c352b46d6d69e72e72882..f421fbc24c3ddaa609f8a03dd9f9f4db39577ff5 100644
--- a/sys/net/network_layer/sixlowpan/ip.h
+++ b/sys/net/network_layer/sixlowpan/ip.h
@@ -26,6 +26,7 @@
 #include <stdint.h>
 
 #include "kernel.h"
+#include "thread.h"
 #include "timex.h"
 #include "mutex.h"
 #include "net_if.h"
@@ -45,7 +46,7 @@ extern "C" {
 #define MULTIHOP_HOPLIMIT           (64)
 
 #define SIXLOWIP_MAX_REGISTERED     (4)
-#define IP_PROCESS_STACKSIZE        (KERNEL_CONF_STACKSIZE_MAIN)
+#define IP_PROCESS_STACKSIZE        (THREAD_STACKSIZE_MAIN)
 
 /* extern variables */
 extern uint8_t ipv6_ext_hdr_len;
diff --git a/sys/net/network_layer/sixlowpan/lowpan.c b/sys/net/network_layer/sixlowpan/lowpan.c
index 8ef6d943e851d293b77817a132f1e811e454925b..a8aa511ead499f62a1359cc6748e74ef206df763 100644
--- a/sys/net/network_layer/sixlowpan/lowpan.c
+++ b/sys/net/network_layer/sixlowpan/lowpan.c
@@ -52,8 +52,8 @@ static char addr_str[IPV6_MAX_ADDR_STR_LEN];
 #endif
 #include "debug.h"
 
-#define CON_STACKSIZE                   (KERNEL_CONF_STACKSIZE_DEFAULT)
-#define LOWPAN_TRANSFER_BUF_STACKSIZE   (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define CON_STACKSIZE                   (THREAD_STACKSIZE_DEFAULT)
+#define LOWPAN_TRANSFER_BUF_STACKSIZE   (THREAD_STACKSIZE_DEFAULT)
 
 #define SIXLOWPAN_MAX_REGISTERED        (4)
 
@@ -1748,7 +1748,7 @@ int sixlowpan_lowpan_init(void)
 
     if (ip_process_pid == KERNEL_PID_UNDEF) {
         ip_process_pid = thread_create(ip_process_buf, IP_PROCESS_STACKSIZE,
-                                       PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                       THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                        ipv6_process, NULL, "ip_process");
     }
 
@@ -1759,7 +1759,7 @@ int sixlowpan_lowpan_init(void)
     nbr_cache_auto_rem();
 
     contexts_rem_pid = thread_create(con_buf, CON_STACKSIZE,
-                                     PRIORITY_MAIN + 1, CREATE_STACKTEST,
+                                     THREAD_PRIORITY_MAIN + 1, CREATE_STACKTEST,
                                      lowpan_context_auto_remove, NULL, "lowpan_context_rem");
 
     if (contexts_rem_pid == KERNEL_PID_UNDEF) {
@@ -1767,7 +1767,7 @@ int sixlowpan_lowpan_init(void)
     }
 
     transfer_pid = thread_create(lowpan_transfer_buf, LOWPAN_TRANSFER_BUF_STACKSIZE,
-                                 PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                 THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                  lowpan_transfer, NULL, "lowpan_transfer");
 
     if (transfer_pid == KERNEL_PID_UNDEF) {
diff --git a/sys/net/network_layer/sixlowpan/mac.c b/sys/net/network_layer/sixlowpan/mac.c
index 822c3f49fca04b1594c0d63b65e6ae2e8dca8324..16cdf246275daeb9679aad276f79b08c1b2fd198 100644
--- a/sys/net/network_layer/sixlowpan/mac.c
+++ b/sys/net/network_layer/sixlowpan/mac.c
@@ -39,7 +39,7 @@
 #define ENABLE_DEBUG    (0)
 #include "debug.h"
 
-#define RADIO_STACK_SIZE            (KERNEL_CONF_STACKSIZE_MAIN)
+#define RADIO_STACK_SIZE            (THREAD_STACKSIZE_MAIN)
 #define RADIO_RCV_BUF_SIZE          (64)
 #define RADIO_SENDING_DELAY         (1000)
 
@@ -326,7 +326,7 @@ int sixlowpan_mac_send_ieee802154_frame(int if_id,
 kernel_pid_t sixlowpan_mac_init(void)
 {
     kernel_pid_t recv_pid = thread_create(radio_stack_buffer, RADIO_STACK_SIZE,
-                                          PRIORITY_MAIN - 2, CREATE_STACKTEST,
+                                          THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
                                           recv_ieee802154_frame, NULL, "radio");
     int if_id = -1;
 
diff --git a/sys/net/routing/aodvv2/aodv.c b/sys/net/routing/aodvv2/aodv.c
index 939e5e09de02d91148b8ad226f28407f6a4ae9c9..d6d502ffc24ce31493ac95b4cc2fece33be6f5e3 100644
--- a/sys/net/routing/aodvv2/aodv.c
+++ b/sys/net/routing/aodvv2/aodv.c
@@ -41,8 +41,8 @@ char addr_str[IPV6_MAX_ADDR_STR_LEN];
 static struct netaddr_str nbuf;
 #endif
 
-static char aodv_rcv_stack_buf[KERNEL_CONF_STACKSIZE_MAIN];
-static char aodv_snd_stack_buf[KERNEL_CONF_STACKSIZE_MAIN];
+static char aodv_rcv_stack_buf[THREAD_STACKSIZE_MAIN];
+static char aodv_snd_stack_buf[THREAD_STACKSIZE_MAIN];
 
 static aodvv2_metric_t _metric_type;
 static int sender_thread;
@@ -89,11 +89,11 @@ void aodv_init(void)
     aodv_packet_writer_init(_write_packet);
 
     /* start listening & enable sending */
-    thread_create(aodv_rcv_stack_buf, sizeof(aodv_rcv_stack_buf), PRIORITY_MAIN,
+    thread_create(aodv_rcv_stack_buf, sizeof(aodv_rcv_stack_buf), THREAD_PRIORITY_MAIN,
                   CREATE_STACKTEST, _aodv_receiver_thread, NULL, "_aodv_receiver_thread");
     AODV_DEBUG("listening on port %d\n", HTONS(MANET_PORT));
     sender_thread = thread_create(aodv_snd_stack_buf, sizeof(aodv_snd_stack_buf),
-                                  PRIORITY_MAIN, CREATE_STACKTEST, _aodv_sender_thread,
+                                  THREAD_PRIORITY_MAIN, CREATE_STACKTEST, _aodv_sender_thread,
                                   NULL, "_aodv_sender_thread");
 
     /* register aodv for routing */
diff --git a/sys/net/routing/etx_beaconing.c b/sys/net/routing/etx_beaconing.c
index c22fa48441f57f0641dee4e23fb3658ef5b3f43b..836e1d120e09398628f8207b3d44e357e41c249b 100644
--- a/sys/net/routing/etx_beaconing.c
+++ b/sys/net/routing/etx_beaconing.c
@@ -38,13 +38,13 @@
 #include "debug.h"
 
 #if ENABLE_DEBUG
-#define ETX_BEACON_STACKSIZE    (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF_FLOAT)
-#define ETX_RADIO_STACKSIZE     (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF_FLOAT)
-#define ETX_CLOCK_STACKSIZE     (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define ETX_BEACON_STACKSIZE    (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT)
+#define ETX_RADIO_STACKSIZE     (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF_FLOAT)
+#define ETX_CLOCK_STACKSIZE     (THREAD_STACKSIZE_DEFAULT)
 #else
-#define ETX_BEACON_STACKSIZE    (KERNEL_CONF_STACKSIZE_MAIN)
-#define ETX_RADIO_STACKSIZE     (KERNEL_CONF_STACKSIZE_MAIN)
-#define ETX_CLOCK_STACKSIZE     (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define ETX_BEACON_STACKSIZE    (THREAD_STACKSIZE_MAIN)
+#define ETX_RADIO_STACKSIZE     (THREAD_STACKSIZE_MAIN)
+#define ETX_CLOCK_STACKSIZE     (THREAD_STACKSIZE_DEFAULT)
 #endif
 
 /* prototytpes */
@@ -148,15 +148,15 @@ void etx_init_beaconing(ipv6_addr_t *address)
     etx_send_buf[0] = ETX_PKT_OPTVAL;
 
     etx_beacon_pid = thread_create(etx_beacon_buf, sizeof(etx_beacon_buf),
-                                   PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                   THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                    etx_beacon, NULL, "etx_beacon");
 
     etx_radio_pid = thread_create(etx_radio_buf, sizeof(etx_radio_buf),
-                                  PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                  THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                   etx_radio, NULL, "etx_radio");
 
     etx_clock_pid = thread_create(etx_clock_buf, sizeof(etx_clock_buf),
-                                  PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                  THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                   etx_clock, NULL, "etx_clock");
     //register at transceiver
     transceiver_register(TRANSCEIVER_CC1100, etx_radio_pid);
diff --git a/sys/net/routing/nhdp/nhdp.c b/sys/net/routing/nhdp/nhdp.c
index 086454550c2ddb85edcd54a5e9e4666e3e065400..2e66fcb9174ceae21689c37b34d8958a71732500 100644
--- a/sys/net/routing/nhdp/nhdp.c
+++ b/sys/net/routing/nhdp/nhdp.c
@@ -88,7 +88,7 @@ kernel_pid_t nhdp_start(void)
         sock_rcv = socket_base_socket(PF_INET6, SOCK_DGRAM, IPPROTO_UDP);
 
         /* Start the NHDP thread */
-        nhdp_pid = thread_create(nhdp_stack, sizeof(nhdp_stack), PRIORITY_MAIN - 1,
+        nhdp_pid = thread_create(nhdp_stack, sizeof(nhdp_stack), THREAD_PRIORITY_MAIN - 1,
                                  CREATE_STACKTEST, _nhdp_runner, NULL, "NHDP");
     }
 
@@ -179,7 +179,7 @@ int nhdp_register_if(kernel_pid_t if_pid, uint8_t *addr, size_t addr_size, uint8
     helper_pid = if_pid;
 
     /* Start the receiving thread */
-    nhdp_rcv_pid = thread_create(nhdp_rcv_stack, sizeof(nhdp_rcv_stack), PRIORITY_MAIN - 1,
+    nhdp_rcv_pid = thread_create(nhdp_rcv_stack, sizeof(nhdp_rcv_stack), THREAD_PRIORITY_MAIN - 1,
                                  CREATE_STACKTEST, _nhdp_receiver, NULL, "nhdp_rcv_thread");
 
     /* Start sending periodic HELLO */
diff --git a/sys/net/routing/nhdp/nhdp.h b/sys/net/routing/nhdp/nhdp.h
index 46fd04e051d5bc325d1667602e29aeb17e9f5c4c..c3e54326e1a5ee51ccbf079594d2285a80fd06d0 100644
--- a/sys/net/routing/nhdp/nhdp.h
+++ b/sys/net/routing/nhdp/nhdp.h
@@ -47,9 +47,9 @@ extern "C" {
 
 /** @brief Stack size for NHDP thread */
 #if ENABLE_DEBUG
-#define NHDP_STACK_SIZE      (KERNEL_CONF_STACKSIZE_DEFAULT + KERNEL_CONF_STACKSIZE_PRINTF)
+#define NHDP_STACK_SIZE      (THREAD_STACKSIZE_DEFAULT + THREAD_EXTRA_STACKSIZE_PRINTF)
 #else
-#define NHDP_STACK_SIZE      (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define NHDP_STACK_SIZE      (THREAD_STACKSIZE_DEFAULT)
 #endif
 
 /** @brief Buffer size in bytes for NHDP writer's msg buffer */
diff --git a/sys/net/routing/rpl/rpl.c b/sys/net/routing/rpl/rpl.c
index ad9a985b5667690568da76082519cece324350ae..b30c91979aa0b6c414cdd9d876d2547de02a7423 100644
--- a/sys/net/routing/rpl/rpl.c
+++ b/sys/net/routing/rpl/rpl.c
@@ -83,7 +83,7 @@ uint8_t rpl_init(int if_id, ipv6_addr_t *address)
 #endif
 
     rpl_process_pid = thread_create(rpl_process_buf, sizeof(rpl_process_buf),
-                                    PRIORITY_MAIN - 1, CREATE_STACKTEST,
+                                    THREAD_PRIORITY_MAIN - 1, CREATE_STACKTEST,
                                     rpl_process, NULL, "rpl_process");
 
     sixlowpan_lowpan_init_interface(if_id);
diff --git a/sys/net/transport_layer/tcp/tcp.c b/sys/net/transport_layer/tcp/tcp.c
index 1b666614750a80445c71c143f7d279497bba41e9..4555ac982fd67d1b9d40ddbb82900abe6fda30d1 100644
--- a/sys/net/transport_layer/tcp/tcp.c
+++ b/sys/net/transport_layer/tcp/tcp.c
@@ -1405,7 +1405,7 @@ int tcp_init_transport_layer(void)
     global_sequence_counter = rand();
 
     int tcp_thread_pid = thread_create(tcp_stack_buffer, TCP_STACK_SIZE,
-                                       PRIORITY_MAIN, CREATE_STACKTEST, tcp_packet_handler, NULL, "tcp_packet_handler");
+                                       THREAD_PRIORITY_MAIN, CREATE_STACKTEST, tcp_packet_handler, NULL, "tcp_packet_handler");
 
     if (tcp_thread_pid < 0) {
         return -1;
@@ -1413,7 +1413,7 @@ int tcp_init_transport_layer(void)
 
     ipv6_register_next_header_handler(IPV6_PROTO_NUM_TCP, tcp_thread_pid);
 
-    if (thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, PRIORITY_MAIN + 1,
+    if (thread_create(tcp_timer_stack, TCP_TIMER_STACKSIZE, THREAD_PRIORITY_MAIN + 1,
                       CREATE_STACKTEST, tcp_general_timer, NULL, "tcp_general_timer") < 0) {
         return -1;
     }
diff --git a/sys/net/transport_layer/tcp/tcp.h b/sys/net/transport_layer/tcp/tcp.h
index 6b72cba99e917f32cf4e91705adec774b43b5ec6..a30b0c8d5bec9834a3a696bb9582c3518285d119 100644
--- a/sys/net/transport_layer/tcp/tcp.h
+++ b/sys/net/transport_layer/tcp/tcp.h
@@ -85,7 +85,7 @@ enum tcp_codes {
 #define SET_TCP_FIN(a)          (a) = TCP_FIN
 #define SET_TCP_FIN_ACK(a)      (a) = TCP_FIN_ACK
 
-#define TCP_STACK_SIZE          (KERNEL_CONF_STACKSIZE_MAIN)
+#define TCP_STACK_SIZE          (THREAD_STACKSIZE_MAIN)
 
 typedef struct __attribute__((packed)) tcp_mms_o_t {
     uint8_t     kind;
diff --git a/sys/net/transport_layer/tcp/tcp_timer.h b/sys/net/transport_layer/tcp/tcp_timer.h
index 94709f92be58fb8ecd2beee7f9d2d78a8ee8b356..ff1d707e976a18274cd9fc59a7e74e6a2bb32ede 100644
--- a/sys/net/transport_layer/tcp/tcp_timer.h
+++ b/sys/net/transport_layer/tcp/tcp_timer.h
@@ -22,7 +22,7 @@ extern "C" {
 #define TCP_TIMER_RESOLUTION        500*1000
 
 #define SECOND                      1000.0f*1000.0f
-#define TCP_TIMER_STACKSIZE         KERNEL_CONF_STACKSIZE_DEFAULT
+#define TCP_TIMER_STACKSIZE         THREAD_STACKSIZE_DEFAULT
 #define TCP_SYN_INITIAL_TIMEOUT     6*SECOND
 #define TCP_SYN_TIMEOUT             24*SECOND
 #define TCP_MAX_SYN_RETRIES         3
diff --git a/sys/net/transport_layer/udp/udp.c b/sys/net/transport_layer/udp/udp.c
index 5dac8d4b4070e91261cf94e176006a2db209c678..6dc93f78c4ed026b3b4b1967162e370304585b63 100644
--- a/sys/net/transport_layer/udp/udp.c
+++ b/sys/net/transport_layer/udp/udp.c
@@ -204,7 +204,7 @@ int udp_init_transport_layer(void)
     /* SOCKETS */
     memset(socket_base_sockets, 0, MAX_SOCKETS * sizeof(socket_internal_t));
 
-    int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE, PRIORITY_MAIN,
+    int udp_thread_pid = thread_create(udp_stack_buffer, UDP_STACK_SIZE, THREAD_PRIORITY_MAIN,
                                         CREATE_STACKTEST, udp_packet_handler, NULL, "udp_packet_handler");
 
     if (udp_thread_pid < 0) {
diff --git a/sys/net/transport_layer/udp/udp.h b/sys/net/transport_layer/udp/udp.h
index daa8cad338d9a91149c5e74f0cb97755ec3d4730..52a9c4f94bb3efe9a015d9f4d6b5ccf8830c4ee5 100644
--- a/sys/net/transport_layer/udp/udp.h
+++ b/sys/net/transport_layer/udp/udp.h
@@ -32,7 +32,7 @@ extern "C" {
 /**
  * @brief   Stack size used for the UDP thread
  */
-#define UDP_STACK_SIZE                  KERNEL_CONF_STACKSIZE_MAIN
+#define UDP_STACK_SIZE                  THREAD_STACKSIZE_MAIN
 
 /**
  * @brief   Size of the UDP receive buffer
diff --git a/sys/posix/pthread/pthread.c b/sys/posix/pthread/pthread.c
index 761bc75aafdbe9956f42db876abf2dc97dbc5988..538b243bbb7cbf18ab9808804aaf2f5f7f34a163 100644
--- a/sys/posix/pthread/pthread.c
+++ b/sys/posix/pthread/pthread.c
@@ -38,11 +38,11 @@
 #define ENABLE_DEBUG (0)
 
 #if ENABLE_DEBUG
-#   define PTHREAD_REAPER_STACKSIZE KERNEL_CONF_STACKSIZE_MAIN
-#   define PTHREAD_STACKSIZE KERNEL_CONF_STACKSIZE_MAIN
+#   define PTHREAD_REAPER_STACKSIZE THREAD_STACKSIZE_MAIN
+#   define PTHREAD_STACKSIZE THREAD_STACKSIZE_MAIN
 #else
-#   define PTHREAD_REAPER_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT
-#   define PTHREAD_STACKSIZE KERNEL_CONF_STACKSIZE_DEFAULT
+#   define PTHREAD_REAPER_STACKSIZE THREAD_STACKSIZE_DEFAULT
+#   define PTHREAD_STACKSIZE THREAD_STACKSIZE_DEFAULT
 #endif
 
 #include "debug.h"
@@ -154,7 +154,7 @@ int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*sta
 
     pt->thread_pid = thread_create(stack,
                                    stack_size,
-                                   PRIORITY_MAIN,
+                                   THREAD_PRIORITY_MAIN,
                                    CREATE_WOUT_YIELD | CREATE_STACKTEST,
                                    pthread_start_routine,
                                    pt,
@@ -166,7 +166,7 @@ int pthread_create(pthread_t *newthread, const pthread_attr_t *attr, void *(*sta
         return -1;
     }
 
-    sched_switch(PRIORITY_MAIN);
+    sched_switch(THREAD_PRIORITY_MAIN);
 
     return 0;
 }
diff --git a/sys/transceiver/transceiver.c b/sys/transceiver/transceiver.c
index a3e6f07ff48840d249a05a4342e75ee8c0c4e8bf..a0a89a7a607ca5cf4bfc359152523627a3c8a839 100644
--- a/sys/transceiver/transceiver.c
+++ b/sys/transceiver/transceiver.c
@@ -67,7 +67,7 @@
 #define ENABLE_DEBUG (0)
 #if ENABLE_DEBUG
 #undef TRANSCEIVER_STACK_SIZE
-#define TRANSCEIVER_STACK_SIZE      (KERNEL_CONF_STACKSIZE_MAIN)
+#define TRANSCEIVER_STACK_SIZE      (THREAD_STACKSIZE_MAIN)
 #endif
 #include "debug.h"
 
@@ -186,7 +186,7 @@ void transceiver_init(transceiver_type_t t)
 /* Start the transceiver thread */
 kernel_pid_t transceiver_start(void)
 {
-    transceiver_pid = thread_create(transceiver_stack, TRANSCEIVER_STACK_SIZE, PRIORITY_MAIN - 3, CREATE_STACKTEST, run, NULL, "Transceiver");
+    transceiver_pid = thread_create(transceiver_stack, TRANSCEIVER_STACK_SIZE, THREAD_PRIORITY_MAIN - 3, CREATE_STACKTEST, run, NULL, "Transceiver");
 
     if (transceiver_pid == KERNEL_PID_UNDEF) {
         puts("Error creating transceiver thread");
diff --git a/sys/uart0/uart0.c b/sys/uart0/uart0.c
index 7adb0d2e06d88cc412d006dc52feee53f12491bc..1a8d1e9f6f6accaee8d439ecd8254050f14ecc6f 100644
--- a/sys/uart0/uart0.c
+++ b/sys/uart0/uart0.c
@@ -36,7 +36,7 @@
 #endif
 
 /* increase when ENABLE_DEBUG in chardev_thread is set to 1! */
-#define UART0_STACKSIZE     (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define UART0_STACKSIZE     (THREAD_STACKSIZE_DEFAULT)
 
 ringbuffer_t uart0_ringbuffer;
 kernel_pid_t uart0_handler_pid = KERNEL_PID_UNDEF;
@@ -51,7 +51,7 @@ void board_uart0_init(void)
     kernel_pid_t pid = thread_create(
                   uart0_thread_stack,
                   sizeof(uart0_thread_stack),
-                  PRIORITY_MAIN - 1,
+                  THREAD_PRIORITY_MAIN - 1,
                   CREATE_STACKTEST | CREATE_SLEEPING,
                   chardev_thread_entry,
                   &uart0_ringbuffer,
diff --git a/tests/driver_at86rf2xx/auto_init_ng_netif/netif_app.c b/tests/driver_at86rf2xx/auto_init_ng_netif/netif_app.c
new file mode 100644
index 0000000000000000000000000000000000000000..ac1d3a7ad4d474e596ae1d6b9619301f394a24f4
--- /dev/null
+++ b/tests/driver_at86rf2xx/auto_init_ng_netif/netif_app.c
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2015 Freie Universität Berlin
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @ingroup     tests
+ * @{
+ *
+ * @file
+ * @brief       Test application for AT86RF2xx network device driver
+ *
+ * @author      Hauke Petersen <hauke.petersen@fu-berlin.de>
+ *
+ * @}
+ */
+
+#include <stdio.h>
+
+#include "kernel.h"
+#include "ng_at86rf2xx.h"
+#include "net/ng_nomac.h"
+#include "net/ng_netbase.h"
+
+/* make sure the SPI port and the needed GPIO pins are defined */
+#ifndef ATRF_SPI
+#error "SPI not defined"
+#endif
+#ifndef ATRF_CS
+#error "Chip select pin not defined"
+#endif
+#ifndef ATRF_INT
+#error "Interrupt pin not defined"
+#endif
+#ifndef ATRF_SLEEP
+#error "Sleep pin not defined"
+#endif
+#ifndef ATRF_RESET
+#error "Reset pin not defined"
+#endif
+#ifndef ATRF_SPI_SPEED
+#define ATRF_SPI_SPEED          (SPI_SPEED_5MHZ)
+#endif
+
+/**
+ * @brief   MAC layer stack configuration
+ * @{
+ */
+#define STACKSIZE               (THREAD_STACKSIZE_MAIN)
+#define PRIO                    (0)
+/** @} */
+
+/**
+ * @brief   Allocate the AT86RF2xx device descriptor
+ */
+static ng_at86rf2xx_t dev;
+
+/**
+ * @brief   Stack for the nomac thread
+ */
+static char nomac_stack[STACKSIZE];
+
+
+void auto_init_ng_netif(void)
+{
+    kernel_pid_t iface;
+    int res;
+
+    /* initialize the AT86RF2xx device */
+    printf("Initializing the AT86RF2xx radio at SPI_%i... \n", ATRF_SPI);
+    res = ng_at86rf2xx_init(&dev, ATRF_SPI, ATRF_SPI_SPEED,
+                            ATRF_CS, ATRF_INT,
+                            ATRF_SLEEP, ATRF_RESET);
+    if (res < 0) {
+        puts("Error initializing AT86RF2xx radio device");
+        return;
+    }
+
+    /* start MAC layer */
+    puts("Starting the NOMAC layer on top of the driver");
+    iface = ng_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "at86rf2xx",
+                          (ng_netdev_t *)(&dev));
+    if (iface <= KERNEL_PID_UNDEF) {
+        puts("Error initializing MAC layer");
+        return;
+    }
+
+}
diff --git a/tests/driver_kw2xrf/auto_init_ng_netif/netif_app.c b/tests/driver_kw2xrf/auto_init_ng_netif/netif_app.c
new file mode 100644
index 0000000000000000000000000000000000000000..ae54951c2fcff6e3f70d149129933a0f4d88bcb1
--- /dev/null
+++ b/tests/driver_kw2xrf/auto_init_ng_netif/netif_app.c
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2015 Freie Universität Berlin
+ * Copyright (C) 2015 PHYTEC Messtechnik GmbH
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @ingroup     tests
+ * @{
+ *
+ * @file
+ * @brief       Test application for KW2xRF network device driver
+ *
+ * @author      Hauke Petersen <hauke.petersen@fu-berlin.de>
+ * @author      Jonas Remmert <j.remmert@phytec.de>
+ *
+ * @}
+ */
+
+#include <stdio.h>
+
+#include "kernel.h"
+#include "kw2xrf.h"
+#include "net/ng_nomac.h"
+#include "net/ng_netbase.h"
+
+/* make sure the SPI port and the needed GPIO pins are defined */
+#ifndef KWRF_SPI
+#error "SPI not defined"
+#endif
+#ifndef KWRF_CS
+#error "Chip select pin not defined"
+#endif
+#ifndef KWRF_INT
+#error "Interrupt pin not defined"
+#endif
+#ifndef KWRF_SPI_SPEED
+#define KWRF_SPI_SPEED          (SPI_SPEED_10MHZ)
+#endif
+
+/**
+ * @brief   MAC layer stack configuration
+ * @{
+ */
+#define STACKSIZE               (THREAD_STACKSIZE_MAIN)
+#define PRIO                    (0)
+/** @} */
+
+/**
+ * @brief   Allocate the KW2XRF device descriptor
+ */
+static kw2xrf_t dev;
+
+/**
+ * @brief   Stack for the nomac thread
+ */
+static char nomac_stack[STACKSIZE];
+
+
+void auto_init_ng_netif(void)
+{
+    kernel_pid_t iface;
+    int res;
+
+    /* initialize the KW2XRF device */
+    printf("Initializing the KW2XRF radio at SPI_%i... \n", KWRF_SPI);
+    res = kw2xrf_init(&dev, KWRF_SPI, KWRF_SPI_SPEED,
+                            KWRF_CS, KWRF_INT);
+    if (res < 0) {
+        puts("Error initializing KW2XRF radio device");
+        return;
+    }
+
+    /* start MAC layer */
+    puts("Starting the NOMAC layer on top of the driver");
+    iface = ng_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "kw2xrf",
+                          (ng_netdev_t *)(&dev));
+    if (iface <= KERNEL_PID_UNDEF) {
+        puts("Error initializing MAC layer");
+        return;
+    }
+
+}
diff --git a/tests/driver_nrf24l01p_lowlevel/main.c b/tests/driver_nrf24l01p_lowlevel/main.c
index 4ebdd50e347c7012a6079a6bbde2005885176457..59c577bdea7803ddc330500b30c7a37109060df8 100644
--- a/tests/driver_nrf24l01p_lowlevel/main.c
+++ b/tests/driver_nrf24l01p_lowlevel/main.c
@@ -125,7 +125,7 @@ void print_register(char reg, int num_bytes)
     }
 }
 
-char rx_handler_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char rx_handler_stack[THREAD_STACKSIZE_MAIN];
 
 /* RX handler that waits for a message from the ISR */
 void *nrf24l01p_rx_handler(void *arg)
@@ -197,7 +197,7 @@ int cmd_its(int argc, char **argv)
 
     /* create thread that gets msg when data arrives */
     if (thread_create(
-        rx_handler_stack, sizeof(rx_handler_stack), PRIORITY_MAIN - 1, 0,
+        rx_handler_stack, sizeof(rx_handler_stack), THREAD_PRIORITY_MAIN - 1, 0,
         nrf24l01p_rx_handler, 0, "nrf24l01p_rx_handler") < 0) {
         puts("Error in thread_create");
         return;
diff --git a/tests/driver_pir/main.c b/tests/driver_pir/main.c
index 0d80931ebfb9af18d54768af30a1116066247762..4932ebe87271762bd6429d50bfbd977756390edf 100644
--- a/tests/driver_pir/main.c
+++ b/tests/driver_pir/main.c
@@ -28,7 +28,7 @@
 #include "vtimer.h"
 #include "pir.h"
 
-char pir_handler_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char pir_handler_stack[THREAD_STACKSIZE_MAIN];
 pir_t dev;
 
 void* pir_handler(void *arg)
@@ -79,7 +79,7 @@ int main(void)
     }
 #else
    thread_create(
-           pir_handler_stack, sizeof(pir_handler_stack), PRIORITY_MAIN - 1,
+           pir_handler_stack, sizeof(pir_handler_stack), THREAD_PRIORITY_MAIN - 1,
            CREATE_WOUT_YIELD | CREATE_STACKTEST,
            pir_handler, NULL, "pir_handler");
 #endif
diff --git a/tests/driver_xbee/auto_init_ng_netif/netif_app.c b/tests/driver_xbee/auto_init_ng_netif/netif_app.c
new file mode 100644
index 0000000000000000000000000000000000000000..90cf1bfadeb47b52736f698535ba9cb772bcc2ac
--- /dev/null
+++ b/tests/driver_xbee/auto_init_ng_netif/netif_app.c
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2015 Freie Universität Berlin
+ *
+ * This file is subject to the terms and conditions of the GNU Lesser
+ * General Public License v2.1. See the file LICENSE in the top level
+ * directory for more details.
+ */
+
+/**
+ * @ingroup     tests
+ * @{
+ *
+ * @file
+ * @brief       Xbee device initialization
+ *
+ * @author      Hauke Petersen <hauke.petersen@fu-berlin.de>
+ *
+ * @}
+ */
+
+#include <stdio.h>
+
+#include "kernel.h"
+#include "xbee.h"
+#include "net/ng_nomac.h"
+#include "net/ng_netbase.h"
+
+/* make sure an UART to device is defined in the Makefile */
+#ifndef XBEE_UART
+#error "XBEE_UART not defined"
+#endif
+
+/**
+ * @brief   This is the default baudrate the Xbee modules are programmed to
+ *          when you buy them
+ */
+#define XBEE_BAUDRATE           (9600U)
+
+/**
+ * @brief   MAC layer stack configuration
+ * @{
+ */
+#define STACKSIZE               (THREAD_STACKSIZE_DEFAULT)
+#define PRIO                    (0)
+/** @} */
+
+/**
+ * @brief   The Xbee device descriptor
+ */
+static xbee_t dev;
+
+/**
+ * @brief   Stack for the nomac thread
+ */
+static char nomac_stack[STACKSIZE];
+
+
+void auto_init_ng_netif(void)
+{
+    int res;
+    kernel_pid_t iface;
+
+    /* setup Xbee device */
+    printf("Initializing the Xbee S1 device UART_%i... \n", XBEE_UART);
+    res = xbee_init(&dev, XBEE_UART, XBEE_BAUDRATE, GPIO_NUMOF, GPIO_NUMOF);
+    if (res < 0) {
+        puts("Error initializing xbee device driver");
+        return;
+    }
+    /* start MAC layer */
+    iface = ng_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "xbee",
+                          (ng_netdev_t *)(&dev));
+    if (iface <= KERNEL_PID_UNDEF) {
+        puts("Error initializing MAC layer");
+        return;
+    }
+}
diff --git a/tests/irq/main.c b/tests/irq/main.c
index 8735f89a0d5017ae2edcc18c06254b384bbce0f9..9139c1ea56e0180dd5cb9a5d0ae7f18bbc389638 100644
--- a/tests/irq/main.c
+++ b/tests/irq/main.c
@@ -23,7 +23,7 @@
 #include "hwtimer.h"
 #include "thread.h"
 
-char busy_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char busy_stack[THREAD_STACKSIZE_MAIN];
 volatile int busy, i, k;
 
 void *busy_thread(void *arg)
@@ -54,7 +54,7 @@ int main(void)
     busy = 1;
     k = 23;
     thread_create(busy_stack, sizeof(busy_stack),
-                  PRIORITY_MAIN + 1, CREATE_WOUT_YIELD,
+                  THREAD_PRIORITY_MAIN + 1, CREATE_WOUT_YIELD,
                   busy_thread, NULL, "busy_thread");
     puts("busy_thread created");
 
diff --git a/tests/msg_send_receive/main.c b/tests/msg_send_receive/main.c
index 9262fef374097aa845d2d83714710a697f937267..6ba74d73cbe5622a37bb9535d340791e980d4a32 100644
--- a/tests/msg_send_receive/main.c
+++ b/tests/msg_send_receive/main.c
@@ -24,8 +24,8 @@
 #include "cpu-conf.h"
 #include "thread.h"
 
-#define THREAD1_STACKSIZE   (KERNEL_CONF_STACKSIZE_PRINTF)
-#define THREAD2_STACKSIZE   (KERNEL_CONF_STACKSIZE_PRINTF)
+#define THREAD1_STACKSIZE   (THREAD_EXTRA_STACKSIZE_PRINTF)
+#define THREAD2_STACKSIZE   (THREAD_EXTRA_STACKSIZE_PRINTF)
 
 #ifndef TEST_EXECUTION_NUM
 #define TEST_EXECUTION_NUM  (10)
@@ -93,9 +93,9 @@ static void *thread2(void *args)
 
 int main(void)
 {
-    thread2_pid = thread_create(thread2_stack, THREAD2_STACKSIZE, PRIORITY_MAIN - 1,
+    thread2_pid = thread_create(thread2_stack, THREAD2_STACKSIZE, THREAD_PRIORITY_MAIN - 1,
                                 0, thread2, NULL, "thread2");
-    thread1_pid = thread_create(thread1_stack, THREAD1_STACKSIZE, PRIORITY_MAIN - 2,
+    thread1_pid = thread_create(thread1_stack, THREAD1_STACKSIZE, THREAD_PRIORITY_MAIN - 2,
                                 0, thread1, NULL, "thread1");
     return 0;
 }
diff --git a/tests/mutex_unlock_and_sleep/main.c b/tests/mutex_unlock_and_sleep/main.c
index 8bc26bbe3fe4202e075a2bdca4838384ca295ace..95ff54bc1aef904f1578241ab8968a279b9388a4 100644
--- a/tests/mutex_unlock_and_sleep/main.c
+++ b/tests/mutex_unlock_and_sleep/main.c
@@ -26,7 +26,7 @@ static mutex_t mutex = MUTEX_INIT;
 static volatile int indicator, count;
 static kernel_pid_t main_pid;
 
-static char stack[KERNEL_CONF_STACKSIZE_MAIN];
+static char stack[THREAD_STACKSIZE_MAIN];
 static void *second_thread(void *arg)
 {
     (void) arg;
@@ -48,7 +48,7 @@ int main(void)
 
     kernel_pid_t second_pid = thread_create(stack,
                   sizeof(stack),
-                  PRIORITY_MAIN - 1,
+                  THREAD_PRIORITY_MAIN - 1,
                   CREATE_WOUT_YIELD | CREATE_STACKTEST,
                   second_thread,
                   NULL,
diff --git a/tests/nativenet/main.c b/tests/nativenet/main.c
index 6c76ee5a02b9876a01976742afad0837521e1f35..c7d157a59e18d22027ab7305667ff0460e352d37 100644
--- a/tests/nativenet/main.c
+++ b/tests/nativenet/main.c
@@ -39,7 +39,7 @@
 #define SENDING_DELAY       (10 * 1000)
 
 #define RCV_BUFFER_SIZE     (64)
-#define RADIO_STACK_SIZE    (KERNEL_CONF_STACKSIZE_DEFAULT)
+#define RADIO_STACK_SIZE    (THREAD_STACKSIZE_DEFAULT)
 
 static char radio_stack_buffer[RADIO_STACK_SIZE];
 static msg_t msg_q[RCV_BUFFER_SIZE];
@@ -145,7 +145,7 @@ int main(void)
     printf("\n\tmain(): starting radio thread\n");
     kernel_pid_t radio_pid = thread_create(
             radio_stack_buffer, sizeof(radio_stack_buffer),
-            PRIORITY_MAIN - 2, CREATE_STACKTEST,
+            THREAD_PRIORITY_MAIN - 2, CREATE_STACKTEST,
             radio, NULL, "radio");
     transceiver_register(TRANSCEIVER_NATIVE, radio_pid);
 #endif
diff --git a/tests/periph_uart_int/main.c b/tests/periph_uart_int/main.c
index 8e5015705b4d32eb3f4f555a1753fec4cf9b5243..3fb22cb86c220401c0b871395d86f29f28902ea2 100644
--- a/tests/periph_uart_int/main.c
+++ b/tests/periph_uart_int/main.c
@@ -47,7 +47,7 @@
 
 static volatile int main_pid;
 
-static char uart_stack[KERNEL_CONF_STACKSIZE_MAIN];
+static char uart_stack[THREAD_STACKSIZE_MAIN];
 
 static char rx_mem[128];
 static char tx_mem[128];
@@ -111,7 +111,7 @@ int main(void)
     }
 
     puts("Starting timer thread that triggers UART output...");
-    thread_create(uart_stack, KERNEL_CONF_STACKSIZE_MAIN, PRIORITY_MAIN - 1,
+    thread_create(uart_stack, THREAD_STACKSIZE_MAIN, THREAD_PRIORITY_MAIN - 1,
                   0, uart_thread, 0, "uart");
 
     while (1) {
diff --git a/tests/pipe/main.c b/tests/pipe/main.c
index 401e7f6ae9b4d369791ac274b0039e93ce158c4f..f1edc2a20d9a3659df887460d455a6e5102dcc6f 100644
--- a/tests/pipe/main.c
+++ b/tests/pipe/main.c
@@ -36,7 +36,7 @@
 
 #define BYTES_TOTAL (26)
 
-static char stacks[2][KERNEL_CONF_STACKSIZE_MAIN];
+static char stacks[2][THREAD_STACKSIZE_MAIN];
 
 static char pipe_bufs[2][6];
 static ringbuffer_t rbs[2];
@@ -101,10 +101,10 @@ int main(void)
     }
 
     thread_create(stacks[0], sizeof (stacks[0]),
-                  PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
+                  THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
                   run_middle, NULL, "middle");
     thread_create(stacks[1], sizeof (stacks[1]),
-                  PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
+                  THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD | CREATE_STACKTEST,
                   run_end, NULL, "end");
 
     unsigned total = 0;
diff --git a/tests/posix_semaphore/main.c b/tests/posix_semaphore/main.c
index 8e69777c9f47b8036d1de4dafcbb7a31fb9fcad6..c6258511a38585e987063515d8efa9bc93e6324f 100644
--- a/tests/posix_semaphore/main.c
+++ b/tests/posix_semaphore/main.c
@@ -26,8 +26,8 @@
 #include "semaphore.h"
 
 #define SEMAPHORE_TEST_THREADS 5
-char test1_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char test2_thread_stack[SEMAPHORE_TEST_THREADS][KERNEL_CONF_STACKSIZE_MAIN];
+char test1_thread_stack[THREAD_STACKSIZE_MAIN];
+char test2_thread_stack[SEMAPHORE_TEST_THREADS][THREAD_STACKSIZE_MAIN];
 
 sem_t s;
 
@@ -65,7 +65,7 @@ static void test1(void)
     puts("first: thread create");
     kernel_pid_t pid = thread_create(test1_thread_stack,
                                      sizeof(test1_thread_stack),
-                                     PRIORITY_MAIN - 1,
+                                     THREAD_PRIORITY_MAIN - 1,
                                      CREATE_STACKTEST | CREATE_WOUT_YIELD,
                                      test1_second_thread,
                                      NULL,
@@ -134,7 +134,7 @@ void test2(void)
     }
 
     for (int i = 0; i < SEMAPHORE_TEST_THREADS; i++) {
-        int priority = PRIORITY_MAIN - (i + 3) % 10 + 1;
+        int priority = THREAD_PRIORITY_MAIN - (i + 3) % 10 + 1;
 
         snprintf(names[i], sizeof(names[i]), "priority %d", priority);
         printf("first: thread create: %d\n", priority);
diff --git a/tests/pthread_condition_variable/main.c b/tests/pthread_condition_variable/main.c
index 29eceaec69ea4393042930942353c23c0c931da2..faa057afb12bd5926193140a8da3c993714d9acc 100644
--- a/tests/pthread_condition_variable/main.c
+++ b/tests/pthread_condition_variable/main.c
@@ -27,7 +27,7 @@ static struct pthread_cond_t cv;
 static volatile int is_finished;
 static volatile long count;
 static volatile long expected_value;
-static char stack[KERNEL_CONF_STACKSIZE_MAIN];
+static char stack[THREAD_STACKSIZE_MAIN];
 
 /**
  * @brief   This thread tries to lock the mutex to enter the critical section.
@@ -57,7 +57,7 @@ int main(void)
     expected_value = 1000*1000;
     pthread_cond_init(&cv, NULL);
 
-    kernel_pid_t pid = thread_create(stack,sizeof(stack), PRIORITY_MAIN - 1,
+    kernel_pid_t pid = thread_create(stack,sizeof(stack), THREAD_PRIORITY_MAIN - 1,
                                      CREATE_WOUT_YIELD | CREATE_STACKTEST,
                                      second_thread, NULL, "second_thread");
 
diff --git a/tests/pthread_rwlock/main.c b/tests/pthread_rwlock/main.c
index d96e1116d46455f4fdca4cc25ce97a3cc134b9c4..39045b9c67e10c8440048a1de868aaa9c9c8e0d4 100644
--- a/tests/pthread_rwlock/main.c
+++ b/tests/pthread_rwlock/main.c
@@ -97,7 +97,7 @@ static void *reader(void *arg)
 
 int main(void)
 {
-    static char stacks[NUM_CHILDREN][KERNEL_CONF_STACKSIZE_MAIN];
+    static char stacks[NUM_CHILDREN][THREAD_STACKSIZE_MAIN];
 
     puts("Main start.");
 
@@ -108,20 +108,20 @@ int main(void)
 
         if (i < NUM_READERS) {
             if (i < NUM_READERS_HIGH) {
-                prio = PRIORITY_MAIN + 1;
+                prio = THREAD_PRIORITY_MAIN + 1;
             }
             else {
-                prio = PRIORITY_MAIN + 2;
+                prio = THREAD_PRIORITY_MAIN + 2;
             }
             fun = reader;
             name = "reader";
         }
         else {
             if (i - NUM_READERS < NUM_WRITERS_HIGH) {
-                prio = PRIORITY_MAIN + 1;
+                prio = THREAD_PRIORITY_MAIN + 1;
             }
             else {
-                prio = PRIORITY_MAIN + 2;
+                prio = THREAD_PRIORITY_MAIN + 2;
             }
             fun = writer;
             name = "writer";
diff --git a/tests/sched_testing/main.c b/tests/sched_testing/main.c
index bd21d2a3b153f922b18059013897870723c1d643..3b8edf64c6d0399b75c40ab71556eb0e4a6cc047 100644
--- a/tests/sched_testing/main.c
+++ b/tests/sched_testing/main.c
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include "thread.h"
 
-char snd_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char snd_thread_stack[THREAD_STACKSIZE_MAIN];
 
 void *snd_thread(void *unused)
 {
@@ -33,7 +33,7 @@ int main(void)
     puts("The output should be: yield 1, snd_thread running, yield 2, done");
     puts("----------------------------------------------------------------");
 
-    thread_create(snd_thread_stack, sizeof(snd_thread_stack), PRIORITY_MAIN,
+    thread_create(snd_thread_stack, sizeof(snd_thread_stack), THREAD_PRIORITY_MAIN,
                   CREATE_WOUT_YIELD, snd_thread, NULL, "snd");
 
     puts("yield 1");
diff --git a/tests/thread_basic/main.c b/tests/thread_basic/main.c
index 819a54ea91daaa1332812b9ff16052c5e2dcf04c..a8fb8e3a72e6c6d51ef5a508a4e48c47f0c8e9d7 100644
--- a/tests/thread_basic/main.c
+++ b/tests/thread_basic/main.c
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include "thread.h"
 
-char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char t2_stack[THREAD_STACKSIZE_MAIN];
 
 void *second_thread(void *arg)
 {
@@ -34,7 +34,7 @@ int main(void)
 {
     (void) thread_create(
             t2_stack, sizeof(t2_stack),
-            PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
+            THREAD_PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
             second_thread, NULL, "nr2");
     puts("first thread\n");
     return 0;
diff --git a/tests/thread_cooperation/main.c b/tests/thread_cooperation/main.c
index e3bb35c0206ec9cfd4977fa1a5451f68638c2387..6ef2291c2a9a6f679c0ff1931afc4f0795974999 100644
--- a/tests/thread_cooperation/main.c
+++ b/tests/thread_cooperation/main.c
@@ -31,7 +31,7 @@ mutex_t mtx = MUTEX_INIT;
 volatile int storage = 1;
 kernel_pid_t main_id = KERNEL_PID_UNDEF;
 kernel_pid_t ths[PROBLEM];
-char stacks[PROBLEM][KERNEL_CONF_STACKSIZE_MAIN];
+char stacks[PROBLEM][THREAD_STACKSIZE_MAIN];
 
 void *run(void *arg)
 {
@@ -70,7 +70,7 @@ int main(void)
     for (int i = 0; i < PROBLEM; ++i) {
         printf("Creating thread with arg %d\n", (i + 1));
         ths[i] = thread_create(stacks[i], sizeof(stacks[i]),
-                               PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
+                               THREAD_PRIORITY_MAIN - 1, CREATE_WOUT_YIELD | CREATE_STACKTEST,
                                run, NULL, "thread");
 
         if (ths[i] < 0)  {
diff --git a/tests/thread_exit/main.c b/tests/thread_exit/main.c
index 925afd0e56a6f4d5a3e4383bcaa9d467b783b076..6d214b10c3d10c431028a4c02f2a1b8b275ad4cf 100644
--- a/tests/thread_exit/main.c
+++ b/tests/thread_exit/main.c
@@ -22,8 +22,8 @@
 
 #include "thread.h"
 
-char second_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char third_thread_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char second_thread_stack[THREAD_STACKSIZE_MAIN];
+char third_thread_stack[THREAD_STACKSIZE_MAIN];
 
 void *fourth_thread(void *arg)
 {
@@ -49,7 +49,7 @@ void *second_thread(void *arg)
     if ((thread_create(
              third_thread_stack,
              sizeof(third_thread_stack),
-             PRIORITY_MAIN - 2,
+             THREAD_PRIORITY_MAIN - 2,
              CREATE_STACKTEST,
              third_thread,
              NULL,
@@ -63,7 +63,7 @@ void *second_thread(void *arg)
     if ((thread_create(
              third_thread_stack,
              sizeof(third_thread_stack),
-             PRIORITY_MAIN - 1,
+             THREAD_PRIORITY_MAIN - 1,
              CREATE_WOUT_YIELD | CREATE_STACKTEST,
              fourth_thread,
              NULL,
@@ -83,7 +83,7 @@ int main(void)
     if ((thread_create(
              second_thread_stack,
              sizeof(second_thread_stack),
-             PRIORITY_MAIN - 1,
+             THREAD_PRIORITY_MAIN - 1,
              CREATE_WOUT_YIELD | CREATE_STACKTEST,
              second_thread,
              NULL,
diff --git a/tests/thread_msg/main.c b/tests/thread_msg/main.c
index a2aebdfceb67340122a0a0ed7280d84efc368fcf..6b85f2e638b75504e16523a9b478b46d1b92afc4 100644
--- a/tests/thread_msg/main.c
+++ b/tests/thread_msg/main.c
@@ -24,9 +24,9 @@
 #include "thread.h"
 #include "msg.h"
 
-char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char t3_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char t1_stack[THREAD_STACKSIZE_MAIN];
+char t2_stack[THREAD_STACKSIZE_MAIN];
+char t3_stack[THREAD_STACKSIZE_MAIN];
 
 kernel_pid_t p1, p2, p3;
 
@@ -83,13 +83,13 @@ void *thread3(void *arg)
 
 int main(void)
 {
-    p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
+    p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        thread1, NULL, "nr1");
-    p2 = thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN - 1,
+    p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        thread2, NULL, "nr2");
-    p3 = thread_create(t3_stack, sizeof(t3_stack), PRIORITY_MAIN - 1,
+    p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        thread3, NULL, "nr3");
     puts("THREADS CREATED\n");
diff --git a/tests/thread_msg_block_w_queue/main.c b/tests/thread_msg_block_w_queue/main.c
index 24df29838d18cf42e308f82dbc51f66f782cd641..f9a9545a3e5d6ef9134685be640da193d70e51b2 100644
--- a/tests/thread_msg_block_w_queue/main.c
+++ b/tests/thread_msg_block_w_queue/main.c
@@ -25,7 +25,7 @@
 #include "thread.h"
 #include "msg.h"
 
-char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char t1_stack[THREAD_STACKSIZE_MAIN];
 
 kernel_pid_t p1 = KERNEL_PID_UNDEF, p_main = KERNEL_PID_UNDEF;
 
@@ -59,7 +59,7 @@ int main(void)
     msg_t msg_q[1];
     msg_init_queue(msg_q, 1);
 
-    p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
+    p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        thread1, NULL, "nr1");
 
diff --git a/tests/thread_msg_block_wo_queue/main.c b/tests/thread_msg_block_wo_queue/main.c
index 1808f2edcd3fef31774399bfa7e30e9e819a3a45..0b0aed9e4648d3b1811f411e6167fb56dad90fd3 100644
--- a/tests/thread_msg_block_wo_queue/main.c
+++ b/tests/thread_msg_block_wo_queue/main.c
@@ -25,7 +25,7 @@
 #include "thread.h"
 #include "msg.h"
 
-char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char t1_stack[THREAD_STACKSIZE_MAIN];
 
 kernel_pid_t p1 = KERNEL_PID_UNDEF, p_main = KERNEL_PID_UNDEF;
 
@@ -56,7 +56,7 @@ int main(void)
     msg_t msg;
     p_main = sched_active_pid;
 
-    p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
+    p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        thread1, NULL, "nr1");
 
diff --git a/tests/thread_msg_seq/main.c b/tests/thread_msg_seq/main.c
index dee49b9b16c31d1fe254247efbbd97712efd3a75..4e430135c5d87a3e834fcf213f887193058dd6d7 100644
--- a/tests/thread_msg_seq/main.c
+++ b/tests/thread_msg_seq/main.c
@@ -25,9 +25,9 @@
 #include "thread.h"
 #include "msg.h"
 
-char t1_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char t2_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char t3_stack[KERNEL_CONF_STACKSIZE_MAIN];
+char t1_stack[THREAD_STACKSIZE_MAIN];
+char t2_stack[THREAD_STACKSIZE_MAIN];
+char t3_stack[THREAD_STACKSIZE_MAIN];
 
 kernel_pid_t p_main = KERNEL_PID_UNDEF, p1 = KERNEL_PID_UNDEF,
              p2 = KERNEL_PID_UNDEF, p3 = KERNEL_PID_UNDEF;
@@ -55,13 +55,13 @@ int main(void)
 
     p_main = sched_active_pid;
 
-    p1 = thread_create(t1_stack, sizeof(t1_stack), PRIORITY_MAIN - 1,
+    p1 = thread_create(t1_stack, sizeof(t1_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        sub_thread, "nr1", "nr1");
-    p2 = thread_create(t2_stack, sizeof(t2_stack), PRIORITY_MAIN - 1,
+    p2 = thread_create(t2_stack, sizeof(t2_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        sub_thread, "nr2", "nr2");
-    p3 = thread_create(t3_stack, sizeof(t3_stack), PRIORITY_MAIN - 1,
+    p3 = thread_create(t3_stack, sizeof(t3_stack), THREAD_PRIORITY_MAIN - 1,
                        CREATE_WOUT_YIELD | CREATE_STACKTEST,
                        sub_thread, "nr3", "nr3");
 
diff --git a/tests/unittests/tests-core/tests-core-ringbuffer.c b/tests/unittests/tests-core/tests-core-ringbuffer.c
index e20ade3de682f20897d52fd17c756cbbc542e504..694aa201574462b7d41ad6d12a8a8f589d08b880 100644
--- a/tests/unittests/tests-core/tests-core-ringbuffer.c
+++ b/tests/unittests/tests-core/tests-core-ringbuffer.c
@@ -28,7 +28,7 @@
 #define ITERATIONS 15
 #define BUF_SIZE 7
 
-static char stack_get[KERNEL_CONF_STACKSIZE_DEFAULT];
+static char stack_get[THREAD_STACKSIZE_DEFAULT];
 
 static char rb_buf[BUF_SIZE];
 static ringbuffer_t rb = RINGBUFFER_INIT(rb_buf);
@@ -110,7 +110,7 @@ static void tests_core_ringbuffer(void)
 {
     pid_add = sched_active_pid;
     pid_get = thread_create(stack_get, sizeof (stack_get),
-                            PRIORITY_MAIN, CREATE_SLEEPING | CREATE_STACKTEST,
+                            THREAD_PRIORITY_MAIN, CREATE_SLEEPING | CREATE_STACKTEST,
                             run_get, NULL, "get");
     run_add();
 }
diff --git a/tests/unittests/tests-ubjson/tests-ubjson.c b/tests/unittests/tests-ubjson/tests-ubjson.c
index 2e3ebb586565f123965df149beaf7403cc395a08..a3945985aed94988c0a8d7e9da358687ccb38fcc 100644
--- a/tests/unittests/tests-ubjson/tests-ubjson.c
+++ b/tests/unittests/tests-ubjson/tests-ubjson.c
@@ -29,7 +29,7 @@ static pipe_t communication_pipe;
 static ringbuffer_t pipe_rb;
 static char pipe_buffer[16];
 
-static char receiver_stack[KERNEL_CONF_STACKSIZE_DEFAULT];
+static char receiver_stack[THREAD_STACKSIZE_DEFAULT];
 
 typedef struct {
     void (*run)(void);
@@ -87,7 +87,7 @@ void test_ubjson_test(void (*sender_fun)(void), void (*receiver_fun)(void))
         },
     };
     kernel_pid_t receiver_pid = thread_create(receiver_stack, sizeof(receiver_stack),
-                                              PRIORITY_MAIN, CREATE_WOUT_YIELD,
+                                              THREAD_PRIORITY_MAIN, CREATE_WOUT_YIELD,
                                               test_ubjson_receiver_trampoline, &data, "receiver");
     TEST_ASSERT(pid_is_valid(receiver_pid));
 
diff --git a/tests/vtimer_msg/main.c b/tests/vtimer_msg/main.c
index 74a2e3fd2b3f14bb75e770438ab7dfc64e76e130..521e479fc8cee648a782c686f9c4369f6986e76f 100644
--- a/tests/vtimer_msg/main.c
+++ b/tests/vtimer_msg/main.c
@@ -26,8 +26,8 @@
 #include "thread.h"
 #include "msg.h"
 
-char timer_stack[KERNEL_CONF_STACKSIZE_MAIN];
-char timer_stack_local[KERNEL_CONF_STACKSIZE_MAIN];
+char timer_stack[THREAD_STACKSIZE_MAIN];
+char timer_stack_local[THREAD_STACKSIZE_MAIN];
 
 struct timer_msg {
     vtimer_t timer;
@@ -90,7 +90,7 @@ int main(void)
     kernel_pid_t pid = thread_create(
                   timer_stack,
                   sizeof(timer_stack),
-                  PRIORITY_MAIN - 1,
+                  THREAD_PRIORITY_MAIN - 1,
                   CREATE_STACKTEST,
                   timer_thread,
                   NULL,
@@ -107,7 +107,7 @@ int main(void)
     kernel_pid_t pid2 = thread_create(
                    timer_stack_local,
                    sizeof(timer_stack_local),
-                   PRIORITY_MAIN - 1,
+                   THREAD_PRIORITY_MAIN - 1,
                    CREATE_STACKTEST,
                    timer_thread_local,
                    NULL,
diff --git a/tests/vtimer_msg_diff/main.c b/tests/vtimer_msg_diff/main.c
index d64feb27b00c5dc1fc7b5516dcd9d3d51d3055d4..a2c6922119a72d25b26df02b6a54947e8c2b919f 100644
--- a/tests/vtimer_msg_diff/main.c
+++ b/tests/vtimer_msg_diff/main.c
@@ -31,7 +31,7 @@
 #define MAXCOUNT 100
 #define MAXDIFF 10000
 
-char timer_stack[KERNEL_CONF_STACKSIZE_MAIN*4];
+char timer_stack[THREAD_STACKSIZE_MAIN*4];
 
 struct timer_msg {
     vtimer_t timer;
@@ -104,7 +104,7 @@ int main(void)
     kernel_pid_t pid = thread_create(
                   timer_stack,
                   sizeof(timer_stack),
-                  PRIORITY_MAIN - 1,
+                  THREAD_PRIORITY_MAIN - 1,
                   CREATE_STACKTEST,
                   timer_thread,
                   NULL,