xref: /titanic_53/usr/src/uts/sun/sys/promif.h (revision fa9e4066f08beec538e775443c5be79dd423fcab)
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
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
23*fa9e4066Sahrens  * Copyright 2005 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  */
89*fa9e4066Sahrens extern	pnode_t		prom_childnode(pnode_t nodeid);
90*fa9e4066Sahrens extern	pnode_t		prom_nextnode(pnode_t nodeid);
91*fa9e4066Sahrens extern	pnode_t		prom_parentnode(pnode_t nodeid);
92*fa9e4066Sahrens extern	pnode_t		prom_rootnode(void);
93*fa9e4066Sahrens extern	pnode_t		prom_chosennode(void);
94*fa9e4066Sahrens extern	pnode_t		prom_alias_node(void);
95*fa9e4066Sahrens 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 
105*fa9e4066Sahrens extern	int		prom_getproplen(pnode_t nodeid, caddr_t name);
106*fa9e4066Sahrens extern	int		prom_getprop(pnode_t nodeid, caddr_t name,
1077c478bd9Sstevel@tonic-gate 			    caddr_t value);
108*fa9e4066Sahrens extern	caddr_t		prom_nextprop(pnode_t nodeid, caddr_t previous,
1097c478bd9Sstevel@tonic-gate 			    caddr_t next);
110*fa9e4066Sahrens extern	int		prom_setprop(pnode_t nodeid, caddr_t name,
1117c478bd9Sstevel@tonic-gate 			    caddr_t value, int len);
1127c478bd9Sstevel@tonic-gate 
113*fa9e4066Sahrens extern	int		prom_getnode_byname(pnode_t id, char *name);
114*fa9e4066Sahrens 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  */
122*fa9e4066Sahrens extern	pnode_t		prom_finddevice(char *path);	/* Also on obp2.x */
1237c478bd9Sstevel@tonic-gate 
124*fa9e4066Sahrens 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);
151*fa9e4066Sahrens extern	pnode_t		prom_stdin_node(void);
152*fa9e4066Sahrens 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 
1617c478bd9Sstevel@tonic-gate /*
1627c478bd9Sstevel@tonic-gate  * Special device nodes: IEEE 1275-1994 only.
1637c478bd9Sstevel@tonic-gate  */
1647c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_memory_ihandle(void);
1657c478bd9Sstevel@tonic-gate extern	ihandle_t	prom_mmu_ihandle(void);
1667c478bd9Sstevel@tonic-gate 
1677c478bd9Sstevel@tonic-gate /*
1687c478bd9Sstevel@tonic-gate  * Administrative group: OBP and IEEE 1275-1994.
1697c478bd9Sstevel@tonic-gate  */
1707c478bd9Sstevel@tonic-gate extern	void		prom_enter_mon(void);
1717c478bd9Sstevel@tonic-gate extern	void		prom_exit_to_mon(void)
1727c478bd9Sstevel@tonic-gate 	__NORETURN;
1737c478bd9Sstevel@tonic-gate extern	void		prom_reboot(char *bootstr);
1747c478bd9Sstevel@tonic-gate 
1757c478bd9Sstevel@tonic-gate extern	void		prom_panic(char *string)
1767c478bd9Sstevel@tonic-gate 	__NORETURN;
1777c478bd9Sstevel@tonic-gate 
1787c478bd9Sstevel@tonic-gate extern	int		prom_getversion(void);
1797c478bd9Sstevel@tonic-gate extern	int		prom_is_openprom(void);
1807c478bd9Sstevel@tonic-gate extern	int		prom_is_p1275(void);
1817c478bd9Sstevel@tonic-gate extern	int		prom_version_name(char *buf, int buflen);
182*fa9e4066Sahrens extern	int		prom_version_check(char *buf, size_t len, pnode_t *n);
1837c478bd9Sstevel@tonic-gate 
1847c478bd9Sstevel@tonic-gate extern	void		*prom_mon_id(void);	/* SMCC/OBP platform centric */
1857c478bd9Sstevel@tonic-gate 
1867c478bd9Sstevel@tonic-gate extern	uint_t		prom_gettime(void);
1877c478bd9Sstevel@tonic-gate 
1887c478bd9Sstevel@tonic-gate extern	char		*prom_bootpath(void);
1897c478bd9Sstevel@tonic-gate extern	char		*prom_bootargs(void);
1907c478bd9Sstevel@tonic-gate 
1917c478bd9Sstevel@tonic-gate extern	void		prom_interpret(char *str, uintptr_t arg1,
1927c478bd9Sstevel@tonic-gate 			    uintptr_t arg2, uintptr_t arg3, uintptr_t arg4,
1937c478bd9Sstevel@tonic-gate 			    uintptr_t arg5);
1947c478bd9Sstevel@tonic-gate 
1957c478bd9Sstevel@tonic-gate /*
1967c478bd9Sstevel@tonic-gate  * Return code values from prom_version_check:
1977c478bd9Sstevel@tonic-gate  *
1987c478bd9Sstevel@tonic-gate  * This routine uses past-prediction mode to determine if the firmware
1997c478bd9Sstevel@tonic-gate  * on the current system is 64-bit ready.
2007c478bd9Sstevel@tonic-gate  *
2017c478bd9Sstevel@tonic-gate  * return code 2 could happen on a board-based server with a slave CPU board
2027c478bd9Sstevel@tonic-gate  * running down-rev firmware and the current master running adequate fw.
2037c478bd9Sstevel@tonic-gate  */
2047c478bd9Sstevel@tonic-gate #define	PROM_VER64_OK		0	/* Prom is 64-bit ready (or n/a) */
2057c478bd9Sstevel@tonic-gate #define	PROM_VER64_UPGRADE	1	/* Down-rev firmware is running */
2067c478bd9Sstevel@tonic-gate #define	PROM_VER64_SUGGEST	2	/* Down-rev firmware detected .. */
2077c478bd9Sstevel@tonic-gate 					/* .. but not currently active */
2087c478bd9Sstevel@tonic-gate 
2097c478bd9Sstevel@tonic-gate /*
2107c478bd9Sstevel@tonic-gate  * Administrative group: OBP only.
2117c478bd9Sstevel@tonic-gate  */
2127c478bd9Sstevel@tonic-gate extern	int		prom_sethandler(void (*v0_func)(), void (*v2_func)());
2137c478bd9Sstevel@tonic-gate 
2147c478bd9Sstevel@tonic-gate extern	struct bootparam *prom_bootparam(void);
2157c478bd9Sstevel@tonic-gate 
2167c478bd9Sstevel@tonic-gate /*
2177c478bd9Sstevel@tonic-gate  * Administrative group: IEEE 1275-1994 only.
2187c478bd9Sstevel@tonic-gate  */
2197c478bd9Sstevel@tonic-gate extern void		*prom_set_callback(void *handler);
2207c478bd9Sstevel@tonic-gate extern void		prom_set_symbol_lookup(void *sym2val, void *val2sym);
2217c478bd9Sstevel@tonic-gate 
2227c478bd9Sstevel@tonic-gate /*
2237c478bd9Sstevel@tonic-gate  * Administrative group: IEEE 1275 only.
2247c478bd9Sstevel@tonic-gate  */
2257c478bd9Sstevel@tonic-gate extern	int		prom_test(char *service);
226*fa9e4066Sahrens extern	int		prom_test_method(char *method, pnode_t node);
2277c478bd9Sstevel@tonic-gate 
2287c478bd9Sstevel@tonic-gate /*
2297c478bd9Sstevel@tonic-gate  * Promif support group: Generic.
2307c478bd9Sstevel@tonic-gate  */
2317c478bd9Sstevel@tonic-gate extern	void		prom_init(char *progname, void *prom_cookie);
2327c478bd9Sstevel@tonic-gate 
2337c478bd9Sstevel@tonic-gate extern	void		prom_set_preprom(promif_preprom_f *);
2347c478bd9Sstevel@tonic-gate extern	void		prom_set_postprom(promif_postprom_f *);
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);
267*fa9e4066Sahrens 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 
287*fa9e4066Sahrens extern	void		prom_walk_devs(pnode_t node,
288*fa9e4066Sahrens 			    int (*f)(pnode_t, void *, void *),
2897c478bd9Sstevel@tonic-gate 			    void *arg, void *result);
2907c478bd9Sstevel@tonic-gate 
291*fa9e4066Sahrens extern	pnode_t		prom_findnode_byname(pnode_t id, char *name);
292*fa9e4066Sahrens 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 
2997c478bd9Sstevel@tonic-gate #endif	/* _KERNEL || _KMDB */
3007c478bd9Sstevel@tonic-gate 
3017c478bd9Sstevel@tonic-gate #ifdef _KERNEL
3027c478bd9Sstevel@tonic-gate 
3037c478bd9Sstevel@tonic-gate /*
3047c478bd9Sstevel@tonic-gate  * Used by wrappers which bring up console frame buffer before prom_printf()
3057c478bd9Sstevel@tonic-gate  * and other prom calls that may output to the console.  Struct is filled in
3067c478bd9Sstevel@tonic-gate  * in prom_env.c and in sunpm.c
3077c478bd9Sstevel@tonic-gate  */
3087c478bd9Sstevel@tonic-gate 
3097c478bd9Sstevel@tonic-gate typedef struct promif_owrap {
3107c478bd9Sstevel@tonic-gate 	void (*preout)(void);
3117c478bd9Sstevel@tonic-gate 	void (*postout)(void);
3127c478bd9Sstevel@tonic-gate } promif_owrap_t;
3137c478bd9Sstevel@tonic-gate 
3147c478bd9Sstevel@tonic-gate /*
3157c478bd9Sstevel@tonic-gate  * WAN boot key storage interface
3167c478bd9Sstevel@tonic-gate  */
3177c478bd9Sstevel@tonic-gate int prom_set_security_key(char *keyname, caddr_t buf, int buflen, int *reslen,
3187c478bd9Sstevel@tonic-gate     int *status);
3197c478bd9Sstevel@tonic-gate int prom_get_security_key(char *keyname, caddr_t buf, int buflen, int *keylen,
3207c478bd9Sstevel@tonic-gate     int *status);
3217c478bd9Sstevel@tonic-gate #endif	/* _KERNEL */
3227c478bd9Sstevel@tonic-gate 
3237c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
3247c478bd9Sstevel@tonic-gate }
3257c478bd9Sstevel@tonic-gate #endif
3267c478bd9Sstevel@tonic-gate 
3277c478bd9Sstevel@tonic-gate #endif /* _SYS_PROMIF_H */
328