xref: /illumos-gate/usr/src/stand/sys/bootsyms.h (revision 03270635d68df6a0392fb8f4b7c04acad764648b)
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 (the "License").
6  * You may not use this file except in compliance with the License.
7  *
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.
12  *
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]
18  *
19  * CDDL HEADER END
20  */
21 /*
22  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef _SYS_BOOTSYMS_H
27 #define	_SYS_BOOTSYMS_H
28 
29 /*
30  * This header file should not exist.
31  *
32  * Whether it be due to laziness, machismo, or just plain cluelessness, most
33  * of the symbols over in psm/stand are not properly prototyped anywhere.
34  *
35  * To workaround this, developers have adopted the horrendous practice of
36  * "externing" the symbols they need, leading to dozens of declarations of
37  * the same symbol which have to be kept in sync.  Unfortunately, no similar
38  * workaround exists for lint's pass2, which requires definitions for all
39  * symbols in order to properly perform cross-checks.
40  *
41  * Thus, this header file was created to address two problems:
42  *
43  *	1. The "extern" problem.  All files beneath stand/lib should #include
44  *	   this file rather than "extern" the symbol. Additionally, existing
45  *	   externs should be removed as convenient.
46  *
47  *	   Of course, eventually some brave soul needs to venture over to the
48  *	   slums of psm/stand and add all the proper header files, at which
49  *	   point this file can be disposed of.
50  *
51  *	2. The lint pass2 problem.  Specifically, this file is used to build
52  *	   llib-lfakeboot.ln, which is then used to properly lint the
53  *	   binaries under stand/lib.  See stand/lib/llib-lfakeboot for more
54  *	   details.
55  *
56  * Note that the set of symbols shared between stand/lib and psm/stand is
57  * itself a moving target.  As such, this file should be updated as needed
58  * so that it always contains the *minimum* set of shared symbols needed to
59  * avoid externs and placate lint.
60  */
61 
62 #include <sys/saio.h>
63 
64 #ifdef __cplusplus
65 extern "C" {
66 #endif
67 
68 /*
69  * From psm/stand/boot/$(MACH)/common/fsconf.c:
70  */
71 extern int nfs_readsize;
72 extern int boot_nfsw;
73 extern struct boot_fs_ops *boot_fsw[];
74 extern struct boot_fs_ops *extendfs_ops;
75 extern struct boot_fs_ops *origfs_ops;
76 
77 /*
78  * From psm/stand/boot/common/boot.c:
79  */
80 extern int boothowto;
81 extern int verbosemode;
82 extern char *systype;
83 extern struct memlist *pfreelistp;
84 extern struct memlist *vfreelistp;
85 extern void set_default_filename(char *);
86 
87 /*
88  * From psm/stand/boot/common/heap_kmem.c:
89  */
90 extern void *bkmem_alloc(size_t);
91 extern void *bkmem_zalloc(size_t);
92 extern void bkmem_free(void *, size_t);
93 
94 /*
95  * From psm/stand/boot/$(MACH)/common/$(MACH)_standalloc.c:
96  */
97 extern caddr_t resalloc(enum RESOURCES, size_t, caddr_t, int);
98 extern void resfree(enum RESOURCES, caddr_t, size_t);
99 extern void reset_alloc(void);
100 
101 /*
102  * From psm/stand/lib/names/$(MACH)/common/mfgname.c: (libnames)
103  */
104 extern char *get_mfg_name(void);
105 
106 /*
107  * From psm/stand/boot/i386/common/boot_plat.c or
108  *      psm/stand/boot/sparcv9/sun4u/machdep.c:
109  */
110 extern int pagesize;
111 extern int global_pages;
112 
113 #ifdef __sparc
114 /*
115  * From psm/stand/boot/sparc/common/fsconf.c:
116  */
117 extern char *bootp_response;
118 #endif /* __sparc */
119 
120 #ifdef __cplusplus
121 }
122 #endif
123 
124 #endif /* _SYS_BOOTSYMS_H */
125