1 /* $Id: misc.c,v 1.15 1997/05/14 20:45:00 davem Exp $
2 * misc.c: Miscellaneous prom functions that don't belong
5 * Copyright (C) 1995 David S. Miller (davem@caip.rutgers.edu)
8 #include <linux/types.h>
9 #include <linux/kernel.h>
10 #include <linux/sched.h>
11 #include <asm/sun3-head.h>
12 #include <asm/idprom.h>
13 #include <asm/openprom.h>
14 #include <asm/oplib.h>
17 /* Reset and reboot the machine with the command 'bcommand'. */
19 prom_reboot(char *bcommand
)
22 local_irq_save(flags
);
23 (*(romvec
->pv_reboot
))(bcommand
);
24 local_irq_restore(flags
);
27 /* Drop into the prom, with the chance to continue with the 'go'
35 /* Drop into the prom, but completely terminate the program.
36 * No chance of continuing.
43 local_irq_save(flags
);
44 (*(romvec
->pv_halt
))();
45 local_irq_restore(flags
);
46 goto again
; /* PROM is out to get me -DaveM */
49 typedef void (*sfunc_t
)(void);
51 /* Get the idprom and stuff it into buffer 'idbuf'. Returns the
52 * format type. 'num_bytes' is the number of bytes that your idbuf
53 * has space for. Returns 0xff on error.
56 prom_get_idprom(char *idbuf
, int num_bytes
)
61 for(i
=0;i
<num_bytes
; i
++)
63 /* There is a problem with the GET_CONTROL_BYTE
64 macro; defining the extra variable
68 GET_CONTROL_BYTE(SUN3_IDPROM_BASE
+ i
, c
);
75 /* Get the major prom version number. */
79 return romvec
->pv_romvers
;
82 /* Get the prom plugin-revision. */
89 /* Get the prom firmware print revision. */