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