xref: /titanic_50/usr/src/uts/intel/sys/promimpl.h (revision 554ff184129088135ad2643c1c9832174a17be88)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef	_SYS_PROMIMPL_H
28 #define	_SYS_PROMIMPL_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * Promif implementation functions and variables.
34  *
35  * These interfaces are not 'exported' in the same sense that
36  * those described in promif.h
37  *
38  * Used so that the kernel and other stand-alones (eg boot)
39  * don't have to directly reference the prom (of which there
40  * are now several completely different variants).
41  */
42 
43 #include <sys/types.h>
44 #include <sys/promif.h>
45 #ifdef __ia64
46 /* XXX Merced -- these includes are for the ia64 simulator */
47 #include <sys/types_ia64.h>
48 #include <sys/ssc.h>
49 #endif
50 #include <sys/dditypes.h>
51 #include <sys/ddidmareq.h>
52 #include <sys/ddi_impldefs.h>
53 
54 #ifdef	__cplusplus
55 extern "C" {
56 #endif
57 
58 /*
59  * Debugging macros for the promif functions.
60  */
61 
62 #define	PROMIF_DMSG_VERBOSE		2
63 #define	PROMIF_DMSG_NORMAL		1
64 
65 extern int promif_debug;		/* externally patchable */
66 
67 #define	PROMIF_DEBUG			/* define this to enable debugging */
68 
69 #ifdef PROMIF_DEBUG
70 #define	PROMIF_DPRINTF(args)				\
71 	if (promif_debug) { 				\
72 		if (promif_debug == PROMIF_DMSG_VERBOSE)	\
73 			prom_printf("file %s line %d: ", __FILE__, __LINE__); \
74 		prom_printf args;			\
75 	}
76 #else
77 #define	PROMIF_DPRINTF(args)
78 #endif /* PROMIF_DEBUG */
79 
80 /*
81  * minimum alignment required by prom
82  */
83 #define	PROMIF_MIN_ALIGN	1
84 
85 /*
86  * Private utility routines (not exported as part of the interface)
87  */
88 
89 extern	char		*prom_strcpy(char *s1, char *s2);
90 extern	char		*prom_strncpy(char *s1, char *s2, size_t n);
91 extern	int		prom_strcmp(char *s1, char *s2);
92 extern	int		prom_strncmp(char *s1, char *s2, size_t n);
93 extern	int		prom_strlen(char *s);
94 extern	char		*prom_strrchr(char *s1, char c);
95 extern	char		*prom_strcat(char *s1, char *s2);
96 
97 /*
98  * Used to print a common before-reboot message.
99  */
100 extern	void		prom_reboot_prompt(void);
101 
102 /*
103  * Some calls into the prom (those expected to generate output on the console)
104  * are wrappered with these calls so that the caller can ensure that
105  * the console framebuffer will be brought to full power before entering the
106  * firmware.
107  */
108 extern	promif_owrap_t	*promif_preout(void);
109 extern	void		promif_postout(promif_owrap_t *);
110 
111 #ifdef	__cplusplus
112 }
113 #endif
114 
115 #endif /* !_SYS_PROMIMPL_H */
116