Index: uspace/lib/c/arch/mips64/include/fibril.h
===================================================================
--- uspace/lib/c/arch/mips64/include/fibril.h	(revision 2429e4a21037762ab4104bb2ea7d71156b2fbf0d)
+++ uspace/lib/c/arch/mips64/include/fibril.h	(revision caed027931c2afd3c2fedd0e4fd54a69019734be)
@@ -38,19 +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)
+	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 {
