Index: kernel/arch/ia64/src/smp/smp.c
===================================================================
--- kernel/arch/ia64/src/smp/smp.c	(revision 84d88376ce102d37d1c6ad926d1ca3b487993914)
+++ kernel/arch/ia64/src/smp/smp.c	(revision e5c1186d6bb5d82ffce0d76cda79942647f1536e)
@@ -33,130 +33,19 @@
  */
 
-#include <arch.h>
-#include <arch/drivers/ski.h>
-#include <arch/drivers/it.h>
-#include <arch/interrupt.h>
-#include <arch/barrier.h>
-#include <arch/asm.h>
-#include <arch/register.h>
-#include <typedefs.h>
-#include <arch/context.h>
-#include <arch/stack.h>
-#include <arch/mm/page.h>
-#include <mm/as.h>
-#include <config.h>
-#include <userspace.h>
-#include <console/console.h>
-#include <proc/uarg.h>
-#include <syscall/syscall.h>
-#include <ddi/irq.h>
-#include <ddi/device.h>
-#include <arch/bootinfo.h>
 #include <smp/smp.h>
 #include <smp/ipi.h>
-#include <arch/atomic.h>
-#include <panic.h>
-#include <print.h>
 
 #ifdef CONFIG_SMP
 
-extern char cpu_by_id_eid_list[256][256];
-
-static void sapic_init(void)
+void ipi_broadcast_arch(int ipi)
 {
-	bootinfo->sapic = (unative_t *)(PA2KA((unative_t)(bootinfo->sapic)) |
-	    FW_OFFSET);
-}
-
-static void ipi_broadcast_arch_all(int ipi)
-{
-	int id, eid;
-	int myid, myeid;
-	
-	myid = ia64_get_cpu_id();
-	myeid = ia64_get_cpu_eid();
-	
-	for (id = 0; id < 256; id++)
-		for (eid = 0; eid < 256; eid++)
-			if ((id != myid) || (eid != myeid))
-				ipi_send_ipi(id, eid, ipi);
-}
-
-void ipi_broadcast_arch(int ipi )
-{
-	int id, eid;
-	int myid, myeid;
-	
-	myid = ia64_get_cpu_id();
-	myeid = ia64_get_cpu_eid();
-
-	for (id = 0; id < 256; id++)
-		for (eid = 0; eid < 256; eid++)
-			if ((id != myid) || (eid != myeid))
-				if (cpu_by_id_eid_list[id][eid])
-					ipi_send_ipi(id, eid, ipi);
 }
 
 void smp_init(void)
 {
-	if (!bootinfo->hello_configured)
-		return; 
-	
-	/*
-	 * If we have not got system prepared by hello, we are not able to start
-	 * AP's. This means we are running on a simulator.
-	 */
-	
-	sapic_init();
-	ipi_broadcast_arch_all(bootinfo->wakeup_intno);	
-	volatile long long brk;
-        for (brk = 0; brk < 100LL * 1024LL * 1024LL; brk++)
-		;	/* wait a while before CPUs starts */
-
-	config.cpu_count = 0;
-	int id, eid;
-	
-	for (id = 0; id < 256; id++)
-		for (eid = 0; eid < 256; eid++)
-		        if (cpu_by_id_eid_list[id][eid] == 1) {
-		    		config.cpu_count++;
-		    		cpu_by_id_eid_list[id][eid] = 2;
-			}
 }
 
 void kmp(void *arg __attribute__((unused)))
 {
-	int id, eid;
-	int myid, myeid;
-	
-	myid = ia64_get_cpu_id();
-	myeid = ia64_get_cpu_eid();
-
-	for (id = 0; id < 256; id++)
-		for (eid = 0; eid < 256; eid++)
-		        if ((id != myid) || (eid != myeid))
-		        	if (cpu_by_id_eid_list[id][eid] != 0) {
-		    			if (cpu_by_id_eid_list[id][eid] == 1) {
-				    		printf("Found Late CPU ID:%d "
-						    "EDI:%d Not added to "
-						    "system!!!\n", id, eid);
-				    		continue;
-					}
-					cpu_by_id_eid_list[id][eid] = 3;
-					/*
-					 * There may be just one AP being
-					 * initialized at the time. After
-					 * it comes completely up, it is
-					 * supposed to wake us up.
-					 */
-					if (waitq_sleep_timeout(
-					    &ap_completion_wq, 1000000,
-					    SYNCH_FLAGS_NONE) ==
-					    ESYNCH_TIMEOUT) {
-						printf("%s: waiting for cpu "
-						    "ID:%d EID:%d timed out\n",
-						    __FUNCTION__, id, eid);
-					    }
-				}
 }
 
