Index: uspace/lib/libc/arch/amd64/include/fibril.h
===================================================================
--- uspace/lib/libc/arch/amd64/include/fibril.h	(revision 62e1e1d7be8247f41f632d147bf155f2520e4c12)
+++ uspace/lib/libc/arch/amd64/include/fibril.h	(revision b2a5b41da250fa9fd11069ca9980d8f83e70c2a2)
@@ -44,4 +44,12 @@
 #define SP_DELTA     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); \
+		(c)->rbp = 0; \
+	} while (0)
+
 /* We include only registers that must be preserved
  * during function call
