xref: /onnv-gate/usr/src/uts/intel/sys/promimpl.h (revision 641:057d58d31499)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
50Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
60Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
70Sstevel@tonic-gate  * with the License.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
100Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
110Sstevel@tonic-gate  * See the License for the specific language governing permissions
120Sstevel@tonic-gate  * and limitations under the License.
130Sstevel@tonic-gate  *
140Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
150Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
160Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
170Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
180Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
190Sstevel@tonic-gate  *
200Sstevel@tonic-gate  * CDDL HEADER END
210Sstevel@tonic-gate  */
220Sstevel@tonic-gate /*
23*641Skalai  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #ifndef	_SYS_PROMIMPL_H
280Sstevel@tonic-gate #define	_SYS_PROMIMPL_H
290Sstevel@tonic-gate 
300Sstevel@tonic-gate #pragma ident	"%Z%%M%	%I%	%E% SMI"
310Sstevel@tonic-gate 
320Sstevel@tonic-gate /*
330Sstevel@tonic-gate  * Promif implementation functions and variables.
340Sstevel@tonic-gate  *
350Sstevel@tonic-gate  * These interfaces are not 'exported' in the same sense that
360Sstevel@tonic-gate  * those described in promif.h
370Sstevel@tonic-gate  *
380Sstevel@tonic-gate  * Used so that the kernel and other stand-alones (eg boot)
390Sstevel@tonic-gate  * don't have to directly reference the prom (of which there
400Sstevel@tonic-gate  * are now several completely different variants).
410Sstevel@tonic-gate  */
420Sstevel@tonic-gate 
430Sstevel@tonic-gate #include <sys/types.h>
440Sstevel@tonic-gate #include <sys/promif.h>
450Sstevel@tonic-gate #include <sys/dditypes.h>
460Sstevel@tonic-gate #include <sys/ddidmareq.h>
470Sstevel@tonic-gate #include <sys/ddi_impldefs.h>
480Sstevel@tonic-gate 
490Sstevel@tonic-gate #ifdef	__cplusplus
500Sstevel@tonic-gate extern "C" {
510Sstevel@tonic-gate #endif
520Sstevel@tonic-gate 
530Sstevel@tonic-gate /*
540Sstevel@tonic-gate  * Debugging macros for the promif functions.
550Sstevel@tonic-gate  */
560Sstevel@tonic-gate 
570Sstevel@tonic-gate #define	PROMIF_DMSG_VERBOSE		2
580Sstevel@tonic-gate #define	PROMIF_DMSG_NORMAL		1
590Sstevel@tonic-gate 
600Sstevel@tonic-gate extern int promif_debug;		/* externally patchable */
610Sstevel@tonic-gate 
620Sstevel@tonic-gate #define	PROMIF_DEBUG			/* define this to enable debugging */
630Sstevel@tonic-gate 
640Sstevel@tonic-gate #ifdef PROMIF_DEBUG
650Sstevel@tonic-gate #define	PROMIF_DPRINTF(args)				\
660Sstevel@tonic-gate 	if (promif_debug) { 				\
670Sstevel@tonic-gate 		if (promif_debug == PROMIF_DMSG_VERBOSE)	\
680Sstevel@tonic-gate 			prom_printf("file %s line %d: ", __FILE__, __LINE__); \
690Sstevel@tonic-gate 		prom_printf args;			\
700Sstevel@tonic-gate 	}
710Sstevel@tonic-gate #else
720Sstevel@tonic-gate #define	PROMIF_DPRINTF(args)
730Sstevel@tonic-gate #endif /* PROMIF_DEBUG */
740Sstevel@tonic-gate 
750Sstevel@tonic-gate /*
760Sstevel@tonic-gate  * minimum alignment required by prom
770Sstevel@tonic-gate  */
780Sstevel@tonic-gate #define	PROMIF_MIN_ALIGN	1
790Sstevel@tonic-gate 
800Sstevel@tonic-gate /*
810Sstevel@tonic-gate  * Private utility routines (not exported as part of the interface)
820Sstevel@tonic-gate  */
830Sstevel@tonic-gate 
840Sstevel@tonic-gate extern	char		*prom_strcpy(char *s1, char *s2);
850Sstevel@tonic-gate extern	char		*prom_strncpy(char *s1, char *s2, size_t n);
860Sstevel@tonic-gate extern	int		prom_strcmp(char *s1, char *s2);
870Sstevel@tonic-gate extern	int		prom_strncmp(char *s1, char *s2, size_t n);
880Sstevel@tonic-gate extern	int		prom_strlen(char *s);
890Sstevel@tonic-gate extern	char		*prom_strrchr(char *s1, char c);
900Sstevel@tonic-gate extern	char		*prom_strcat(char *s1, char *s2);
910Sstevel@tonic-gate 
920Sstevel@tonic-gate /*
930Sstevel@tonic-gate  * Used to print a common before-reboot message.
940Sstevel@tonic-gate  */
950Sstevel@tonic-gate extern	void		prom_reboot_prompt(void);
960Sstevel@tonic-gate 
970Sstevel@tonic-gate /*
980Sstevel@tonic-gate  * Some calls into the prom (those expected to generate output on the console)
990Sstevel@tonic-gate  * are wrappered with these calls so that the caller can ensure that
1000Sstevel@tonic-gate  * the console framebuffer will be brought to full power before entering the
1010Sstevel@tonic-gate  * firmware.
1020Sstevel@tonic-gate  */
1030Sstevel@tonic-gate extern	promif_owrap_t	*promif_preout(void);
1040Sstevel@tonic-gate extern	void		promif_postout(promif_owrap_t *);
1050Sstevel@tonic-gate 
1060Sstevel@tonic-gate #ifdef	__cplusplus
1070Sstevel@tonic-gate }
1080Sstevel@tonic-gate #endif
1090Sstevel@tonic-gate 
1100Sstevel@tonic-gate #endif /* !_SYS_PROMIMPL_H */
111