This source file includes following definitions.
- prom_reboot
- prom_feval
- prom_halt
- prom_die
- prom_setsync
- prom_getidp
- prom_version
- prom_getrev
- prom_getprev
1
2
3
4
5
6
7 #include <asm/openprom.h>
8 #include <asm/oplib.h>
9
10
11 void
12 prom_reboot(char *bcommand)
13 {
14 (*(romvec->pv_reboot))(bcommand);
15
16 return;
17 }
18
19
20 void
21 prom_feval(char *fstring)
22 {
23 if(!fstring || fstring[0] == 0) return;
24 if(prom_vers == PROM_V0)
25 (*(romvec->pv_fortheval.v0_eval))(strlen(fstring), fstring);
26 else
27 (*(romvec->pv_fortheval.v2_eval))(fstring);
28 return;
29 }
30
31
32
33
34 void
35 prom_halt(void)
36 {
37 (*(romvec->pv_abort))();
38 return;
39 }
40
41
42
43
44 void
45 prom_die(void)
46 {
47 (*(romvec->pv_halt))();
48
49 return;
50 }
51
52 typedef void (*sfunc_t)(void);
53
54
55 void
56 prom_setsync(sfunc_t funcp)
57 {
58 if(!funcp) return;
59 *romvec->pv_synchook = funcp;
60 return;
61 }
62
63
64
65
66
67 unsigned char
68 prom_getidp(char *idbuf, int num_bytes)
69 {
70 int len;
71
72 len = prom_getproplen(prom_root_node, "idprom");
73 if((len>num_bytes) || (len==-1)) return 0xff;
74 if(!prom_getproperty(prom_root_node, "idprom", idbuf, num_bytes))
75 return idbuf[0];
76
77 return 0xff;
78 }
79
80
81 int
82 prom_version(void)
83 {
84 return romvec->pv_romvers;
85 }
86
87
88 int
89 prom_getrev(void)
90 {
91 return prom_rev;
92 }
93
94
95 int
96 prom_getprev(void)
97 {
98 return prom_prev;
99 }