Print this page
11630 remove checks for 64-bit capable hardware
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/sun/sys/promif.h
+++ new/usr/src/uts/sun/sys/promif.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 + * Copyright 2019 Peter Tribble.
25 26 */
26 27
27 28 #ifndef _SYS_PROMIF_H
28 29 #define _SYS_PROMIF_H
29 30
30 -#pragma ident "%Z%%M% %I% %E% SMI"
31 -
32 31 #include <sys/types.h>
33 32 #include <sys/obpdefs.h>
34 33
35 34 #if defined(_KERNEL) || defined(_KMDB)
36 35 #include <sys/va_list.h>
37 36 #endif
38 37
39 38 #ifdef __cplusplus
40 39 extern "C" {
41 40 #endif
42 41
43 42 /*
44 43 * These are for V0 ops only. We sometimes have to specify
45 44 * to promif which type of operation we need to perform
46 45 * and since we can't get such a property from a V0 prom, we
47 46 * sometimes just assume it. V2 and later proms do the right thing.
48 47 */
49 48 #define BLOCK 0
50 49 #define NETWORK 1
51 50 #define BYTE 2
52 51
53 52
54 53 #if defined(_KERNEL) || defined(_KMDB)
55 54
56 55 #if !defined(_BOOT)
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
57 56 /*
58 57 * Due to FCode on sun4u machines running in a pseudo-32-bit environment
59 58 * we need to enable code in several of the promif routines to ensure
60 59 * that 64-bit pointers from the kernel are not passed through the CIF
61 60 * to OpenBoot.
62 61 *
63 62 * Client programs defining this token need to provide two callbacks to
64 63 * allow the promif routines to allocate and free memory allocated from
65 64 * the bottom 32-bits of the 64-bit address space:
66 65 *
67 - * void *promplat_alloc(size_t);
68 - * void promplat_free(void *, size_t);
66 + * void *promplat_alloc(size_t);
67 + * void promplat_free(void *, size_t);
69 68 *
70 69 * The alloc function should guarantee that it will never return an
71 70 * invalid pointer.
72 71 */
73 72 #define PROM_32BIT_ADDRS
74 73 #endif /* _BOOT */
75 74
76 75 typedef void promif_preprom_f(void);
77 76 typedef void promif_postprom_f(void);
78 77
79 78 /*
80 79 * resource allocation group: OBP and IEEE 1275-1994.
81 80 * prom_alloc is platform dependent on SPARC.
82 81 */
83 82 extern caddr_t prom_alloc(caddr_t virthint, size_t size, uint_t align);
84 83 extern void prom_free(caddr_t virt, size_t size);
85 84
86 85 /*
87 86 * Device tree and property group: OBP and IEEE 1275-1994.
88 87 */
89 88 extern pnode_t prom_childnode(pnode_t nodeid);
90 89 extern pnode_t prom_nextnode(pnode_t nodeid);
91 90 extern pnode_t prom_parentnode(pnode_t nodeid);
92 91 extern pnode_t prom_rootnode(void);
93 92 extern pnode_t prom_chosennode(void);
94 93 extern pnode_t prom_alias_node(void);
95 94 extern pnode_t prom_optionsnode(void);
96 95
97 96 extern int prom_asr_list_keys_len();
98 97 extern int prom_asr_list_keys(caddr_t value);
99 98 extern int prom_asr_export_len();
100 99 extern int prom_asr_export(caddr_t value);
101 100 extern int prom_asr_disable(char *keystr, int keystr_len,
102 101 char *reason, int reason_len);
103 102 extern int prom_asr_enable(char *keystr, int keystr_len);
104 103
105 104 extern int prom_getproplen(pnode_t nodeid, caddr_t name);
106 105 extern int prom_getprop(pnode_t nodeid, caddr_t name,
107 106 caddr_t value);
108 107 extern caddr_t prom_nextprop(pnode_t nodeid, caddr_t previous,
109 108 caddr_t next);
110 109 extern int prom_setprop(pnode_t nodeid, caddr_t name,
111 110 caddr_t value, int len);
112 111
113 112 extern int prom_getnode_byname(pnode_t id, char *name);
114 113 extern int prom_devicetype(pnode_t id, char *type);
115 114
116 115 extern char *prom_decode_composite_string(void *buf,
117 116 size_t buflen, char *prev);
118 117
119 118 /*
120 119 * Device tree and property group: IEEE 1275-1994 Only.
121 120 */
122 121 extern pnode_t prom_finddevice(char *path); /* Also on obp2.x */
123 122
124 123 extern int prom_bounded_getprop(pnode_t nodeid,
125 124 caddr_t name, caddr_t buffer, int buflen);
126 125
127 126 extern phandle_t prom_getphandle(ihandle_t i);
128 127
129 128 /*
130 129 * Device pathnames and pathname conversion: OBP and IEEE 1275-1994.
131 130 */
132 131 extern int prom_devname_from_pathname(char *path, char *buffer);
133 132 extern char *prom_path_options(char *pathname);
134 133 extern char *prom_path_gettoken(char *from, char *to);
135 134 extern void prom_pathname(char *pathname);
136 135 extern void prom_strip_options(char *from, char *to);
137 136
138 137 /*
139 138 * Device pathnames and pathname conversion: IEEE 1275-1994 only.
140 139 */
141 140 extern int prom_ihandle_to_path(ihandle_t, char *buf,
142 141 uint_t buflen);
143 142 extern int prom_phandle_to_path(phandle_t, char *buf,
144 143 uint_t buflen);
145 144
146 145 /*
147 146 * Special device nodes: OBP and IEEE 1275-1994.
148 147 */
149 148 extern ihandle_t prom_stdin_ihandle(void);
150 149 extern ihandle_t prom_stdout_ihandle(void);
151 150 extern pnode_t prom_stdin_node(void);
152 151 extern pnode_t prom_stdout_node(void);
153 152 extern char *prom_stdinpath(void);
154 153 extern char *prom_stdoutpath(void);
155 154 extern int prom_stdin_devname(char *buffer);
156 155 extern int prom_stdout_devname(char *buffer);
157 156 extern int prom_stdin_is_keyboard(void);
158 157 extern int prom_stdout_is_framebuffer(void);
159 158 extern int prom_stdin_stdout_equivalence(void);
160 159
161 160 extern void prom_get_tem_inverses(int *, int *);
162 161 extern void prom_get_tem_size(size_t *, size_t *);
163 162 extern void prom_get_tem_pos(uint32_t *, uint32_t *);
164 163 extern void prom_get_term_font_size(int *, int *);
165 164 extern void prom_hide_cursor(void);
166 165
167 166 /*
168 167 * Special device nodes: IEEE 1275-1994 only.
169 168 */
170 169 extern ihandle_t prom_memory_ihandle(void);
171 170 extern ihandle_t prom_mmu_ihandle(void);
172 171
173 172 /*
174 173 * Administrative group: OBP and IEEE 1275-1994.
175 174 */
176 175 extern void prom_enter_mon(void);
177 176 extern void prom_exit_to_mon(void)
↓ open down ↓ |
99 lines elided |
↑ open up ↑ |
178 177 __NORETURN;
179 178 extern void prom_reboot(char *bootstr);
180 179
181 180 extern void prom_panic(char *string)
182 181 __NORETURN;
183 182
184 183 extern int prom_getversion(void);
185 184 extern int prom_is_openprom(void);
186 185 extern int prom_is_p1275(void);
187 186 extern int prom_version_name(char *buf, int buflen);
188 -extern int prom_version_check(char *buf, size_t len, pnode_t *n);
189 187
190 188 extern void *prom_mon_id(void); /* SMCC/OBP platform centric */
191 189
192 190 extern uint_t prom_gettime(void);
193 191
194 192 extern char *prom_bootpath(void);
195 193 extern char *prom_bootargs(void);
196 194
197 195 extern void prom_interpret(char *str, uintptr_t arg1,
198 196 uintptr_t arg2, uintptr_t arg3, uintptr_t arg4,
199 197 uintptr_t arg5);
200 198
201 199 /*
202 - * Return code values from prom_version_check:
203 - *
204 - * This routine uses past-prediction mode to determine if the firmware
205 - * on the current system is 64-bit ready.
206 - *
207 - * return code 2 could happen on a board-based server with a slave CPU board
208 - * running down-rev firmware and the current master running adequate fw.
209 - */
210 -#define PROM_VER64_OK 0 /* Prom is 64-bit ready (or n/a) */
211 -#define PROM_VER64_UPGRADE 1 /* Down-rev firmware is running */
212 -#define PROM_VER64_SUGGEST 2 /* Down-rev firmware detected .. */
213 - /* .. but not currently active */
214 -
215 -/*
216 200 * Administrative group: OBP only.
217 201 */
218 202 extern int prom_sethandler(void (*v0_func)(), void (*v2_func)());
219 203
220 204 extern struct bootparam *prom_bootparam(void);
221 205
222 206 /*
223 207 * Administrative group: IEEE 1275-1994 only.
224 208 */
225 209 extern void *prom_set_callback(void *handler);
226 210 extern void prom_set_symbol_lookup(void *sym2val, void *val2sym);
227 211
228 212 /*
229 213 * Administrative group: IEEE 1275 only.
230 214 */
231 215 extern int prom_test(char *service);
232 216 extern int prom_test_method(char *method, pnode_t node);
233 217
234 218 /*
235 219 * Promif support group: Generic.
236 220 */
237 221 extern void prom_init(char *progname, void *prom_cookie);
238 222
239 223 extern void prom_set_preprom(promif_preprom_f *);
240 224 extern void prom_set_postprom(promif_postprom_f *);
241 225
242 226 extern void prom_get_tem_pos(uint32_t *, uint32_t *);
243 227 extern void prom_get_tem_size(size_t *, size_t *);
244 228
245 229 typedef struct __promif_redir_arg *promif_redir_arg_t;
246 230 typedef ssize_t (*promif_redir_t)(promif_redir_arg_t,
247 231 uchar_t *, size_t);
248 232 extern void prom_set_stdout_redirect(promif_redir_t,
249 233 promif_redir_arg_t);
250 234
251 235 extern void prom_suspend_prepost(void);
252 236 extern void prom_resume_prepost(void);
253 237
254 238 extern void (*prom_set_nextprop_preprom(void (*)(void)))(void);
255 239 extern void (*prom_set_nextprop_postprom(void (*)(void)))(void);
256 240
257 241 extern void prom_montrap(void (*funcptr)());
258 242
259 243 typedef uint_t prom_generation_cookie_t;
260 244
261 245 extern int prom_tree_access(int (*callback)(void *arg,
262 246 int has_changed), void *arg,
263 247 prom_generation_cookie_t *);
264 248 extern int prom_tree_update(int (*callback)(void *arg), void *arg);
265 249
266 250 /*
267 251 * I/O Group: OBP and IEEE 1275.
268 252 */
269 253 extern uchar_t prom_getchar(void);
270 254 extern void prom_putchar(char c);
271 255 extern int prom_mayget(void);
272 256 extern int prom_mayput(char c);
273 257
274 258 extern int prom_open(char *name);
275 259 extern int prom_close(int fd);
276 260 extern ssize_t prom_read(ihandle_t fd, caddr_t buf, size_t len,
277 261 uint_t startblk, char type);
278 262 extern ssize_t prom_write(ihandle_t fd, caddr_t buf, size_t len,
279 263 uint_t startblk, char type);
280 264 extern int prom_seek(int fd, u_longlong_t offset);
281 265
282 266 extern void prom_writestr(const char *buf, size_t bufsize);
283 267 extern void prom_pnode_to_pathname(pnode_t, char *);
284 268
285 269 /*PRINTFLIKE1*/
286 270 extern void prom_printf(const char *fmt, ...)
287 271 __PRINTFLIKE(1);
288 272 #pragma rarely_called(prom_printf)
289 273
290 274 extern void prom_vprintf(const char *fmt, __va_list adx)
291 275 __VPRINTFLIKE(1);
292 276 #pragma rarely_called(prom_vprintf)
293 277
294 278 /*PRINTFLIKE2*/
295 279 extern char *prom_sprintf(char *s, const char *fmt, ...)
296 280 __PRINTFLIKE(2);
297 281 extern char *prom_vsprintf(char *s, const char *fmt, __va_list adx)
298 282 __VPRINTFLIKE(2);
299 283
300 284 #define PROM_WALK_CONTINUE 0 /* keep walking to next node */
301 285 #define PROM_WALK_TERMINATE 1 /* abort walk now */
302 286
303 287 extern void prom_walk_devs(pnode_t node,
304 288 int (*f)(pnode_t, void *, void *),
305 289 void *arg, void *result);
306 290
307 291 extern pnode_t prom_findnode_byname(pnode_t id, char *name);
308 292 extern pnode_t prom_findnode_bydevtype(pnode_t id, char *devtype);
309 293
310 294 #define PROM_STOP { \
311 295 prom_printf("File %s line %d\n", __FILE__, __LINE__); \
312 296 prom_enter_mon(); \
313 297 }
314 298
315 299 /*
316 300 * file IO
317 301 */
318 302 extern int prom_fopen(ihandle_t, char *);
319 303 extern int prom_volopen(ihandle_t, char *);
320 304 extern int prom_fseek(ihandle_t, int, unsigned long long);
321 305 extern int prom_fread(ihandle_t, int, caddr_t, size_t);
322 306 extern int prom_fsize(ihandle_t, int, size_t *);
323 307 extern int prom_compinfo(ihandle_t, int, int *,
324 308 size_t *, size_t *);
325 309 extern void prom_fclose(ihandle_t, int);
326 310
327 311
328 312 #endif /* _KERNEL || _KMDB */
329 313
330 314 #ifdef _KERNEL
331 315
332 316 /*
333 317 * Used by wrappers which bring up console frame buffer before prom_printf()
334 318 * and other prom calls that may output to the console. Struct is filled in
335 319 * in prom_env.c and in sunpm.c
336 320 */
337 321
338 322 typedef struct promif_owrap {
339 323 void (*preout)(void);
340 324 void (*postout)(void);
341 325 } promif_owrap_t;
342 326
343 327 /*
344 328 * WAN boot key storage interface
345 329 */
346 330 int prom_set_security_key(char *keyname, caddr_t buf, int buflen, int *reslen,
347 331 int *status);
348 332 int prom_get_security_key(char *keyname, caddr_t buf, int buflen, int *keylen,
349 333 int *status);
350 334 #endif /* _KERNEL */
351 335
352 336 #ifdef __cplusplus
353 337 }
354 338 #endif
355 339
356 340 #endif /* _SYS_PROMIF_H */
↓ open down ↓ |
131 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX