1
2
3
4
5
6
7
8
9 #ifndef __SPARC64_OPLIB_H
10 #define __SPARC64_OPLIB_H
11
12 #include <asm/openprom.h>
13
14
15 extern char prom_version[];
16
17
18
19
20 extern phandle prom_root_node;
21
22
23 extern int prom_stdout;
24
25
26
27
28 extern phandle prom_chosen_node;
29
30
31 extern const char prom_peer_name[];
32 extern const char prom_compatible_name[];
33 extern const char prom_root_compatible[];
34 extern const char prom_cpu_compatible[];
35 extern const char prom_finddev_name[];
36 extern const char prom_chosen_path[];
37 extern const char prom_cpu_path[];
38 extern const char prom_getprop_name[];
39 extern const char prom_mmu_name[];
40 extern const char prom_callmethod_name[];
41 extern const char prom_translate_name[];
42 extern const char prom_map_name[];
43 extern const char prom_unmap_name[];
44 extern int prom_mmu_ihandle_cache;
45 extern unsigned int prom_boot_mapped_pc;
46 extern unsigned int prom_boot_mapping_mode;
47 extern unsigned long prom_boot_mapping_phys_high, prom_boot_mapping_phys_low;
48
49 struct linux_mlist_p1275 {
50 struct linux_mlist_p1275 *theres_more;
51 unsigned long start_adr;
52 unsigned long num_bytes;
53 };
54
55 struct linux_mem_p1275 {
56 struct linux_mlist_p1275 **p1275_totphys;
57 struct linux_mlist_p1275 **p1275_prommap;
58 struct linux_mlist_p1275 **p1275_available;
59 };
60
61
62
63
64
65
66 void prom_init(void *cif_handler);
67 void prom_init_report(void);
68
69
70 char *prom_getbootargs(void);
71
72
73
74
75 void prom_reboot(const char *boot_command);
76
77
78 void prom_feval(const char *forth_string);
79
80
81
82
83 void prom_cmdline(void);
84
85
86
87
88 void prom_halt(void) __attribute__ ((noreturn));
89
90
91 void prom_halt_power_off(void) __attribute__ ((noreturn));
92
93
94
95
96
97 unsigned char prom_get_idprom(char *idp_buffer, int idpbuf_size);
98
99
100 void prom_console_write_buf(const char *buf, int len);
101
102
103 __printf(1, 2) void prom_printf(const char *fmt, ...);
104 void prom_write(const char *buf, unsigned int len);
105
106
107 #ifdef CONFIG_SMP
108
109
110
111 void prom_startcpu(int cpunode, unsigned long pc, unsigned long arg);
112
113
114
115
116 void prom_startcpu_cpuid(int cpuid, unsigned long pc, unsigned long arg);
117
118
119 void prom_stopcpu_cpuid(int cpuid);
120
121
122 void prom_stopself(void);
123
124
125 void prom_idleself(void);
126
127
128 void prom_resumecpu(int cpunode);
129 #endif
130
131
132
133
134 void prom_sleepself(void);
135
136
137 int prom_sleepsystem(void);
138
139
140 int prom_wakeupsystem(void);
141
142
143
144
145 int prom_getunumber(int syndrome_code,
146 unsigned long phys_addr,
147 char *buf, int buflen);
148
149
150 int prom_retain(const char *name, unsigned long size,
151 unsigned long align, unsigned long *paddr);
152
153
154 long prom_itlb_load(unsigned long index,
155 unsigned long tte_data,
156 unsigned long vaddr);
157
158 long prom_dtlb_load(unsigned long index,
159 unsigned long tte_data,
160 unsigned long vaddr);
161
162
163
164
165 #define PROM_MAP_WRITE 0x0001
166 #define PROM_MAP_READ 0x0002
167 #define PROM_MAP_EXEC 0x0004
168 #define PROM_MAP_LOCKED 0x0010
169 #define PROM_MAP_CACHED 0x0020
170 #define PROM_MAP_SE 0x0040
171 #define PROM_MAP_GLOB 0x0080
172 #define PROM_MAP_IE 0x0100
173 #define PROM_MAP_DEFAULT (PROM_MAP_WRITE | PROM_MAP_READ | PROM_MAP_EXEC | PROM_MAP_CACHED)
174
175 int prom_map(int mode, unsigned long size,
176 unsigned long vaddr, unsigned long paddr);
177 void prom_unmap(unsigned long size, unsigned long vaddr);
178
179
180
181
182
183 phandle prom_getchild(phandle parent_node);
184
185
186
187
188 phandle prom_getsibling(phandle node);
189
190
191
192
193 int prom_getproplen(phandle thisnode, const char *property);
194
195
196
197
198 int prom_getproperty(phandle thisnode, const char *property,
199 char *prop_buffer, int propbuf_size);
200
201
202 int prom_getint(phandle node, const char *property);
203
204
205 int prom_getintdefault(phandle node, const char *property, int defval);
206
207
208 int prom_getbool(phandle node, const char *prop);
209
210
211 void prom_getstring(phandle node, const char *prop, char *buf,
212 int bufsize);
213
214
215 int prom_nodematch(phandle thisnode, const char *name);
216
217
218
219
220 phandle prom_searchsiblings(phandle node_start, const char *name);
221
222
223
224
225 char *prom_firstprop(phandle node, char *buffer);
226
227
228
229
230 char *prom_nextprop(phandle node, const char *prev_property, char *buf);
231
232
233 int prom_node_has_property(phandle node, const char *property);
234
235
236 phandle prom_finddevice(const char *name);
237
238
239
240
241 int prom_setprop(phandle node, const char *prop_name, char *prop_value,
242 int value_size);
243
244 phandle prom_inst2pkg(int);
245 void prom_sun4v_guest_soft_state(void);
246
247 int prom_ihandle2path(int handle, char *buffer, int bufsize);
248
249
250 void p1275_cmd_direct(unsigned long *);
251
252 #endif