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