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