patch-2.2.8 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.2.7/linux/arch/ppc/kernel/prom.c linux/arch/ppc/kernel/prom.c
@@ -1,5 +1,5 @@
 /*
- * $Id: prom.c,v 1.50 1999/03/16 10:40:34 cort Exp $
+ * $Id: prom.c,v 1.54 1999/05/10 04:43:46 cort Exp $
  *
  * Procedures for interfacing to the Open Firmware PROM on
  * Power Macintosh computers.
@@ -16,6 +16,7 @@
 #include <linux/string.h>
 #include <linux/init.h>
 #include <linux/version.h>
+#include <asm/spinlock.h>
 #include <asm/prom.h>
 #include <asm/page.h>
 #include <asm/processor.h>
@@ -263,9 +264,11 @@
 void
 prom_init(int r3, int r4, prom_entry pp)
 {
+#ifdef CONFIG_SMP	
 	int cpu = 0, i;
 	phandle node;
 	char type[16], *path;
+#endif	
 	unsigned long mem;
 	ihandle prom_rtas;
 	unsigned long offset = reloc_offset();
@@ -454,7 +457,7 @@
 	 * a holding pattern controlled by the kernel (not OF) before
 	 * we destroy the OF.
 	 *
-	 * This used a chunk of high memory, puts some holding pattern
+	 * This uses a chunk of high memory, puts some holding pattern
 	 * code there and sends the other processors off to there until
 	 * smp_boot_cpus tells them to do something.  We do that by using
 	 * physical address 0x0.  The holding pattern checks that address
@@ -1141,7 +1144,7 @@
 	if (cp == NULL)
 		return 0;
 	while (cplen > 0) {
-		if (strcasecmp(cp, compat) == 0)
+		if (strncasecmp(cp, compat, strlen(compat)) == 0)
 			return 1;
 		l = strlen(cp) + 1;
 		cp += l;
@@ -1277,6 +1280,8 @@
 }
 #endif
 
+spinlock_t rtas_lock = SPIN_LOCK_UNLOCKED;
+
 /* this can be called after setup -- Cort */
 __openfirmware
 int
@@ -1307,7 +1312,9 @@
 	for (i = 0; i < nargs; ++i)
 		u.words[i+3] = va_arg(list, unsigned long);
 	va_end(list);
+	spin_lock(&rtas_lock);
 	enter_rtas((void *)__pa(&u));
+	spin_unlock(&rtas_lock);
 	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)