patch-2.4.23 linux-2.4.23/arch/ia64/kernel/smpboot.c

Next file: linux-2.4.23/arch/ia64/kernel/traps.c
Previous file: linux-2.4.23/arch/ia64/kernel/signal.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.22/arch/ia64/kernel/smpboot.c linux-2.4.23/arch/ia64/kernel/smpboot.c
@@ -320,6 +320,7 @@
 {
 	int cpuid, phys_id;
 	extern void ia64_init_itm(void);
+	extern void ia64_cpu_local_tick(void);
 
 #ifdef CONFIG_PERFMON
 	extern void pfm_init_percpu(void);
@@ -576,7 +577,7 @@
 	/* Tell SAL where to drop the AP's.  */
 	ap_startup = (struct fptr *) start_ap;
 	sal_ret = ia64_sal_set_vectors(SAL_VECTOR_OS_BOOT_RENDEZ,
-				       __pa(ap_startup->fp), __pa(ap_startup->gp), 0, 0, 0, 0);
+				      ia64_tpa(ap_startup->fp), ia64_tpa(ap_startup->gp), 0, 0, 0, 0);
 	if (sal_ret < 0) {
 		printk(KERN_ERR "SMP: Can't set SAL AP Boot Rendezvous: %s\n     Forcing UP mode\n",
 		       ia64_sal_strerror(sal_ret));
@@ -584,3 +585,27 @@
 		smp_num_cpus = 1;
 	}
 }
+
+/*
+ * Initialize the logical CPU number to SAPICID mapping
+ */
+void __init
+smp_build_cpu_map (void)
+{
+	int sapicid, cpu, i;
+	int boot_cpu_id = hard_smp_processor_id();
+
+	for (cpu = 0; cpu < NR_CPUS; cpu++)
+		ia64_cpu_to_sapicid[cpu] = -1;
+
+	ia64_cpu_to_sapicid[0] = boot_cpu_id;
+
+	for (cpu = 1, i = 0; i < smp_boot_data.cpu_count; i++) {
+		sapicid = smp_boot_data.cpu_phys_id[i];
+		if (sapicid == boot_cpu_id)
+			continue;
+		ia64_cpu_to_sapicid[cpu] = sapicid;
+		cpu++;
+	}
+}
+

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)