patch-2.4.0-test2 linux/arch/ppc/kernel/smp.c
Next file: linux/arch/ppc/kernel/time.c
Previous file: linux/arch/ppc/kernel/signal.c
Back to the patch index
Back to the overall index
- Lines: 89
- Date:
Mon Jun 19 17:59:36 2000
- Orig file:
v2.4.0-test1/linux/arch/ppc/kernel/smp.c
- Orig date:
Sat Feb 26 22:31:42 2000
diff -u --recursive --new-file v2.4.0-test1/linux/arch/ppc/kernel/smp.c linux/arch/ppc/kernel/smp.c
@@ -53,6 +53,9 @@
unsigned int prof_counter[NR_CPUS];
cycles_t cacheflush_time;
+/* this has to go in the data section because it is accessed from prom_init */
+int smp_hw_index[NR_CPUS] = {0};
+
/* all cpu mappings are 1-1 -- Cort */
volatile unsigned long cpu_callin_map[NR_CPUS] = {0,};
@@ -238,6 +241,7 @@
case _MACH_chrp:
case _MACH_prep:
case _MACH_gemini:
+#ifndef CONFIG_POWER4
/* make sure we're sending something that translates to an IPI */
if ( msg > 0x3 )
break;
@@ -254,6 +258,18 @@
openpic_cause_IPI(smp_processor_id(), msg, 1<<target);
break;
}
+#else /* CONFIG_POWER4 */
+ /* for now, only do reschedule messages
+ since we only have one IPI */
+ if (msg != MSG_RESCHEDULE)
+ break;
+ for (i = 0; i < smp_num_cpus; ++i) {
+ if (target == MSG_ALL || target == i
+ || (target == MSG_ALL_BUT_SELF
+ && i != smp_processor_id()))
+ xics_cause_IPI(i);
+ }
+#endif /* CONFIG_POWER4 */
break;
}
}
@@ -306,8 +322,9 @@
cpu_nr = 2;
break;
case _MACH_chrp:
- for ( i = 0; i < 4 ; i++ )
- openpic_enable_IPI(i);
+ if (OpenPIC)
+ for ( i = 0; i < 4 ; i++ )
+ openpic_enable_IPI(i);
cpu_nr = smp_chrp_cpu_nr;
break;
case _MACH_gemini:
@@ -390,10 +407,10 @@
printk("Processor %d is stuck.\n", i);
}
}
-
- if ( _machine & (_MACH_gemini|_MACH_chrp|_MACH_prep) )
+
+ if (OpenPIC && (_machine & (_MACH_gemini|_MACH_chrp|_MACH_prep)))
do_openpic_setup_cpu();
-
+
if ( _machine == _MACH_Pmac )
{
/* reset the entry point so if we get another intr we won't
@@ -433,19 +450,19 @@
set_dec(decrementer_count);
init_idle();
-#if 0
- current->mm->mmap->vm_page_prot = PAGE_SHARED;
- current->mm->mmap->vm_start = PAGE_OFFSET;
- current->mm->mmap->vm_end = init_mm.mmap->vm_end;
-#endif
cpu_callin_map[current->processor] = 1;
+
+#ifndef CONFIG_POWER4
/*
* Each processor has to do this and this is the best
* place to stick it for now.
* -- Cort
*/
- if ( _machine & (_MACH_gemini|_MACH_chrp|_MACH_prep) )
+ if (OpenPIC && _machine & (_MACH_gemini|_MACH_chrp|_MACH_prep))
do_openpic_setup_cpu();
+#else
+ xics_setup_cpu();
+#endif /* CONFIG_POWER4 */
#ifdef CONFIG_GEMINI
if ( _machine == _MACH_gemini )
gemini_init_l2();
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)