xref: /titanic_50/usr/src/uts/sun/sys/promif.h (revision e7cbe64f7a72dae5cb44f100db60ca88f3313c65)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5fea9cb91Slq150181  * Common Development and Distribution License (the "License").
6fea9cb91Slq150181  * You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate  *
87c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate  * and limitations under the License.
127c478bd9Sstevel@tonic-gate  *
137c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate  *
197c478bd9Sstevel@tonic-gate  * CDDL HEADER END
207c478bd9Sstevel@tonic-gate  */
21fea9cb91Slq150181 
227c478bd9Sstevel@tonic-gate /*
23*e7cbe64fSgw25295  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_SYS_PROMIF_H
287c478bd9Sstevel@tonic-gate #define	_SYS_PROMIF_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate #include <sys/types.h>
337c478bd9Sstevel@tonic-gate #include <sys/obpdefs.h>
347c478bd9Sstevel@tonic-gate 
357c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_KMDB)
367c478bd9Sstevel@tonic-gate #include <sys/va_list.h>
377c478bd9Sstevel@tonic-gate #endif
387c478bd9Sstevel@tonic-gate 
397c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
407c478bd9Sstevel@tonic-gate extern "C" {
417c478bd9Sstevel@tonic-gate #endif
427c478bd9Sstevel@tonic-gate 
437c478bd9Sstevel@tonic-gate /*
447c478bd9Sstevel@tonic-gate  *  These are for V0 ops only.  We sometimes have to specify
457c478bd9Sstevel@tonic-gate  *  to promif which type of operation we need to perform
467c478bd9Sstevel@tonic-gate  *  and since we can't get such a property from a V0 prom, we
477c478bd9Sstevel@tonic-gate  *  sometimes just assume it.  V2 and later proms do the right thing.
487c478bd9Sstevel@tonic-gate  */
497c478bd9Sstevel@tonic-gate #define	BLOCK	0
507c478bd9Sstevel@tonic-gate #define	NETWORK	1
517c478bd9Sstevel@tonic-gate #define	BYTE	2
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate 
547c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_KMDB)
557c478bd9Sstevel@tonic-gate 
567c478bd9Sstevel@tonic-gate #if !defined(_BOOT)
577c478bd9Sstevel@tonic-gate /*
587c478bd9Sstevel@tonic-gate  * Due to FCode on sun4u machines running in a pseudo-32-bit environment
597c478bd9Sstevel@tonic-gate  * we need to enable code in several of the promif routines to ensure
607c478bd9Sstevel@tonic-gate  * that 64-bit pointers from the kernel are not passed through the CIF
617c478bd9Sstevel@tonic-gate  * to OpenBoot.
627c478bd9Sstevel@tonic-gate  *
637c478bd9Sstevel@tonic-gate  * Client programs defining this token need to provide two callbacks to
647c478bd9Sstevel@tonic-gate  * allow the promif routines to allocate and free memory allocated from
657c478bd9Sstevel@tonic-gate  * the bottom 32-bits of the 64-bit address space:
667c478bd9Sstevel@tonic-gate  *
677c478bd9Sstevel@tonic-gate  * 	void *promplat_alloc(size_t);
687c478bd9Sstevel@tonic-gate  * 	void promplat_free(void *, size_t);
697c478bd9Sstevel@tonic-gate  *
707c478bd9Sstevel@tonic-gate  * The alloc function should guarantee that it will never return an
717c478bd9Sstevel@tonic-gate  * invalid pointer.
727c478bd9Sstevel@tonic-gate  */
737c478bd9Sstevel@tonic-gate #define	PROM_32BIT_ADDRS
747c478bd9Sstevel@tonic-gate #endif /* _BOOT */
757c478bd9Sstevel@tonic-gate 
767c478bd9Sstevel@tonic-gate typedef void promif_preprom_f(void);
777c478bd9Sstevel@tonic-gate typedef void promif_postprom_f(void);
787c478bd9Sstevel@tonic-gate 
797c478bd9Sstevel@tonic-gate /*
807c478bd9Sstevel@tonic-gate  * resource allocation group: OBP and IEEE 1275-1994.
817c478bd9Sstevel@tonic-gate  * prom_alloc is platform dependent on SPARC.
827c478bd9Sstevel@tonic-gate  */
837c478bd9Sstevel@tonic-gate extern	caddr_t		prom_alloc(caddr_t virthint, size_t size, uint_t align);
847c478bd9Sstevel@tonic-gate extern	void		prom_free(caddr_t virt, size_t size);
857c478bd9Sstevel@tonic-gate 
867c478bd9Sstevel@tonic-gate /*
877c478bd9Sstevel@tonic-gate  * Device tree and property group: OBP and IEEE 1275-1994.
887c478bd9Sstevel@tonic-gate  */
89fa9e4066Sahrens extern	pnode_t		prom_childnode(pnode_t nodeid);
90fa9e4066Sahrens extern	pnode_t		prom_nextnode(pnode_t nodeid);
91fa9e4066Sahrens extern	pnode_t		prom_parentnode(pnode_t nodeid);
92fa9e4066Sahrens extern	pnode_t		prom_rootnode(void);
93fa9e4066Sahrens extern	pnode_t		prom_chosennode(void);
94fa9e4066Sahrens extern	pnode_t		prom_alias_node(void);
95fa9e4066Sahrens extern	pnode_t		prom_optionsnode(void);
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate extern	int		prom_asr_list_keys_len();
987c478bd9Sstevel@tonic-gate extern	int		prom_asr_list_keys(caddr_t value);
997c478bd9Sstevel@tonic-gate extern	int		prom_asr_export_len();
1007c478bd9Sstevel@tonic-gate extern	int		prom_asr_export(caddr_t value);
1017c478bd9Sstevel@tonic-gate extern	int		prom_asr_disable(char *keystr, int keystr_len,
1027c478bd9Sstevel@tonic-gate 			    char *reason, int reason_len);
1037c478bd9Sstevel@tonic-gate extern	int		prom_asr_enable(char *keystr, int keystr_len);
1047c478bd9Sstevel@tonic-gate 
105fa9e4066Sahrens extern	int		prom_getproplen(pnode_t nodeid, caddr_t name);
106fa9e4066Sahrens extern	int		prom_getprop(pnode_t nodeid, caddr_t name,
1077c478bd9Sstevel@tonic-gate 			    caddr_t value);
108fa9e4066Sahrens extern	caddr_t		prom_nextprop(pnode_t nodeid, caddr_t previous,
1097c478bd9Sstevel@tonic-gate 			    caddr_t next);
110fa9e4066Sahrens extern	int		prom_setprop(pnode_t nodeid, caddr_t name,
1117c478bd9Sstevel@tonic-gate 			    caddr_t value, int len);
1127c478bd9Sstevel@tonic-gate 
113fa9e4066Sahrens extern	int		prom_getnode_byname(pnode_t id, char *name);
114fa9e4066Sahrens extern	int		prom_devicetype(pnode_t id, char *type);
1157c478bd9Sstevel@tonic-gate 
1167c478bd9Sstevel@tonic-gate extern	char		*prom_decode_composite_string(void *buf,
1177c478bd9Sstevel@tonic-gate 			    size_t buflen, char *prev);
1187c478bd9Sstevel@tonic-gate 
1197c478bd9Sstevel@tonic-gate /*
1207c478bd9Sstevel@tonic-gate  * Device tree and property group: IEEE 1275-1994 Only.
1217c478bd9Sstevel@tonic-gate  */
122fa9e4066Sahrens extern	pnode_t		prom_finddevice(char *path);	/* Also on obp2.x */
1237c478bd9Sstevel@tonic-gate 
124fa9e4066Sahrens extern	int		prom_bounded_getprop(pnode_t nodeid,
1257c478bd9Sstevel@tonic-gate 			    caddr_t name, caddr_t buffer, int buflen);
1267c478bd9Sstevel@tonic-gate 
1277c478bd9Sstevel@tonic-gate extern	phandle_t	prom_getphandle(ihandle_t i);
1287c478bd9Sstevel@tonic-gate 
1297c478bd9Sstevel@tonic-gate /*
1307c478bd9Sstevel@tonic-gate  * Device pathnames and pathname conversion: OBP and IEEE 1275-1994.
1317c478bd9Sstevel@tonic-gate  */
1327c478bd9Sstevel@tonic-gate extern	int		prom_devname_from_pathname(char *path, char *buffer);
1337c478bd9Sstevel@tonic-gate extern	char		*prom_path_options(char *pathname);
1347c478bd9Sstevel@tonic-gate extern	char		*prom_path_gettoken(char *from, char *to);
1357c478bd9Sstevel@tonic-gate extern	void		prom_pathname(char *pathname);
1367c478bd9Sstevel@tonic-gate extern	void		prom_strip_options(char *from, char *to);
1377c478bd9Sstevel@tonic-gate 
1387c478bd9Sstevel@tonic-gate /*
1397c478bd9Sstevel@tonic-gate  * Device pathnames and pathname conversion: IEEE 1275-1994 only.
1407c478bd9Sstevel@tonic-gate  */
1417c478bd9Sstevel@tonic-gate extern	int		prom_ihandle_to_path(ihandle_t, char *buf,
1427c478bd9Sstevel@tonic-gate 			    uint_t buflen);
1437c478bd9Sstevel@tonic-gate extern	int		prom_phandle_to_path(phandle_t, char *buf,
1447c478bd9Sstevel@tonic-gate 			    uint_t buflen);
1457c478bd9Sstevel@tonic-gate 
1467c478bd9Sstevel@tonic-gate /*
1477c478bd9Sstevel@tonic-gate  * Special device nodes: OBP and IEEE 1275-1994.
1487c478bd9Sstevel@tonic-gate  */
1497c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_stdin_ihandle(void);
1507c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_stdout_ihandle(void);
151fa9e4066Sahrens extern	pnode_t		prom_stdin_node(void);
152fa9e4066Sahrens extern	pnode_t		prom_stdout_node(void);
1537c478bd9Sstevel@tonic-gate extern	char		*prom_stdinpath(void);
1547c478bd9Sstevel@tonic-gate extern	char		*prom_stdoutpath(void);
1557c478bd9Sstevel@tonic-gate extern	int		prom_stdin_devname(char *buffer);
1567c478bd9Sstevel@tonic-gate extern	int		prom_stdout_devname(char *buffer);
1577c478bd9Sstevel@tonic-gate extern	int		prom_stdin_is_keyboard(void);
1587c478bd9Sstevel@tonic-gate extern	int		prom_stdout_is_framebuffer(void);
1597c478bd9Sstevel@tonic-gate extern	int		prom_stdin_stdout_equivalence(void);
1607c478bd9Sstevel@tonic-gate 
161c9503a49Slq150181 extern void		prom_get_tem_inverses(int *, int *);
162fea9cb91Slq150181 extern void		prom_get_tem_size(size_t *, size_t *);
163fea9cb91Slq150181 extern void		prom_get_tem_pos(uint32_t *, uint32_t *);
164fea9cb91Slq150181 extern void		prom_get_term_font_size(int *, int *);
165fea9cb91Slq150181 extern void		prom_hide_cursor(void);
166fea9cb91Slq150181 
1677c478bd9Sstevel@tonic-gate /*
1687c478bd9Sstevel@tonic-gate  * Special device nodes: IEEE 1275-1994 only.
1697c478bd9Sstevel@tonic-gate  */
1707c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_memory_ihandle(void);
1717c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_mmu_ihandle(void);
1727c478bd9Sstevel@tonic-gate 
1737c478bd9Sstevel@tonic-gate /*
1747c478bd9Sstevel@tonic-gate  * Administrative group: OBP and IEEE 1275-1994.
1757c478bd9Sstevel@tonic-gate  */
1767c478bd9Sstevel@tonic-gate extern	void		prom_enter_mon(void);
1777c478bd9Sstevel@tonic-gate extern	void		prom_exit_to_mon(void)
1787c478bd9Sstevel@tonic-gate 	__NORETURN;
1797c478bd9Sstevel@tonic-gate extern	void		prom_reboot(char *bootstr);
1807c478bd9Sstevel@tonic-gate 
1817c478bd9Sstevel@tonic-gate extern	void		prom_panic(char *string)
1827c478bd9Sstevel@tonic-gate 	__NORETURN;
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate extern	int		prom_getversion(void);
1857c478bd9Sstevel@tonic-gate extern	int		prom_is_openprom(void);
1867c478bd9Sstevel@tonic-gate extern	int		prom_is_p1275(void);
1877c478bd9Sstevel@tonic-gate extern	int		prom_version_name(char *buf, int buflen);
188fa9e4066Sahrens extern	int		prom_version_check(char *buf, size_t len, pnode_t *n);
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate extern	void		*prom_mon_id(void);	/* SMCC/OBP platform centric */
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate extern	uint_t		prom_gettime(void);
1937c478bd9Sstevel@tonic-gate 
1947c478bd9Sstevel@tonic-gate extern	char		*prom_bootpath(void);
1957c478bd9Sstevel@tonic-gate extern	char		*prom_bootargs(void);
1967c478bd9Sstevel@tonic-gate 
1977c478bd9Sstevel@tonic-gate extern	void		prom_interpret(char *str, uintptr_t arg1,
1987c478bd9Sstevel@tonic-gate 			    uintptr_t arg2, uintptr_t arg3, uintptr_t arg4,
1997c478bd9Sstevel@tonic-gate 			    uintptr_t arg5);
2007c478bd9Sstevel@tonic-gate 
2017c478bd9Sstevel@tonic-gate /*
2027c478bd9Sstevel@tonic-gate  * Return code values from prom_version_check:
2037c478bd9Sstevel@tonic-gate  *
2047c478bd9Sstevel@tonic-gate  * This routine uses past-prediction mode to determine if the firmware
2057c478bd9Sstevel@tonic-gate  * on the current system is 64-bit ready.
2067c478bd9Sstevel@tonic-gate  *
2077c478bd9Sstevel@tonic-gate  * return code 2 could happen on a board-based server with a slave CPU board
2087c478bd9Sstevel@tonic-gate  * running down-rev firmware and the current master running adequate fw.
2097c478bd9Sstevel@tonic-gate  */
2107c478bd9Sstevel@tonic-gate #define	PROM_VER64_OK		0	/* Prom is 64-bit ready (or n/a) */
2117c478bd9Sstevel@tonic-gate #define	PROM_VER64_UPGRADE	1	/* Down-rev firmware is running */
2127c478bd9Sstevel@tonic-gate #define	PROM_VER64_SUGGEST	2	/* Down-rev firmware detected .. */
2137c478bd9Sstevel@tonic-gate 					/* .. but not currently active */
2147c478bd9Sstevel@tonic-gate 
2157c478bd9Sstevel@tonic-gate /*
2167c478bd9Sstevel@tonic-gate  * Administrative group: OBP only.
2177c478bd9Sstevel@tonic-gate  */
2187c478bd9Sstevel@tonic-gate extern	int		prom_sethandler(void (*v0_func)(), void (*v2_func)());
2197c478bd9Sstevel@tonic-gate 
2207c478bd9Sstevel@tonic-gate extern	struct bootparam *prom_bootparam(void);
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate /*
2237c478bd9Sstevel@tonic-gate  * Administrative group: IEEE 1275-1994 only.
2247c478bd9Sstevel@tonic-gate  */
2257c478bd9Sstevel@tonic-gate extern void		*prom_set_callback(void *handler);
2267c478bd9Sstevel@tonic-gate extern void		prom_set_symbol_lookup(void *sym2val, void *val2sym);
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate /*
2297c478bd9Sstevel@tonic-gate  * Administrative group: IEEE 1275 only.
2307c478bd9Sstevel@tonic-gate  */
2317c478bd9Sstevel@tonic-gate extern	int		prom_test(char *service);
232fa9e4066Sahrens extern	int		prom_test_method(char *method, pnode_t node);
2337c478bd9Sstevel@tonic-gate 
2347c478bd9Sstevel@tonic-gate /*
2357c478bd9Sstevel@tonic-gate  * Promif support group: Generic.
2367c478bd9Sstevel@tonic-gate  */
2377c478bd9Sstevel@tonic-gate extern	void		prom_init(char *progname, void *prom_cookie);
2387c478bd9Sstevel@tonic-gate 
2397c478bd9Sstevel@tonic-gate extern	void		prom_set_preprom(promif_preprom_f *);
2407c478bd9Sstevel@tonic-gate extern	void		prom_set_postprom(promif_postprom_f *);
241fea9cb91Slq150181 
242fea9cb91Slq150181 extern  void		prom_get_tem_pos(uint32_t *, uint32_t *);
243fea9cb91Slq150181 extern	void		prom_get_tem_size(size_t *, size_t *);
244fea9cb91Slq150181 
245fea9cb91Slq150181 typedef struct		__promif_redir_arg *promif_redir_arg_t;
246fea9cb91Slq150181 typedef ssize_t		(*promif_redir_t)(promif_redir_arg_t,
247fea9cb91Slq150181 				uchar_t *, size_t);
248fea9cb91Slq150181 extern  void		prom_set_stdout_redirect(promif_redir_t,
249fea9cb91Slq150181 				promif_redir_arg_t);
250fea9cb91Slq150181 
2517c478bd9Sstevel@tonic-gate extern	void		prom_suspend_prepost(void);
2527c478bd9Sstevel@tonic-gate extern	void		prom_resume_prepost(void);
2537c478bd9Sstevel@tonic-gate 
2547c478bd9Sstevel@tonic-gate extern	void		(*prom_set_nextprop_preprom(void (*)(void)))(void);
2557c478bd9Sstevel@tonic-gate extern	void		(*prom_set_nextprop_postprom(void (*)(void)))(void);
2567c478bd9Sstevel@tonic-gate 
2577c478bd9Sstevel@tonic-gate extern	void		prom_montrap(void (*funcptr)());
2587c478bd9Sstevel@tonic-gate 
2597c478bd9Sstevel@tonic-gate typedef uint_t		prom_generation_cookie_t;
2607c478bd9Sstevel@tonic-gate 
2617c478bd9Sstevel@tonic-gate extern	int		prom_tree_access(int (*callback)(void *arg,
2627c478bd9Sstevel@tonic-gate 				int has_changed), void *arg,
2637c478bd9Sstevel@tonic-gate 				prom_generation_cookie_t *);
2647c478bd9Sstevel@tonic-gate extern	int		prom_tree_update(int (*callback)(void *arg), void *arg);
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate /*
2677c478bd9Sstevel@tonic-gate  * I/O Group: OBP and IEEE 1275.
2687c478bd9Sstevel@tonic-gate  */
2697c478bd9Sstevel@tonic-gate extern	uchar_t		prom_getchar(void);
2707c478bd9Sstevel@tonic-gate extern	void		prom_putchar(char c);
2717c478bd9Sstevel@tonic-gate extern	int		prom_mayget(void);
2727c478bd9Sstevel@tonic-gate extern	int		prom_mayput(char c);
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate extern  int		prom_open(char *name);
2757c478bd9Sstevel@tonic-gate extern  int		prom_close(int fd);
2767c478bd9Sstevel@tonic-gate extern  ssize_t		prom_read(ihandle_t fd, caddr_t buf, size_t len,
2777c478bd9Sstevel@tonic-gate 			    uint_t startblk, char type);
2787c478bd9Sstevel@tonic-gate extern  ssize_t		prom_write(ihandle_t fd, caddr_t buf, size_t len,
2797c478bd9Sstevel@tonic-gate 			    uint_t startblk, char type);
2807c478bd9Sstevel@tonic-gate extern	int		prom_seek(int fd, u_longlong_t offset);
2817c478bd9Sstevel@tonic-gate 
2827c478bd9Sstevel@tonic-gate extern	void		prom_writestr(const char *buf, size_t bufsize);
283fa9e4066Sahrens extern	void		prom_pnode_to_pathname(pnode_t, char *);
2847c478bd9Sstevel@tonic-gate 
2857c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/
2867c478bd9Sstevel@tonic-gate extern	void		prom_printf(const char *fmt, ...)
2877c478bd9Sstevel@tonic-gate 	__PRINTFLIKE(1);
2887c478bd9Sstevel@tonic-gate #pragma rarely_called(prom_printf)
2897c478bd9Sstevel@tonic-gate 
2907c478bd9Sstevel@tonic-gate extern	void		prom_vprintf(const char *fmt, __va_list adx)
2917c478bd9Sstevel@tonic-gate 	__VPRINTFLIKE(1);
2927c478bd9Sstevel@tonic-gate #pragma rarely_called(prom_vprintf)
2937c478bd9Sstevel@tonic-gate 
2947c478bd9Sstevel@tonic-gate /*PRINTFLIKE2*/
2957c478bd9Sstevel@tonic-gate extern	char		*prom_sprintf(char *s, const char *fmt, ...)
2967c478bd9Sstevel@tonic-gate 	__PRINTFLIKE(2);
2977c478bd9Sstevel@tonic-gate extern	char		*prom_vsprintf(char *s, const char *fmt, __va_list adx)
2987c478bd9Sstevel@tonic-gate 	__VPRINTFLIKE(2);
2997c478bd9Sstevel@tonic-gate 
3007c478bd9Sstevel@tonic-gate #define	PROM_WALK_CONTINUE	0	/* keep walking to next node */
3017c478bd9Sstevel@tonic-gate #define	PROM_WALK_TERMINATE	1	/* abort walk now */
3027c478bd9Sstevel@tonic-gate 
303fa9e4066Sahrens extern	void		prom_walk_devs(pnode_t node,
304fa9e4066Sahrens 			    int (*f)(pnode_t, void *, void *),
3057c478bd9Sstevel@tonic-gate 			    void *arg, void *result);
3067c478bd9Sstevel@tonic-gate 
307fa9e4066Sahrens extern	pnode_t		prom_findnode_byname(pnode_t id, char *name);
308fa9e4066Sahrens extern	pnode_t		prom_findnode_bydevtype(pnode_t id, char *devtype);
3097c478bd9Sstevel@tonic-gate 
3107c478bd9Sstevel@tonic-gate #define	PROM_STOP	{	\
3117c478bd9Sstevel@tonic-gate 	prom_printf("File %s line %d\n", __FILE__, __LINE__); \
3127c478bd9Sstevel@tonic-gate 	prom_enter_mon();	\
3137c478bd9Sstevel@tonic-gate }
3147c478bd9Sstevel@tonic-gate 
315986fd29aSsetje /*
316986fd29aSsetje  * file IO
317986fd29aSsetje  */
318986fd29aSsetje extern	int		prom_fopen(ihandle_t, char *);
319*e7cbe64fSgw25295 extern	int		prom_volopen(ihandle_t, char *);
320986fd29aSsetje extern	int		prom_fseek(ihandle_t, int, unsigned long long);
321986fd29aSsetje extern	int		prom_fread(ihandle_t, int, caddr_t, size_t);
322986fd29aSsetje extern	int		prom_fsize(ihandle_t, int, size_t *);
323986fd29aSsetje extern	int		prom_compinfo(ihandle_t, int, int *,
324986fd29aSsetje 			    size_t *, size_t *);
325986fd29aSsetje extern	void		prom_fclose(ihandle_t, int);
326986fd29aSsetje 
327986fd29aSsetje 
3287c478bd9Sstevel@tonic-gate #endif	/* _KERNEL || _KMDB */
3297c478bd9Sstevel@tonic-gate 
3307c478bd9Sstevel@tonic-gate #ifdef _KERNEL
3317c478bd9Sstevel@tonic-gate 
3327c478bd9Sstevel@tonic-gate /*
3337c478bd9Sstevel@tonic-gate  * Used by wrappers which bring up console frame buffer before prom_printf()
3347c478bd9Sstevel@tonic-gate  * and other prom calls that may output to the console.  Struct is filled in
3357c478bd9Sstevel@tonic-gate  * in prom_env.c and in sunpm.c
3367c478bd9Sstevel@tonic-gate  */
3377c478bd9Sstevel@tonic-gate 
3387c478bd9Sstevel@tonic-gate typedef struct promif_owrap {
3397c478bd9Sstevel@tonic-gate 	void (*preout)(void);
3407c478bd9Sstevel@tonic-gate 	void (*postout)(void);
3417c478bd9Sstevel@tonic-gate } promif_owrap_t;
3427c478bd9Sstevel@tonic-gate 
3437c478bd9Sstevel@tonic-gate /*
3447c478bd9Sstevel@tonic-gate  * WAN boot key storage interface
3457c478bd9Sstevel@tonic-gate  */
3467c478bd9Sstevel@tonic-gate int prom_set_security_key(char *keyname, caddr_t buf, int buflen, int *reslen,
3477c478bd9Sstevel@tonic-gate     int *status);
3487c478bd9Sstevel@tonic-gate int prom_get_security_key(char *keyname, caddr_t buf, int buflen, int *keylen,
3497c478bd9Sstevel@tonic-gate     int *status);
3507c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
3517c478bd9Sstevel@tonic-gate 
3527c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3537c478bd9Sstevel@tonic-gate }
3547c478bd9Sstevel@tonic-gate #endif
3557c478bd9Sstevel@tonic-gate 
3567c478bd9Sstevel@tonic-gate #endif /* _SYS_PROMIF_H */
357