Index: uspace/lib/c/arch/abs32le/include/fibril.h
===================================================================
--- uspace/lib/c/arch/abs32le/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/abs32le/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -44,4 +44,5 @@
 		(ctx)->pc = (uintptr_t) (_pc); \
 		(ctx)->sp = ((uintptr_t) (stack)) + (size) - SP_DELTA; \
+		(ctx)->fp = 0; \
 		(ctx)->tls = ((uintptr_t) (ptls)) + sizeof(tcb_t); \
 	} while (0)
@@ -53,7 +54,14 @@
 typedef struct {
 	uintptr_t sp;
+	uintptr_t fp;
 	uintptr_t pc;
 	uintptr_t tls;
 } context_t;
+
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	/* On real hardware, this function returns the frame pointer. */
+	return ctx->fp;
+}
 
 #endif
Index: uspace/lib/c/arch/amd64/include/fibril.h
===================================================================
--- uspace/lib/c/arch/amd64/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/amd64/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -56,17 +56,22 @@
  */
 typedef struct {
-    uint64_t sp;
-    uint64_t pc;
-    
-    uint64_t rbx;
-    uint64_t rbp;
+	uint64_t sp;
+	uint64_t pc;
 
-    uint64_t r12;
-    uint64_t r13;
-    uint64_t r14;
-    uint64_t r15;
+	uint64_t rbx;
+	uint64_t rbp;
 
-    uint64_t tls;
+	uint64_t r12;
+	uint64_t r13;
+	uint64_t r14;
+	uint64_t r15;
+
+	uint64_t tls;
 } context_t;
+
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->rbp;
+}
 
 #endif
Index: uspace/lib/c/arch/arm32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/arm32/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/arm32/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -86,4 +86,9 @@
 } context_t;
 
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->fp;
+}
+
 
 #endif
Index: uspace/lib/c/arch/ia32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/ia32/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/ia32/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -67,4 +67,9 @@
 } context_t;
 
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->ebp;
+}
+
 #endif
 
Index: uspace/lib/c/arch/ia64/include/fibril.h
===================================================================
--- uspace/lib/c/arch/ia64/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/ia64/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -130,4 +130,9 @@
 } context_t;
 
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return 0;	/* FIXME */
+}
+
 #endif
 
Index: uspace/lib/c/arch/mips32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/mips32/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/mips32/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -85,4 +85,9 @@
 } context_t;
 
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->sp;
+}
+
 #endif
 
Index: uspace/lib/c/arch/ppc32/include/fibril.h
===================================================================
--- uspace/lib/c/arch/ppc32/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/ppc32/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -78,4 +78,9 @@
 } __attribute__ ((packed)) context_t;
 
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->sp;
+}
+
 #endif
 
Index: uspace/lib/c/arch/sparc64/include/fibril.h
===================================================================
--- uspace/lib/c/arch/sparc64/include/fibril.h	(revision fc14438a8dd4f64269a9db0d8db45f35450495dd)
+++ uspace/lib/c/arch/sparc64/include/fibril.h	(revision 619e2a6b051656e9460cd8c15ac666c11e3a6f08)
@@ -77,4 +77,9 @@
 } context_t;
 
+static inline uintptr_t context_get_fp(context_t *ctx)
+{
+	return ctx->sp + STACK_BIAS;
+}
+
 #endif
 
