xref: /illumos-gate/usr/src/uts/sun/sys/promif.h (revision 9cb0a1d4)
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
5fea9cb91Slq  * Common Development and Distribution License (the "License").
6fea9cb91Slq  * 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  */
21fea9cb91Slq 
227c478bd9Sstevel@tonic-gate /*
23e7cbe64fSgw  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
25*9cb0a1d4SPeter Tribble  * Copyright 2019 Peter Tribble.
267c478bd9Sstevel@tonic-gate  */
277c478bd9Sstevel@tonic-gate 
287c478bd9Sstevel@tonic-gate #ifndef	_SYS_PROMIF_H
297c478bd9Sstevel@tonic-gate #define	_SYS_PROMIF_H
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate #include <sys/types.h>
327c478bd9Sstevel@tonic-gate #include <sys/obpdefs.h>
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_KMDB)
357c478bd9Sstevel@tonic-gate #include <sys/va_list.h>
367c478bd9Sstevel@tonic-gate #endif
377c478bd9Sstevel@tonic-gate 
387c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
397c478bd9Sstevel@tonic-gate extern "C" {
407c478bd9Sstevel@tonic-gate #endif
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate /*
437c478bd9Sstevel@tonic-gate  *  These are for V0 ops only.  We sometimes have to specify
447c478bd9Sstevel@tonic-gate  *  to promif which type of operation we need to perform
457c478bd9Sstevel@tonic-gate  *  and since we can't get such a property from a V0 prom, we
467c478bd9Sstevel@tonic-gate  *  sometimes just assume it.  V2 and later proms do the right thing.
477c478bd9Sstevel@tonic-gate  */
487c478bd9Sstevel@tonic-gate #define	BLOCK	0
497c478bd9Sstevel@tonic-gate #define	NETWORK	1
507c478bd9Sstevel@tonic-gate #define	BYTE	2
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate 
537c478bd9Sstevel@tonic-gate #if defined(_KERNEL) || defined(_KMDB)
547c478bd9Sstevel@tonic-gate 
557c478bd9Sstevel@tonic-gate #if !defined(_BOOT)
567c478bd9Sstevel@tonic-gate /*
577c478bd9Sstevel@tonic-gate  * Due to FCode on sun4u machines running in a pseudo-32-bit environment
587c478bd9Sstevel@tonic-gate  * we need to enable code in several of the promif routines to ensure
597c478bd9Sstevel@tonic-gate  * that 64-bit pointers from the kernel are not passed through the CIF
607c478bd9Sstevel@tonic-gate  * to OpenBoot.
617c478bd9Sstevel@tonic-gate  *
627c478bd9Sstevel@tonic-gate  * Client programs defining this token need to provide two callbacks to
637c478bd9Sstevel@tonic-gate  * allow the promif routines to allocate and free memory allocated from
647c478bd9Sstevel@tonic-gate  * the bottom 32-bits of the 64-bit address space:
657c478bd9Sstevel@tonic-gate  *
66*9cb0a1d4SPeter Tribble  *	void *promplat_alloc(size_t);
67*9cb0a1d4SPeter Tribble  *	void promplat_free(void *, size_t);
687c478bd9Sstevel@tonic-gate  *
697c478bd9Sstevel@tonic-gate  * The alloc function should guarantee that it will never return an
707c478bd9Sstevel@tonic-gate  * invalid pointer.
717c478bd9Sstevel@tonic-gate  */
727c478bd9Sstevel@tonic-gate #define	PROM_32BIT_ADDRS
737c478bd9Sstevel@tonic-gate #endif /* _BOOT */
747c478bd9Sstevel@tonic-gate 
757c478bd9Sstevel@tonic-gate typedef void promif_preprom_f(void);
767c478bd9Sstevel@tonic-gate typedef void promif_postprom_f(void);
777c478bd9Sstevel@tonic-gate 
787c478bd9Sstevel@tonic-gate /*
797c478bd9Sstevel@tonic-gate  * resource allocation group: OBP and IEEE 1275-1994.
807c478bd9Sstevel@tonic-gate  * prom_alloc is platform dependent on SPARC.
817c478bd9Sstevel@tonic-gate  */
827c478bd9Sstevel@tonic-gate extern	caddr_t		prom_alloc(caddr_t virthint, size_t size, uint_t align);
837c478bd9Sstevel@tonic-gate extern	void		prom_free(caddr_t virt, size_t size);
847c478bd9Sstevel@tonic-gate 
857c478bd9Sstevel@tonic-gate /*
867c478bd9Sstevel@tonic-gate  * Device tree and property group: OBP and IEEE 1275-1994.
877c478bd9Sstevel@tonic-gate  */
88fa9e4066Sahrens extern	pnode_t		prom_childnode(pnode_t nodeid);
89fa9e4066Sahrens extern	pnode_t		prom_nextnode(pnode_t nodeid);
90fa9e4066Sahrens extern	pnode_t		prom_parentnode(pnode_t nodeid);
91fa9e4066Sahrens extern	pnode_t		prom_rootnode(void);
92fa9e4066Sahrens extern	pnode_t		prom_chosennode(void);
93fa9e4066Sahrens extern	pnode_t		prom_alias_node(void);
94fa9e4066Sahrens extern	pnode_t		prom_optionsnode(void);
957c478bd9Sstevel@tonic-gate 
967c478bd9Sstevel@tonic-gate extern	int		prom_asr_list_keys_len();
977c478bd9Sstevel@tonic-gate extern	int		prom_asr_list_keys(caddr_t value);
987c478bd9Sstevel@tonic-gate extern	int		prom_asr_export_len();
997c478bd9Sstevel@tonic-gate extern	int		prom_asr_export(caddr_t value);
1007c478bd9Sstevel@tonic-gate extern	int		prom_asr_disable(char *keystr, int keystr_len,
1017c478bd9Sstevel@tonic-gate 			    char *reason, int reason_len);
1027c478bd9Sstevel@tonic-gate extern	int		prom_asr_enable(char *keystr, int keystr_len);
1037c478bd9Sstevel@tonic-gate 
104fa9e4066Sahrens extern	int		prom_getproplen(pnode_t nodeid, caddr_t name);
105fa9e4066Sahrens extern	int		prom_getprop(pnode_t nodeid, caddr_t name,
1067c478bd9Sstevel@tonic-gate 			    caddr_t value);
107fa9e4066Sahrens extern	caddr_t		prom_nextprop(pnode_t nodeid, caddr_t previous,
1087c478bd9Sstevel@tonic-gate 			    caddr_t next);
109fa9e4066Sahrens extern	int		prom_setprop(pnode_t nodeid, caddr_t name,
1107c478bd9Sstevel@tonic-gate 			    caddr_t value, int len);
1117c478bd9Sstevel@tonic-gate 
112fa9e4066Sahrens extern	int		prom_getnode_byname(pnode_t id, char *name);
113fa9e4066Sahrens extern	int		prom_devicetype(pnode_t id, char *type);
1147c478bd9Sstevel@tonic-gate 
1157c478bd9Sstevel@tonic-gate extern	char		*prom_decode_composite_string(void *buf,
1167c478bd9Sstevel@tonic-gate 			    size_t buflen, char *prev);
1177c478bd9Sstevel@tonic-gate 
1187c478bd9Sstevel@tonic-gate /*
1197c478bd9Sstevel@tonic-gate  * Device tree and property group: IEEE 1275-1994 Only.
1207c478bd9Sstevel@tonic-gate  */
121fa9e4066Sahrens extern	pnode_t		prom_finddevice(char *path);	/* Also on obp2.x */
1227c478bd9Sstevel@tonic-gate 
123fa9e4066Sahrens extern	int		prom_bounded_getprop(pnode_t nodeid,
1247c478bd9Sstevel@tonic-gate 			    caddr_t name, caddr_t buffer, int buflen);
1257c478bd9Sstevel@tonic-gate 
1267c478bd9Sstevel@tonic-gate extern	phandle_t	prom_getphandle(ihandle_t i);
1277c478bd9Sstevel@tonic-gate 
1287c478bd9Sstevel@tonic-gate /*
1297c478bd9Sstevel@tonic-gate  * Device pathnames and pathname conversion: OBP and IEEE 1275-1994.
1307c478bd9Sstevel@tonic-gate  */
1317c478bd9Sstevel@tonic-gate extern	int		prom_devname_from_pathname(char *path, char *buffer);
1327c478bd9Sstevel@tonic-gate extern	char		*prom_path_options(char *pathname);
1337c478bd9Sstevel@tonic-gate extern	char		*prom_path_gettoken(char *from, char *to);
1347c478bd9Sstevel@tonic-gate extern	void		prom_pathname(char *pathname);
1357c478bd9Sstevel@tonic-gate extern	void		prom_strip_options(char *from, char *to);
1367c478bd9Sstevel@tonic-gate 
1377c478bd9Sstevel@tonic-gate /*
1387c478bd9Sstevel@tonic-gate  * Device pathnames and pathname conversion: IEEE 1275-1994 only.
1397c478bd9Sstevel@tonic-gate  */
1407c478bd9Sstevel@tonic-gate extern	int		prom_ihandle_to_path(ihandle_t, char *buf,
1417c478bd9Sstevel@tonic-gate 			    uint_t buflen);
1427c478bd9Sstevel@tonic-gate extern	int		prom_phandle_to_path(phandle_t, char *buf,
1437c478bd9Sstevel@tonic-gate 			    uint_t buflen);
1447c478bd9Sstevel@tonic-gate 
1457c478bd9Sstevel@tonic-gate /*
1467c478bd9Sstevel@tonic-gate  * Special device nodes: OBP and IEEE 1275-1994.
1477c478bd9Sstevel@tonic-gate  */
1487c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_stdin_ihandle(void);
1497c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_stdout_ihandle(void);
150fa9e4066Sahrens extern	pnode_t		prom_stdin_node(void);
151fa9e4066Sahrens extern	pnode_t		prom_stdout_node(void);
1527c478bd9Sstevel@tonic-gate extern	char		*prom_stdinpath(void);
1537c478bd9Sstevel@tonic-gate extern	char		*prom_stdoutpath(void);
1547c478bd9Sstevel@tonic-gate extern	int		prom_stdin_devname(char *buffer);
1557c478bd9Sstevel@tonic-gate extern	int		prom_stdout_devname(char *buffer);
1567c478bd9Sstevel@tonic-gate extern	int		prom_stdin_is_keyboard(void);
1577c478bd9Sstevel@tonic-gate extern	int		prom_stdout_is_framebuffer(void);
1587c478bd9Sstevel@tonic-gate extern	int		prom_stdin_stdout_equivalence(void);
1597c478bd9Sstevel@tonic-gate 
160c9503a49Slq extern void		prom_get_tem_inverses(int *, int *);
161fea9cb91Slq extern void		prom_get_tem_size(size_t *, size_t *);
162fea9cb91Slq extern void		prom_get_tem_pos(uint32_t *, uint32_t *);
163fea9cb91Slq extern void		prom_get_term_font_size(int *, int *);
164fea9cb91Slq extern void		prom_hide_cursor(void);
165fea9cb91Slq 
1667c478bd9Sstevel@tonic-gate /*
1677c478bd9Sstevel@tonic-gate  * Special device nodes: IEEE 1275-1994 only.
1687c478bd9Sstevel@tonic-gate  */
1697c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_memory_ihandle(void);
1707c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_mmu_ihandle(void);
1717c478bd9Sstevel@tonic-gate 
1727c478bd9Sstevel@tonic-gate /*
1737c478bd9Sstevel@tonic-gate  * Administrative group: OBP and IEEE 1275-1994.
1747c478bd9Sstevel@tonic-gate  */
1757c478bd9Sstevel@tonic-gate extern	void		prom_enter_mon(void);
1767c478bd9Sstevel@tonic-gate extern	void		prom_exit_to_mon(void)
1777c478bd9Sstevel@tonic-gate 	__NORETURN;
1787c478bd9Sstevel@tonic-gate extern	void		prom_reboot(char *bootstr);
1797c478bd9Sstevel@tonic-gate 
1807c478bd9Sstevel@tonic-gate extern	void		prom_panic(char *string)
1817c478bd9Sstevel@tonic-gate 	__NORETURN;
1827c478bd9Sstevel@tonic-gate 
1837c478bd9Sstevel@tonic-gate extern	int		prom_getversion(void);
1847c478bd9Sstevel@tonic-gate extern	int		prom_is_openprom(void);
1857c478bd9Sstevel@tonic-gate extern	int		prom_is_p1275(void);
1867c478bd9Sstevel@tonic-gate extern	int		prom_version_name(char *buf, int buflen);
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate extern	void		*prom_mon_id(void);	/* SMCC/OBP platform centric */
1897c478bd9Sstevel@tonic-gate 
1907c478bd9Sstevel@tonic-gate extern	uint_t		prom_gettime(void);
1917c478bd9Sstevel@tonic-gate 
1927c478bd9Sstevel@tonic-gate extern	char		*prom_bootpath(void);
1937c478bd9Sstevel@tonic-gate extern	char		*prom_bootargs(void);
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate extern	void		prom_interpret(char *str, uintptr_t arg1,
1967c478bd9Sstevel@tonic-gate 			    uintptr_t arg2, uintptr_t arg3, uintptr_t arg4,
1977c478bd9Sstevel@tonic-gate 			    uintptr_t arg5);
1987c478bd9Sstevel@tonic-gate 
1997c478bd9Sstevel@tonic-gate /*
2007c478bd9Sstevel@tonic-gate  * Administrative group: OBP only.
2017c478bd9Sstevel@tonic-gate  */
2027c478bd9Sstevel@tonic-gate extern	int		prom_sethandler(void (*v0_func)(), void (*v2_func)());
2037c478bd9Sstevel@tonic-gate 
2047c478bd9Sstevel@tonic-gate extern	struct bootparam *prom_bootparam(void);
2057c478bd9Sstevel@tonic-gate 
2067c478bd9Sstevel@tonic-gate /*
2077c478bd9Sstevel@tonic-gate  * Administrative group: IEEE 1275-1994 only.
2087c478bd9Sstevel@tonic-gate  */
2097c478bd9Sstevel@tonic-gate extern void		*prom_set_callback(void *handler);
2107c478bd9Sstevel@tonic-gate extern void		prom_set_symbol_lookup(void *sym2val, void *val2sym);
2117c478bd9Sstevel@tonic-gate 
2127c478bd9Sstevel@tonic-gate /*
2137c478bd9Sstevel@tonic-gate  * Administrative group: IEEE 1275 only.
2147c478bd9Sstevel@tonic-gate  */
2157c478bd9Sstevel@tonic-gate extern	int		prom_test(char *service);
216fa9e4066Sahrens extern	int		prom_test_method(char *method, pnode_t node);
2177c478bd9Sstevel@tonic-gate 
2187c478bd9Sstevel@tonic-gate /*
2197c478bd9Sstevel@tonic-gate  * Promif support group: Generic.
2207c478bd9Sstevel@tonic-gate  */
2217c478bd9Sstevel@tonic-gate extern	void		prom_init(char *progname, void *prom_cookie);
2227c478bd9Sstevel@tonic-gate 
2237c478bd9Sstevel@tonic-gate extern	void		prom_set_preprom(promif_preprom_f *);
2247c478bd9Sstevel@tonic-gate extern	void		prom_set_postprom(promif_postprom_f *);
225fea9cb91Slq 
226fea9cb91Slq extern  void		prom_get_tem_pos(uint32_t *, uint32_t *);
227fea9cb91Slq extern	void		prom_get_tem_size(size_t *, size_t *);
228fea9cb91Slq 
229fea9cb91Slq typedef struct		__promif_redir_arg *promif_redir_arg_t;
230fea9cb91Slq typedef ssize_t		(*promif_redir_t)(promif_redir_arg_t,
231fea9cb91Slq 				uchar_t *, size_t);
232fea9cb91Slq extern  void		prom_set_stdout_redirect(promif_redir_t,
233fea9cb91Slq 				promif_redir_arg_t);
234fea9cb91Slq 
2357c478bd9Sstevel@tonic-gate extern	void		prom_suspend_prepost(void);
2367c478bd9Sstevel@tonic-gate extern	void		prom_resume_prepost(void);
2377c478bd9Sstevel@tonic-gate 
2387c478bd9Sstevel@tonic-gate extern	void		(*prom_set_nextprop_preprom(void (*)(void)))(void);
2397c478bd9Sstevel@tonic-gate extern	void		(*prom_set_nextprop_postprom(void (*)(void)))(void);
2407c478bd9Sstevel@tonic-gate 
2417c478bd9Sstevel@tonic-gate extern	void		prom_montrap(void (*funcptr)());
2427c478bd9Sstevel@tonic-gate 
2437c478bd9Sstevel@tonic-gate typedef uint_t		prom_generation_cookie_t;
2447c478bd9Sstevel@tonic-gate 
2457c478bd9Sstevel@tonic-gate extern	int		prom_tree_access(int (*callback)(void *arg,
2467c478bd9Sstevel@tonic-gate 				int has_changed), void *arg,
2477c478bd9Sstevel@tonic-gate 				prom_generation_cookie_t *);
2487c478bd9Sstevel@tonic-gate extern	int		prom_tree_update(int (*callback)(void *arg), void *arg);
2497c478bd9Sstevel@tonic-gate 
2507c478bd9Sstevel@tonic-gate /*
2517c478bd9Sstevel@tonic-gate  * I/O Group: OBP and IEEE 1275.
2527c478bd9Sstevel@tonic-gate  */
2537c478bd9Sstevel@tonic-gate extern	uchar_t		prom_getchar(void);
2547c478bd9Sstevel@tonic-gate extern	void		prom_putchar(char c);
2557c478bd9Sstevel@tonic-gate extern	int		prom_mayget(void);
2567c478bd9Sstevel@tonic-gate extern	int		prom_mayput(char c);
2577c478bd9Sstevel@tonic-gate 
2587c478bd9Sstevel@tonic-gate extern  int		prom_open(char *name);
2597c478bd9Sstevel@tonic-gate extern  int		prom_close(int fd);
2607c478bd9Sstevel@tonic-gate extern  ssize_t		prom_read(ihandle_t fd, caddr_t buf, size_t len,
2617c478bd9Sstevel@tonic-gate 			    uint_t startblk, char type);
2627c478bd9Sstevel@tonic-gate extern  ssize_t		prom_write(ihandle_t fd, caddr_t buf, size_t len,
2637c478bd9Sstevel@tonic-gate 			    uint_t startblk, char type);
2647c478bd9Sstevel@tonic-gate extern	int		prom_seek(int fd, u_longlong_t offset);
2657c478bd9Sstevel@tonic-gate 
2667c478bd9Sstevel@tonic-gate extern	void		prom_writestr(const char *buf, size_t bufsize);
267fa9e4066Sahrens extern	void		prom_pnode_to_pathname(pnode_t, char *);
2687c478bd9Sstevel@tonic-gate 
2697c478bd9Sstevel@tonic-gate /*PRINTFLIKE1*/
2707c478bd9Sstevel@tonic-gate extern	void		prom_printf(const char *fmt, ...)
2717c478bd9Sstevel@tonic-gate 	__PRINTFLIKE(1);
2727c478bd9Sstevel@tonic-gate #pragma rarely_called(prom_printf)
2737c478bd9Sstevel@tonic-gate 
2747c478bd9Sstevel@tonic-gate extern	void		prom_vprintf(const char *fmt, __va_list adx)
2757c478bd9Sstevel@tonic-gate 	__VPRINTFLIKE(1);
2767c478bd9Sstevel@tonic-gate #pragma rarely_called(prom_vprintf)
2777c478bd9Sstevel@tonic-gate 
2787c478bd9Sstevel@tonic-gate /*PRINTFLIKE2*/
2797c478bd9Sstevel@tonic-gate extern	char		*prom_sprintf(char *s, const char *fmt, ...)
2807c478bd9Sstevel@tonic-gate 	__PRINTFLIKE(2);
2817c478bd9Sstevel@tonic-gate extern	char		*prom_vsprintf(char *s, const char *fmt, __va_list adx)
2827c478bd9Sstevel@tonic-gate 	__VPRINTFLIKE(2);
2837c478bd9Sstevel@tonic-gate 
2847c478bd9Sstevel@tonic-gate #define	PROM_WALK_CONTINUE	0	/* keep walking to next node */
2857c478bd9Sstevel@tonic-gate #define	PROM_WALK_TERMINATE	1	/* abort walk now */
2867c478bd9Sstevel@tonic-gate 
287fa9e4066Sahrens extern	void		prom_walk_devs(pnode_t node,
288fa9e4066Sahrens 			    int (*f)(pnode_t, void *, void *),
2897c478bd9Sstevel@tonic-gate 			    void *arg, void *result);
2907c478bd9Sstevel@tonic-gate 
291fa9e4066Sahrens extern	pnode_t		prom_findnode_byname(pnode_t id, char *name);
292fa9e4066Sahrens extern	pnode_t		prom_findnode_bydevtype(pnode_t id, char *devtype);
2937c478bd9Sstevel@tonic-gate 
2947c478bd9Sstevel@tonic-gate #define	PROM_STOP	{	\
2957c478bd9Sstevel@tonic-gate 	prom_printf("File %s line %d\n", __FILE__, __LINE__); \
2967c478bd9Sstevel@tonic-gate 	prom_enter_mon();	\
2977c478bd9Sstevel@tonic-gate }
2987c478bd9Sstevel@tonic-gate 
299986fd29aSsetje /*
300986fd29aSsetje  * file IO
301986fd29aSsetje  */
302986fd29aSsetje extern	int		prom_fopen(ihandle_t, char *);
303e7cbe64fSgw extern	int		prom_volopen(ihandle_t, char *);
304986fd29aSsetje extern	int		prom_fseek(ihandle_t, int, unsigned long long);
305986fd29aSsetje extern	int		prom_fread(ihandle_t, int, caddr_t, size_t);
306986fd29aSsetje extern	int		prom_fsize(ihandle_t, int, size_t *);
307986fd29aSsetje extern	int		prom_compinfo(ihandle_t, int, int *,
308986fd29aSsetje 			    size_t *, size_t *);
309986fd29aSsetje extern	void		prom_fclose(ihandle_t, int);
310986fd29aSsetje 
311986fd29aSsetje 
3127c478bd9Sstevel@tonic-gate #endif	/* _KERNEL || _KMDB */
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate #ifdef _KERNEL
3157c478bd9Sstevel@tonic-gate 
3167c478bd9Sstevel@tonic-gate /*
3177c478bd9Sstevel@tonic-gate  * Used by wrappers which bring up console frame buffer before prom_printf()
3187c478bd9Sstevel@tonic-gate  * and other prom calls that may output to the console.  Struct is filled in
3197c478bd9Sstevel@tonic-gate  * in prom_env.c and in sunpm.c
3207c478bd9Sstevel@tonic-gate  */
3217c478bd9Sstevel@tonic-gate 
3227c478bd9Sstevel@tonic-gate typedef struct promif_owrap {
3237c478bd9Sstevel@tonic-gate 	void (*preout)(void);
3247c478bd9Sstevel@tonic-gate 	void (*postout)(void);
3257c478bd9Sstevel@tonic-gate } promif_owrap_t;
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate /*
3287c478bd9Sstevel@tonic-gate  * WAN boot key storage interface
3297c478bd9Sstevel@tonic-gate  */
3307c478bd9Sstevel@tonic-gate int prom_set_security_key(char *keyname, caddr_t buf, int buflen, int *reslen,
3317c478bd9Sstevel@tonic-gate     int *status);
3327c478bd9Sstevel@tonic-gate int prom_get_security_key(char *keyname, caddr_t buf, int buflen, int *keylen,
3337c478bd9Sstevel@tonic-gate     int *status);
3347c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
3357c478bd9Sstevel@tonic-gate 
3367c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3377c478bd9Sstevel@tonic-gate }
3387c478bd9Sstevel@tonic-gate #endif
3397c478bd9Sstevel@tonic-gate 
3407c478bd9Sstevel@tonic-gate #endif /* _SYS_PROMIF_H */
341