patch-2.1.97 linux/arch/sparc/prom/misc.c

Next file: linux/arch/sparc/prom/mp.c
Previous file: linux/arch/sparc/prom/memory.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.96/linux/arch/sparc/prom/misc.c linux/arch/sparc/prom/misc.c
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.15 1997/05/14 20:45:00 davem Exp $
+/* $Id: misc.c,v 1.16 1998/03/09 14:04:25 jj Exp $
  * misc.c:  Miscellaneous prom functions that don't belong
  *          anywhere else.
  *
@@ -13,8 +13,7 @@
 #include <asm/oplib.h>
 #include <asm/auxio.h>
 
-/* XXX Let's get rid of this thing if we can... */
-extern struct task_struct *current_set[NR_CPUS];
+extern void restore_current(void);
 
 /* Reset and reboot the machine with the command 'bcommand'. */
 void
@@ -24,9 +23,7 @@
 	save_flags(flags); cli();
 	(*(romvec->pv_reboot))(bcommand);
 	/* Never get here. */
-	__asm__ __volatile__("ld [%0], %%g6\n\t" : :
-			     "r" (&current_set[hard_smp_processor_id()]) :
-			     "memory");
+	restore_current();
 	restore_flags(flags);
 }
 
@@ -42,9 +39,7 @@
 		(*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
 	else
 		(*(romvec->pv_fortheval.v2_eval))(fstring);
-	__asm__ __volatile__("ld [%0], %%g6\n\t" : :
-			     "r" (&current_set[hard_smp_processor_id()]) :
-			     "memory");
+	restore_current();
 	restore_flags(flags);
 }
 
@@ -74,9 +69,7 @@
 	install_obp_ticker();
 	save_flags(flags); cli();
 	(*(romvec->pv_abort))();
-	__asm__ __volatile__("ld [%0], %%g6\n\t" : :
-			     "r" (&current_set[hard_smp_processor_id()]) :
-			     "memory");
+	restore_current();
 	restore_flags(flags);
 	install_linux_ticker();
 #ifdef CONFIG_SUN_AUXIO
@@ -99,9 +92,7 @@
 	save_flags(flags); cli();
 	(*(romvec->pv_halt))();
 	/* Never get here. */
-	__asm__ __volatile__("ld [%0], %%g6\n\t" : :
-			     "r" (&current_set[hard_smp_processor_id()]) :
-			     "memory");
+	restore_current();
 	restore_flags(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, slshen@lbl.gov