Index: arch/ia32/include/asm.h
===================================================================
--- arch/ia32/include/asm.h	(revision 3526da33e4658f241dd3248ee12d087085910c92)
+++ arch/ia32/include/asm.h	(revision fde642915e1f68d137df99e51a40e19c02838fed)
@@ -35,4 +35,5 @@
 #include <synch/spinlock.h>
 #include <arch/boot/memmap.h>
+#include <config.h>
 
 extern __u32 interrupt_handler_size;
@@ -157,3 +158,17 @@
 }
 
+/** Return base address of current stack
+ *
+ * Return the base address of the current stack.
+ * The stack is assumed to be STACK_SIZE bytes long.
+ */
+static inline __address get_stack_base(void)
+{
+	__address v;
+	
+	__asm__ volatile ("andl %%esp, %0\n" : "=r" (v) : "0" (~(STACK_SIZE-1)));
+	
+	return v;
+}
+
 #endif
