kernel: remove unused utsname_set_machine()
[unleashed.git] / usr / src / uts / sun / sys / promimpl.h
bloba890fb37cbae2a4e2bcc7f740bb075f5ed04f5af
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
19 * CDDL HEADER END
23 * Copyright 2006 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 header file; private to promif implementation.
35 * These interfaces are not 'exported' in the same sense as
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/prom_isa.h>
46 #if defined(_MACHDEP)
47 #include <sys/prom_plat.h>
48 #endif
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
54 extern int obp_romvec_version;
57 * XXX for chatty stuff in prom_stdinpath/prom_stdoutpath until proposed
58 * changes from romvec pathnames to root node properties for stdin/stdout
59 * pathnames.
62 /* #define PROM_DEBUG_STDPATH 1 */
65 * Debugging macros for the promif functions.
68 #define PROMIF_DMSG_VERBOSE 2
69 #define PROMIF_DMSG_NORMAL 1
71 extern int promif_debug; /* externally patchable */
73 #define PROMIF_DEBUG /* define this to enable debugging */
74 #define PROMIF_DEBUG_P1275 /* Debug 1275 client interface calls */
76 #ifdef PROMIF_DEBUG
77 #define PROMIF_DPRINTF(args) \
78 if (promif_debug) { \
79 if (promif_debug == PROMIF_DMSG_VERBOSE) \
80 prom_printf("file %s line %d: ", __FILE__, __LINE__); \
81 prom_printf args; \
83 #else
84 #define PROMIF_DPRINTF(args)
85 #endif /* PROMIF_DEBUG */
88 #define prom_decode_int(v) (v)
91 * minimum alignment required by prom
93 #define PROMIF_MIN_ALIGN 1
96 * Private utility routines (not exported as part of the interface)
99 extern char *prom_strcpy(char *s1, char *s2);
100 extern char *prom_strncpy(char *s1, char *s2, size_t n);
101 extern int prom_strcmp(char *s1, char *s2);
102 extern int prom_strncmp(char *s1, char *s2, size_t n);
103 extern int prom_strlen(char *s);
104 extern char *prom_strrchr(char *s1, char c);
105 extern char *prom_strcat(char *s1, char *s2);
106 extern char *prom_strchr(const char *, int);
109 * IEEE 1275 Routines defined by each platform using IEEE 1275:
112 extern void *p1275_cif_init(void *);
113 extern int p1275_cif_call(void *);
115 #if defined(PROM_32BIT_ADDRS)
117 * Client programs defining PROM_32BIT_ADDRS need to provide two
118 * callbacks to allow the promif routines to allocate and free memory
119 * allocated from the bottom 32-bits of the 64-bit address space.
121 extern void *promplat_alloc(size_t);
122 extern void promplat_free(void *, size_t);
123 extern void promplat_bcopy(const void *s1, void *s2, size_t n);
124 #endif
127 * More private globals
129 extern int prom_aligned_allocator;
130 extern void *p1275cif; /* P1275 client interface cookie */
133 * When this is non-NULL, the PROM output functions will attempt
134 * to redirect any thing directed to the PROM's stdout, which has
135 * been prequalified as being the console framebuffer.
137 extern promif_redir_arg_t promif_redirect_arg;
138 extern promif_redir_t promif_redirect;
141 * Every call into the prom is wrappered with these calls so that
142 * the caller can ensure that e.g. pre-emption is disabled
143 * while we're in the firmware. See 1109602.
145 extern void promif_preprom(void);
146 extern void promif_postprom(void);
148 extern void (*promif_setprop_preprom)(void);
149 extern void (*promif_setprop_postprom)(void);
151 extern void (*promif_nextprop_preprom)(void);
152 extern void (*promif_nextprop_postprom)(void);
155 * Some calls into the prom (those expected to generate output on the console)
156 * are wrappered with these calls so that the caller can ensure that
157 * the console framebuffer will be brought to full power before entering the
158 * firmware.
160 extern promif_owrap_t *promif_preout(void);
161 extern void promif_postout(promif_owrap_t *);
164 * The default allocator used in IEEE 1275 mode:
166 extern caddr_t (*promif_allocator)(caddr_t, uint_t, uint_t);
169 * The prom interface uses this string internally for prefixing error
170 * messages so that the "client" of the given instance of
171 * promif can be identified e.g. "boot", "kmdb" or "kernel".
173 * It is passed into the library via prom_init().
175 extern char promif_clntname[];
178 * The routine called when all else fails (and there may be no firmware
179 * interface at all!)
181 extern void prom_fatal_error(const char *);
184 * These functions are used by prom_prop.c for serializing i2c
185 * controller access on some platforms.
187 extern void (*prom_setprop_enter)(void);
188 extern void (*prom_setprop_exit)(void);
190 #ifdef __cplusplus
192 #endif
194 #endif /* !_SYS_PROMIMPL_H */