Index: kernel/arch/ia32/src/smp/ap.S
===================================================================
--- kernel/arch/ia32/src/smp/ap.S	(revision 57c2a87b03a0b6c08cef4f64f0cf52a7d8b38b62)
+++ kernel/arch/ia32/src/smp/ap.S	(revision 4928165de7cf0ac048c2faf57cbe0209de03919c)
@@ -38,4 +38,5 @@
 #include <arch/pm.h>
 #include <arch/cpu.h>
+#include <arch/context_struct.h>
 
 .section K_TEXT_START, "ax"
@@ -74,7 +75,7 @@
 	movw %ax, %es
 	movw %ax, %ss
-	movl $KA2PA(ctx), %eax  /* KA2PA((uintptr_t) &ctx) */
-	movl (%eax), %esp
-	subl $0x80000000, %esp  /* KA2PA(ctx.sp) */
+	movl $KA2PA(ctx), %eax	/* KA2PA((uintptr_t) &ctx) */
+	movl CONTEXT_OFFSET_SP(%eax), %esp
+	subl $PA2KA(0), %esp	/* KA2PA(ctx.sp) */
 
 	/*
@@ -84,5 +85,5 @@
 	call map_kernel_pse
 	
-	addl $0x80000000, %esp  /*  PA2KA(ctx.sp) */
+	addl $PA2KA(0), %esp	/* PA2KA(ctx.sp) */
 	
 	/* create the first stack frame */
