xref: /illumos-gate/usr/src/stand/sys/bootsyms.h (revision 20a7641f9918de8574b8b3b47dbe35c4bfc78df1)
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 the problems:
42  *
43  *	- 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  * Note that the set of symbols shared between stand/lib and psm/stand is
52  * itself a moving target.  As such, this file should be updated as needed
53  * so that it always contains the *minimum* set of shared symbols needed to
54  * avoid externs and placate lint.
55  */
56 
57 #include <sys/saio.h>
58 
59 #ifdef __cplusplus
60 extern "C" {
61 #endif
62 
63 /*
64  * From psm/stand/boot/$(MACH)/common/fsconf.c:
65  */
66 extern int nfs_readsize;
67 extern int boot_nfsw;
68 extern struct boot_fs_ops *boot_fsw[];
69 extern struct boot_fs_ops *extendfs_ops;
70 extern struct boot_fs_ops *origfs_ops;
71 
72 /*
73  * From psm/stand/boot/common/boot.c:
74  */
75 extern int boothowto;
76 extern int verbosemode;
77 extern char *systype;
78 extern struct memlist *pfreelistp;
79 extern struct memlist *vfreelistp;
80 extern void set_default_filename(char *);
81 
82 /*
83  * From psm/stand/boot/common/heap_kmem.c:
84  */
85 extern void *bkmem_alloc(size_t);
86 extern void *bkmem_zalloc(size_t);
87 extern void bkmem_free(void *, size_t);
88 
89 /*
90  * From psm/stand/boot/$(MACH)/common/$(MACH)_standalloc.c:
91  */
92 extern caddr_t resalloc(enum RESOURCES, size_t, caddr_t, int);
93 extern void resfree(enum RESOURCES, caddr_t, size_t);
94 extern void reset_alloc(void);
95 
96 /*
97  * From psm/stand/lib/names/$(MACH)/common/mfgname.c: (libnames)
98  */
99 extern char *get_mfg_name(void);
100 
101 /*
102  * From psm/stand/boot/i386/common/boot_plat.c or
103  *      psm/stand/boot/sparcv9/sun4u/machdep.c:
104  */
105 extern int pagesize;
106 extern int global_pages;
107 
108 #ifdef __sparc
109 /*
110  * From psm/stand/boot/sparc/common/fsconf.c:
111  */
112 extern char *bootp_response;
113 #endif /* __sparc */
114 
115 #ifdef __cplusplus
116 }
117 #endif
118 
119 #endif /* _SYS_BOOTSYMS_H */
120