Index: kernel/arch/ia64/src/start.S
===================================================================
--- kernel/arch/ia64/src/start.S	(revision 84d88376ce102d37d1c6ad926d1ca3b487993914)
+++ kernel/arch/ia64/src/start.S	(revision e5c1186d6bb5d82ffce0d76cda79942647f1536e)
@@ -49,17 +49,4 @@
 kernel_image_start:
 	.auto
-	
-#ifdef CONFIG_SMP
-	# Identify self(CPU) in OS structures by ID / EID
-	
-	mov r9 = cr64
-	mov r10 = 1
-	movl r12 = 0xffffffff
-	movl r8 = cpu_by_id_eid_list
-	and r8 = r8, r12
-	shr r9 = r9, 16
-	add r8 = r8, r9
-	st1 [r8] = r10
-#endif
 	
 	mov psr.l = r0
@@ -164,13 +151,4 @@
 	bsw.1
 	
-#ifdef CONFIG_SMP
-	# Am I BSP or AP?
-	movl r20 = bsp_started ;;
-	ld8 r20 = [r20] ;;
-	cmp.eq p3, p2 = r20, r0 ;;
-#else
-	cmp.eq p3, p2 = r0, r0 ;;  /* you are BSP */
-#endif  /* CONFIG_SMP */
-	
 	# Initialize register stack
 	mov ar.rsc = r0
@@ -191,22 +169,10 @@
 	 * Initialize bootinfo on BSP.
 	 */
-(p3)	addl r21 = @gprel(bootinfo), gp ;;
-(p3)	st8 [r21] = r20
+	addl r21 = @gprel(bootinfo), gp ;;
+	st8 [r21] = r20
 	
 	ssm (1 << 19) ;; /* Disable f32 - f127 */
 	srlz.i
 	srlz.d ;;
-	
-#ifdef CONFIG_SMP
-(p2)	movl r18 = main_ap ;;
-(p2)	mov b1 = r18 ;;
-(p2)	br.call.sptk.many b0 = b1
-	
-	# Mark that BSP is on
-	
-	mov r20 = 1 ;;
-	movl r21 = bsp_started ;;
-	st8 [r21] = r20 ;;
-#endif
 	
 	br.call.sptk.many b0 = arch_pre_main
@@ -218,48 +184,2 @@
 0:
 	br 0b
-
-#ifdef CONFIG_SMP
-
-.align 4096
-kernel_image_ap_start:
-	.auto
-	
-	# Identify self(CPU) in OS structures by ID / EID
-	
-	mov r9 = cr64
-	mov r10 = 1
-	movl r12 = 0xffffffff
-	movl r8 = cpu_by_id_eid_list
-	and r8 = r8, r12
-	shr r9 = r9, 16
-	add r8 = r8, r9
-	st1 [r8] = r10
-	
-	# Wait for wakeup synchro signal (#3 in cpu_by_id_eid_list)
-
-kernel_image_ap_start_loop:
-	movl r11 = kernel_image_ap_start_loop
-	and r11 = r11, r12
-	mov b1 = r11
-	
-	ld1 r20 = [r8]
-	movl r21 = 3
-	cmp.eq p2, p3 = r20, r21
-(p3)	br.call.sptk.many b0 = b1
-	
-	movl r11 = kernel_image_start
-	and r11 = r11, r12
-	mov b1 = r11
-	br.call.sptk.many b0 = b1
-
-.align 16
-.global bsp_started
-bsp_started:
-	.space 8
-
-.align 4096
-.global cpu_by_id_eid_list
-cpu_by_id_eid_list:
-	.space 65536
-
-#endif  /* CONFIG_SMP */
