patch-2.3.34 linux/arch/ppc/kernel/open_pic.c

Next file: linux/arch/ppc/kernel/open_pic.h
Previous file: linux/arch/ppc/kernel/gemini_setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.33/linux/arch/ppc/kernel/open_pic.c linux/arch/ppc/kernel/open_pic.c
@@ -64,14 +64,13 @@
     if (pri < 0 || pri >= OPENPIC_NUM_PRI) \
 	printk("openpic.c:%d: illegal priority %d\n", __LINE__, pri);
 /*
- * Turned this check off since the IPI's are treated as irqs
- * but they're above NumSources -- Cort
- */
-#define check_arg_irq(irq)
-#if 0
-    if (irq < 0 || irq >= (NumSources+open_pic.irq_offset)) \
-	printk("openpic.c:%d: illegal irq %d\n", __LINE__, irq);
-#endif
+ * I changed this to return to keep us from from trying to use irq #'s
+ * that we're using for IPI's.
+ *   -- Cort
+ */ 
+#define check_arg_irq(irq) \
+    /*if (irq < 0 || irq >= (NumSources+open_pic.irq_offset)) \
+      printk("openpic.c:%d: illegal irq %d\n", __LINE__, irq);*/
 #define check_arg_cpu(cpu) \
     if (cpu < 0 || cpu >= NumProcessors) \
 	printk("openpic.c:%d: illegal cpu %d\n", __LINE__, cpu);
@@ -91,8 +90,7 @@
 #ifdef __SMP__
 void openpic_ipi_action(int cpl, void *dev_id, struct pt_regs *regs)
 {
-printk("openpic_ipi_action\n");	
-	smp_message_recv();
+	smp_message_recv(cpl-OPENPIC_VEC_IPI);
 }
 #endif /* __SMP__ */
 
@@ -213,6 +211,9 @@
 	    
 		/* Initialize external interrupts */
 		if ( ppc_md.progress ) ppc_md.progress("openpic ext",0x3bc);
+		/* SIOint (8259 cascade) is special */
+		openpic_initirq(0, 8, open_pic.irq_offset, 1, 1);
+		openpic_mapirq(0, 1<<0);
 		for (i = 1; i < NumSources; i++) {
 			/* Enabled, Priority 8 */
 			openpic_initirq(i, 8, open_pic.irq_offset+i, 0,
@@ -226,9 +227,6 @@
 		openpic_set_spurious(OPENPIC_VEC_SPURIOUS);
 		if ( _machine != _MACH_gemini )
 		{
-			/* SIOint (8259 cascade) is special */
-			openpic_initirq(0, 8, open_pic.irq_offset, 1, 1);
-			openpic_mapirq(0, 1<<0);
 			if (request_irq(IRQ_8259_CASCADE, no_action, SA_INTERRUPT,
 					"82c59 cascade", NULL))
 				printk("Unable to get OpenPIC IRQ 0 for cascade\n");
@@ -363,6 +361,27 @@
 	check_arg_ipi(ipi);
 	openpic_clearfield(&OpenPIC->Global.IPI_Vector_Priority(ipi),
 			   OPENPIC_MASK);
+}
+
+/*
+ * Do per-cpu setup for SMP systems.
+ *
+ * Get IPI's working and start taking interrupts.
+ *   -- Cort
+  */
+void do_openpic_setup_cpu(void)
+{
+ 	int i;
+ 	
+ 	for ( i = 0; i < OPENPIC_NUM_IPI ; i++ )
+		openpic_enable_IPI(i);
+#if 0	
+ 	/* let the openpic know we want intrs */
+ 	for ( i = 0; i < NumSources ; i++ )
+ 		openpic_mapirq(i, openpic_read(&OpenPIC->Source[i].Destination)
+ 			       | (1<<smp_processor_id()) );
+#endif	
+ 	openpic_set_priority(smp_processor_id(), 0);
 }
 
 /*

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