patch-2.4.0-test8 linux/arch/sparc/prom/misc.c
Next file: linux/arch/sparc/prom/mp.c
Previous file: linux/arch/sparc/prom/devops.c
Back to the patch index
Back to the overall index
- Lines: 70
- Date:
Mon Aug 28 21:20:03 2000
- Orig file:
v2.4.0-test7/linux/arch/sparc/prom/misc.c
- Orig date:
Tue Aug 4 16:03:35 1998
diff -u --recursive --new-file v2.4.0-test7/linux/arch/sparc/prom/misc.c linux/arch/sparc/prom/misc.c
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.17 1998/07/21 10:36:22 jj Exp $
+/* $Id: misc.c,v 1.18 2000/08/26 02:38:03 anton Exp $
* misc.c: Miscellaneous prom functions that don't belong
* anywhere else.
*
@@ -15,16 +15,18 @@
extern void restore_current(void);
+spinlock_t prom_lock = SPIN_LOCK_UNLOCKED;
+
/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
{
unsigned long flags;
- save_flags(flags); cli();
+ spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_reboot))(bcommand);
/* Never get here. */
restore_current();
- restore_flags(flags);
+ spin_unlock_irqrestore(&prom_lock, flags);
}
/* Forth evaluate the expression contained in 'fstring'. */
@@ -34,13 +36,13 @@
unsigned long flags;
if(!fstring || fstring[0] == 0)
return;
- save_flags(flags); cli();
+ spin_lock_irqsave(&prom_lock, flags);
if(prom_vers == PROM_V0)
(*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
else
(*(romvec->pv_fortheval.v2_eval))(fstring);
restore_current();
- restore_flags(flags);
+ spin_unlock_irqrestore(&prom_lock, flags);
}
/* We want to do this more nicely some day. */
@@ -66,10 +68,10 @@
prom_palette (1);
#endif
install_obp_ticker();
- save_flags(flags); cli();
+ spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_abort))();
restore_current();
- restore_flags(flags);
+ spin_unlock_irqrestore(&prom_lock, flags);
install_linux_ticker();
#ifdef CONFIG_SUN_AUXIO
TURN_ON_LED;
@@ -88,11 +90,11 @@
{
unsigned long flags;
again:
- save_flags(flags); cli();
+ spin_lock_irqsave(&prom_lock, flags);
(*(romvec->pv_halt))();
/* Never get here. */
restore_current();
- restore_flags(flags);
+ spin_unlock_irqrestore(&prom_lock, flags);
goto again; /* PROM is out to get me -DaveM */
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)