Index: uspace/lib/c/arch/mips32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/mips32/include/fibril.h	(revision 34f044858b74931465b24f4e84135e8c487dcf70)
+++ uspace/lib/c/arch/mips32/include/fibril.h	(revision cc9f314036ef24a1cef853770eecbe2bd672138c)
@@ -38,20 +38,21 @@
 
 #include <sys/types.h>
+#include <libarch/stack.h>
+#include <align.h>
 
-/* We define our own context_set, because we need to set
- * the TLS pointer to the tcb+0x7000
+#define SP_DELTA  (ABI_STACK_FRAME + ALIGN_UP(STACK_ITEM_SIZE, STACK_ALIGNMENT))
+
+/*
+ * We define our own context_set, because we need to set
+ * the TLS pointer to the tcb + 0x7000
  *
  * See tls_set in thread.h
  */
-#define context_set(c, _pc, stack, size, ptls) 			\
-	(c)->pc = (sysarg_t) (_pc);				\
-	(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; 	\
-        (c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t);
-
-
-/* +16 is just for sure that the called function
- * have space to store it's arguments
- */
-#define SP_DELTA	(8+16)
+#define context_set(c, _pc, stack, size, ptls) \
+	do { \
+		(c)->pc = (sysarg_t) (_pc); \
+		(c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
+		(c)->tls = ((sysarg_t)(ptls)) + 0x7000 + sizeof(tcb_t); \
+	} while (0)
 
 typedef struct  {
Index: uspace/lib/c/arch/mips32/include/stack.h
===================================================================
--- uspace/lib/c/arch/mips32/include/stack.h	(revision cc9f314036ef24a1cef853770eecbe2bd672138c)
+++ uspace/lib/c/arch/mips32/include/stack.h	(revision cc9f314036ef24a1cef853770eecbe2bd672138c)
@@ -0,0 +1,1 @@
+../../../../../../kernel/arch/mips32/include/stack.h
