xref: /titanic_50/usr/src/stand/sys/bootsyms.h (revision 275c9da86e89f8abf71135cf63d9fc23671b2e60)
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_BOOTSYMS_H
28 #define	_SYS_BOOTSYMS_H
29 
30 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31 
32 /*
33  * This header file should not exist.
34  *
35  * Whether it be due to laziness, machismo, or just plain cluelessness, most
36  * of the symbols over in psm/stand are not properly prototyped anywhere.
37  *
38  * To workaround this, developers have adopted the horrendous practice of
39  * "externing" the symbols they need, leading to dozens of declarations of
40  * the same symbol which have to be kept in sync.  Unfortunately, no similar
41  * workaround exists for lint's pass2, which requires definitions for all
42  * symbols in order to properly perform cross-checks.
43  *
44  * Thus, this header file was created to address two problems:
45  *
46  *	1. The "extern" problem.  All files beneath stand/lib should #include
47  *	   this file rather than "extern" the symbol. Additionally, existing
48  *	   externs should be removed as convenient.
49  *
50  *	   Of course, eventually some brave soul needs to venture over to the
51  *	   slums of psm/stand and add all the proper header files, at which
52  *	   point this file can be disposed of.
53  *
54  *	2. The lint pass2 problem.  Specifically, this file is used to build
55  *	   llib-lfakeboot.ln, which is then used to properly lint the
56  *	   binaries under stand/lib.  See stand/lib/llib-lfakeboot for more
57  *	   details.
58  *
59  * Note that the set of symbols shared between stand/lib and psm/stand is
60  * itself a moving target.  As such, this file should be updated as needed
61  * so that it always contains the *minimum* set of shared symbols needed to
62  * avoid externs and placate lint.
63  */
64 
65 #include <sys/saio.h>
66 #ifdef __i386
67 #include <sys/obpdefs.h>	/* for phandle_t */
68 #include <sys/ihandle.h>	/* for struct ihandle (and its routines) */
69 #endif
70 
71 #ifdef __cplusplus
72 extern "C" {
73 #endif
74 
75 /*
76  * From psm/stand/boot/$(MACH)/common/fsconf.c:
77  */
78 extern int nfs_readsize;
79 extern int boot_nfsw;
80 extern struct boot_fs_ops *boot_fsw[];
81 extern struct boot_fs_ops *extendfs_ops;
82 extern struct boot_fs_ops *origfs_ops;
83 
84 /*
85  * From psm/stand/boot/common/boot.c:
86  */
87 extern int boothowto;
88 extern int verbosemode;
89 extern char *systype;
90 extern struct memlist *pfreelistp;
91 extern struct memlist *vfreelistp;
92 extern void set_default_filename(char *);
93 
94 /*
95  * From psm/stand/boot/common/heap_kmem.c:
96  */
97 extern void *bkmem_alloc(size_t);
98 extern void *bkmem_zalloc(size_t);
99 extern void bkmem_free(void *, size_t);
100 
101 /*
102  * From psm/stand/boot/$(MACH)/common/$(MACH)_standalloc.c:
103  */
104 extern caddr_t resalloc(enum RESOURCES, size_t, caddr_t, int);
105 extern void resfree(enum RESOURCES, caddr_t, size_t);
106 extern void reset_alloc(void);
107 
108 /*
109  * From psm/stand/lib/names/$(MACH)/common/mfgname.c: (libnames)
110  */
111 extern char *get_mfg_name(void);
112 
113 /*
114  * From psm/stand/boot/i386/common/boot_plat.c or
115  *      psm/stand/boot/sparcv9/sun4u/machdep.c:
116  */
117 extern int pagesize;
118 extern int global_pages;
119 
120 #ifdef __sparc
121 /*
122  * From psm/stand/boot/sparc/common/fsconf.c:
123  */
124 extern char *bootp_response;
125 
126 /*
127  * From psm/stand/boot/sparc/common/wanboot.c:
128  */
129 extern char *bootcfg;
130 #endif /* __sparc */
131 
132 #ifdef	__i386
133 /*
134  * From psm/stand/boot/i386/common/bootops.c:
135  */
136 extern char *new_root_type;
137 extern struct bootops bootops;
138 
139 /*
140  * From psm/stand/boot/i386/common/delayed.c:
141  */
142 typedef struct orf rffd_t;
143 extern void RAMfiletoprop(rffd_t *);
144 
145 /*
146  * From psm/stand/boot/i386/common/disk.c:
147  */
148 extern int is_floppy(int);
149 extern int is_floppy0(int);
150 extern int is_floppy1(int);
151 extern int read_blocks(struct ihandle *, daddr_t, int);
152 extern int floppy_status_changed(int);
153 extern int SilentDiskFailures;
154 
155 /*
156  * From psm/stand/boot/i386/common/disk.c:
157  */
158 extern int bgets(char *, int);
159 
160 /*
161  * From psm/stand/boot/i386/common/i386_memlist.c:
162  */
163 extern int insert_node(struct memlist **, struct memlist *);
164 extern struct memlist *search_list(struct memlist *, struct memlist *);
165 
166 /*
167  * From psm/stand/boot/i386/common/memory.c:
168  */
169 extern uint_t top_virtaddr;
170 extern uint32_t find_mem(unsigned int, int);
171 
172 /*
173  * From psm/stand/boot/i386/common/net_pxe.c:
174  */
175 extern int pxe_ack_cache(char **);
176 
177 /*
178  * From psm/stand/boot/i386/common/misc_utls.c:
179  */
180 extern void popup_prompt(char *, char *);
181 
182 /*
183  * From psm/stand/boot/i386/i86pc/srt0.s:
184  */
185 extern int Oldstyleboot;
186 extern uint_t bpd_loc;
187 extern struct bootops *bop;
188 extern struct pri_to_secboot *realp;
189 
190 /*
191  * From psm/stand/boot/intel/bootprop.c:
192  */
193 extern int bgetprop(struct bootops *, char *, caddr_t, int, phandle_t);
194 extern int bgetproplen(struct bootops *, char *, phandle_t);
195 extern int bsetprop(struct bootops *, char *, caddr_t, int, phandle_t);
196 #endif /* __i386 */
197 
198 #ifdef __cplusplus
199 }
200 #endif
201 
202 #endif /* _SYS_BOOTSYMS_H */
203