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