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/config.h>
9 #include <linux/types.h>
10 #include <linux/kernel.h>
11 #include <linux/sched.h>
12 #include <asm/sun3-head.h>
13 #include <asm/idprom.h>
14 #include <asm/openprom.h>
15 #include <asm/oplib.h>
18 /* Reset and reboot the machine with the command 'bcommand'. */
20 prom_reboot(char *bcommand
)
23 save_flags(flags
); cli();
24 (*(romvec
->pv_reboot
))(bcommand
);
28 /* Drop into the prom, with the chance to continue with the 'go'
36 /* Drop into the prom, but completely terminate the program.
37 * No chance of continuing.
44 save_flags(flags
); cli();
45 (*(romvec
->pv_halt
))();
47 goto again
; /* PROM is out to get me -DaveM */
50 typedef void (*sfunc_t
)(void);
52 /* Get the idprom and stuff it into buffer 'idbuf'. Returns the
53 * format type. 'num_bytes' is the number of bytes that your idbuf
54 * has space for. Returns 0xff on error.
57 prom_get_idprom(char *idbuf
, int num_bytes
)
62 for(i
=0;i
<num_bytes
; i
++)
64 /* There is a problem with the GET_CONTROL_BYTE
65 macro; defining the extra variable
69 GET_CONTROL_BYTE(SUN3_IDPROM_BASE
+ i
, c
);
76 /* Get the major prom version number. */
80 return romvec
->pv_romvers
;
83 /* Get the prom plugin-revision. */
90 /* Get the prom firmware print revision. */