patch-2.1.9 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
- Lines: 140
- Date:
Sat Nov 9 10:12:27 1996
- Orig file:
v2.1.8/linux/arch/sparc/prom/misc.c
- Orig date:
Sun Apr 21 12:30:32 1996
diff -u --recursive --new-file v2.1.8/linux/arch/sparc/prom/misc.c linux/arch/sparc/prom/misc.c
@@ -1,4 +1,4 @@
-/* $Id: misc.c,v 1.8 1996/04/17 23:03:23 davem Exp $
+/* $Id: misc.c,v 1.11 1996/10/12 13:12:58 davem Exp $
* misc.c: Miscellaneous prom functions that don't belong
* anywhere else.
*
@@ -6,32 +6,47 @@
*/
#include <linux/config.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/sched.h>
#include <asm/openprom.h>
#include <asm/oplib.h>
+#include <asm/auxio.h>
/* Reset and reboot the machine with the command 'bcommand'. */
void
prom_reboot(char *bcommand)
{
+ unsigned long flags;
+ save_flags(flags); cli();
(*(romvec->pv_reboot))(bcommand);
/* Never get here. */
- return;
+ __asm__ __volatile__("ld [%0], %%g6\n\t" : :
+ "r" (¤t_set[smp_processor_id()]) :
+ "memory");
+ restore_flags(flags);
}
/* Forth evaluate the expression contained in 'fstring'. */
void
prom_feval(char *fstring)
{
- if(!fstring || fstring[0] == 0) return;
+ unsigned long flags;
+ if(!fstring || fstring[0] == 0)
+ return;
+ save_flags(flags); cli();
if(prom_vers == PROM_V0)
(*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
else
(*(romvec->pv_fortheval.v2_eval))(fstring);
- return;
+ __asm__ __volatile__("ld [%0], %%g6\n\t" : :
+ "r" (¤t_set[smp_processor_id()]) :
+ "memory");
+ restore_flags(flags);
}
/* We want to do this more nicely some day. */
-#if CONFIG_SUN_CONSOLE
+#ifdef CONFIG_SUN_CONSOLE
extern void console_restore_palette(void);
extern void set_palette(void);
extern int serial_console;
@@ -41,36 +56,49 @@
* prom command.
*/
void
-prom_halt(void)
+prom_cmdline(void)
{
extern void kernel_enter_debugger(void);
extern void install_obp_ticker(void);
extern void install_linux_ticker(void);
+ unsigned long flags;
kernel_enter_debugger();
-#if CONFIG_SUN_CONSOLE
+#ifdef CONFIG_SUN_CONSOLE
if(!serial_console)
console_restore_palette ();
#endif
install_obp_ticker();
+ save_flags(flags); cli();
(*(romvec->pv_abort))();
+ __asm__ __volatile__("ld [%0], %%g6\n\t" : :
+ "r" (¤t_set[smp_processor_id()]) :
+ "memory");
+ restore_flags(flags);
install_linux_ticker();
-#if CONFIG_SUN_CONSOLE
+#ifdef CONFIG_SUN_AUXIO
+ TURN_ON_LED;
+#endif
+#ifdef CONFIG_SUN_CONSOLE
if(!serial_console)
set_palette ();
#endif
- return;
}
/* Drop into the prom, but completely terminate the program.
* No chance of continuing.
*/
void
-prom_die(void)
+prom_halt(void)
{
+ unsigned long flags;
+ save_flags(flags); cli();
(*(romvec->pv_halt))();
/* Never get here. */
- return;
+ __asm__ __volatile__("ld [%0], %%g6\n\t" : :
+ "r" (¤t_set[smp_processor_id()]) :
+ "memory");
+ restore_flags(flags);
}
typedef void (*sfunc_t)(void);
@@ -79,13 +107,12 @@
void
prom_setsync(sfunc_t funcp)
{
-#if CONFIG_AP1000
- printk("not doing setsync\n");
- return;
+#ifdef CONFIG_AP1000
+ printk("not doing setsync\n");
+ return;
#endif
if(!funcp) return;
*romvec->pv_synchook = funcp;
- return;
}
/* Get the idprom and stuff it into buffer 'idbuf'. Returns the
@@ -93,7 +120,7 @@
* has space for. Returns 0xff on error.
*/
unsigned char
-prom_getidp(char *idbuf, int num_bytes)
+prom_get_idprom(char *idbuf, int num_bytes)
{
int len;
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov