patch-2.4.0-test8 linux/arch/sparc/prom/console.c

Next file: linux/arch/sparc/prom/devmap.c
Previous file: linux/arch/sparc/mm/sun4c.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test7/linux/arch/sparc/prom/console.c linux/arch/sparc/prom/console.c
@@ -1,4 +1,4 @@
-/* $Id: console.c,v 1.22 2000/02/08 20:24:23 davem Exp $
+/* $Id: console.c,v 1.23 2000/08/26 02:38:03 anton Exp $
  * console.c: Routines that deal with sending and receiving IO
  *            to/from the current console device using the PROM.
  *
@@ -30,7 +30,7 @@
 	int i = -1;
 	unsigned long flags;
 
-	save_flags(flags); cli();
+	spin_lock_irqsave(&prom_lock, flags);
 	switch(prom_vers) {
 	case PROM_V0:
 	case PROM_SUN4:
@@ -49,7 +49,7 @@
 		break;
 	};
 	restore_current();
-	restore_flags(flags);
+	spin_unlock_irqrestore(&prom_lock, flags);
 	return i; /* Ugh, we could spin forever on unsupported proms ;( */
 }
 
@@ -63,7 +63,7 @@
 	unsigned long flags;
 	int i = -1;
 
-	save_flags(flags); cli();
+	spin_lock_irqsave(&prom_lock, flags);
 	switch(prom_vers) {
 	case PROM_V0:
 	case PROM_SUN4:
@@ -82,7 +82,7 @@
 		break;
 	};
 	restore_current();
-	restore_flags(flags);
+	spin_unlock_irqrestore(&prom_lock, flags);
 	return i; /* Ugh, we could spin forever on unsupported proms ;( */
 }
 
@@ -125,10 +125,10 @@
 			return PROMDEV_I_UNK;
 		};
 	case PROM_V3:
-		save_flags(flags); cli();
+		spin_lock_irqsave(&prom_lock, flags);
 		st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdin);
 		restore_current();
-		restore_flags(flags);
+		spin_unlock_irqrestore(&prom_lock, flags);
 		if(prom_node_has_property(st_p, "keyboard"))
 			return PROMDEV_IKBD;
 		if (prom_getproperty(st_p, "name", propb, sizeof(propb)) != -1) {
@@ -174,10 +174,10 @@
 		break;
 	case PROM_V2:
 	case PROM_V3:
-		save_flags(flags); cli();
+		spin_lock_irqsave(&prom_lock, flags);
 		st_p = (*romvec->pv_v2devops.v2_inst2pkg)(*romvec->pv_v2bootargs.fd_stdout);
 		restore_current();
-		restore_flags(flags);
+		spin_unlock_irqrestore(&prom_lock, flags);
 		propl = prom_getproperty(st_p, "device_type", propb, sizeof(propb));
 		if (propl >= 0 && propl == sizeof("display") &&
 			strncmp("display", propb, sizeof("display")) == 0)

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