patch-2.3.16 linux/arch/ppc/kernel/prom.c

Next file: linux/arch/ppc/kernel/ptrace.c
Previous file: linux/arch/ppc/kernel/process.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.15/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
@@ -1,5 +1,5 @@
 /*
- * $Id: prom.c,v 1.62 1999/07/02 19:59:31 cort Exp $
+ * $Id: prom.c,v 1.70 1999/08/25 21:26:08 cort Exp $
  *
  * Procedures for interfacing to the Open Firmware PROM on
  * Power Macintosh computers.
@@ -16,6 +16,8 @@
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/version.h>
+
+#include <asm/init.h>
 #include <asm/spinlock.h>
 #include <asm/prom.h>
 #include <asm/page.h>
@@ -257,6 +259,9 @@
 	}
 }
 
+unsigned long smp_ibm_chrp_hack __initdata = 0;
+unsigned long smp_chrp_cpu_nr __initdata = 1;
+
 /*
  * We enter here early on, when the Open Firmware prom is still
  * handling exceptions and the MMU hash table for us.
@@ -266,7 +271,7 @@
 prom_init(int r3, int r4, prom_entry pp)
 {
 #ifdef CONFIG_SMP	
-	int cpu = 0, i;
+	int i;
 	phandle node;
 	char type[16], *path;
 #endif	
@@ -275,7 +280,7 @@
 	unsigned long offset = reloc_offset();
 	int l;
 	char *p, *d;
-	
+
 	/* check if we're apus, return if we are */
 	if ( r3 == 0x61707573 )
 		return;
@@ -524,17 +529,18 @@
 				    node, path, 255) < 0)
 			continue;
 		/* XXX: hack - don't start cpu 0, this cpu -- Cort */
-		if ( cpu++ == 0 )
+		if ( smp_chrp_cpu_nr++ == 0 )
 			continue;
+		RELOC(smp_ibm_chrp_hack) = 1;
 		prom_print(RELOC("starting cpu "));
 		prom_print(path);
 		*(unsigned long *)(0x4) = 0;
 		asm volatile("dcbf 0,%0": : "r" (0x4) : "memory");
-		call_prom(RELOC("start-cpu"), 3, 0, node, 8<<20, cpu-1);
+		call_prom(RELOC("start-cpu"), 3, 0, node, 8<<20, smp_chrp_cpu_nr-1);
 		for ( i = 0 ; (i < 10000) &&
 			      (*(ulong *)(0x4) == (ulong)0); i++ )
 			;
-		if (*(ulong *)(0x4) == (ulong)cpu-1 )
+		if (*(ulong *)(0x4) == (ulong)smp_chrp_cpu_nr-1 )
 			prom_print(RELOC("...ok\n"));
 		else
 			prom_print(RELOC("...failed\n"));
@@ -1296,8 +1302,6 @@
 }
 #endif
 
-spinlock_t rtas_lock = SPIN_LOCK_UNLOCKED;
-
 /* this can be called after setup -- Cort */
 __openfirmware
 int
@@ -1328,12 +1332,12 @@
 	for (i = 0; i < nargs; ++i)
 		u.words[i+3] = va_arg(list, unsigned long);
 	va_end(list);
+
+	save_flags(s);
+	cli();
 	
-	s = _disable_interrupts();
-	spin_lock(&rtas_lock);
 	enter_rtas((void *)__pa(&u));
-	spin_unlock(&rtas_lock);
-	_enable_interrupts(s);
+	restore_flags(s);
 	if (nret > 1 && outputs != NULL)
 		for (i = 0; i < nret-1; ++i)
 			outputs[i] = u.words[i+nargs+4];

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