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