Index: arch/ia32/src/smp/ap.S
===================================================================
--- arch/ia32/src/smp/ap.S	(revision 5f85c910c3b85368172260d2de0f5da623a4742b)
+++ arch/ia32/src/smp/ap.S	(revision 42edee68a13aac5a6de6c8e953f681abf64096ff)
@@ -1,4 +1,5 @@
 #
 # Copyright (C) 2001-2004 Jakub Jermar
+# Copyright (C) 2005-2006 Martin Decky
 # All rights reserved.
 #
@@ -31,9 +32,14 @@
 #
 
-.section K_TEXT_START_2, "ax"
+#include <arch/boot/boot.h>
+#include <arch/boot/memmap.h>
+#include <arch/mm/page.h>
+#include <arch/pm.h>
+
+.section K_TEXT_START, "ax"
 
 #ifdef CONFIG_SMP
 
-.global ap_boot
+.global unmapped_ap_boot
 
 KTEXT=8
@@ -45,5 +51,5 @@
 
 .align 4096
-ap_boot:
+unmapped_ap_boot:
 .code16
 	cli
@@ -51,10 +57,10 @@
 	movw %ax, %ds
 
-	lgdt real_bootstrap_gdtr_boot	# initialize Global Descriptor Table register
+	lgdt ap_gdtr		# initialize Global Descriptor Table register
 	
 	movl %cr0, %eax
 	orl $1, %eax
 	movl %eax, %cr0				# switch to protected mode
-	jmpl $KTEXT, $jump_to_kernel
+	jmpl $KTEXT, $jump_to_kernel - BOOT_OFFSET + AP_BOOT_OFFSET
 	
 jump_to_kernel:
@@ -64,5 +70,5 @@
 	movw %ax, %es
 	movw %ax, %ss
-	movl $(ctx-0x80000000), %eax	# KA2PA((__address) &ctx)
+	movl $KA2PA(ctx), %eax			# KA2PA((__address) &ctx)
 	movl (%eax), %esp
 	subl $0x80000000, %esp			# KA2PA(ctx.sp)
@@ -75,2 +81,15 @@
 
 #endif /* CONFIG_SMP */
+
+
+.section K_DATA_START, "ax"
+
+#ifdef CONFIG_SMP
+
+.global unmapped_ap_gdtr
+
+unmapped_ap_gdtr:
+	.word 0
+	.long 0
+
+#endif /* CONFIG_SMP */
