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
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.
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]
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _SYS_PROMIMPL_H
28 #define _SYS_PROMIMPL_H
30 #pragma ident "%Z%%M% %I% %E% SMI"
33 * Promif implementation functions and variables.
35 * These interfaces are not 'exported' in the same sense that
36 * those described in promif.h
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).
43 #include <sys/types.h>
44 #include <sys/promif.h>
45 #include <sys/dditypes.h>
46 #include <sys/ddidmareq.h>
47 #include <sys/ddi_impldefs.h>
54 * Debugging macros for the promif functions.
57 #define PROMIF_DMSG_VERBOSE 2
58 #define PROMIF_DMSG_NORMAL 1
60 extern int promif_debug
; /* externally patchable */
62 #define PROMIF_DEBUG /* define this to enable debugging */
65 #define PROMIF_DPRINTF(args) \
67 if (promif_debug == PROMIF_DMSG_VERBOSE) \
68 prom_printf("file %s line %d: ", __FILE__, __LINE__); \
72 #define PROMIF_DPRINTF(args)
73 #endif /* PROMIF_DEBUG */
76 * minimum alignment required by prom
78 #define PROMIF_MIN_ALIGN 1
81 * Private utility routines (not exported as part of the interface)
84 extern char *prom_strcpy(char *s1
, char *s2
);
85 extern char *prom_strncpy(char *s1
, char *s2
, size_t n
);
86 extern int prom_strcmp(char *s1
, char *s2
);
87 extern int prom_strncmp(char *s1
, char *s2
, size_t n
);
88 extern int prom_strlen(char *s
);
89 extern char *prom_strrchr(char *s1
, char c
);
90 extern char *prom_strcat(char *s1
, char *s2
);
93 * Used to print a common before-reboot message.
95 extern void prom_reboot_prompt(void);
98 * Some calls into the prom (those expected to generate output on the console)
99 * are wrappered with these calls so that the caller can ensure that
100 * the console framebuffer will be brought to full power before entering the
103 extern promif_owrap_t
*promif_preout(void);
104 extern void promif_postout(promif_owrap_t
*);
110 #endif /* !_SYS_PROMIMPL_H */