Deleted Added
full compact
config.h (45775) config.h (46021)
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)config.h 8.1 (Berkeley) 6/6/93
34 */
35
36/*
37 * Config.
38 */
39#include <sys/types.h>
40#include <stdlib.h>
41#include <string.h>
42
43#define NODEV ((dev_t)-1)
44
45struct file_list {
46 struct file_list *f_next;
47 char *f_fn; /* the name */
48 int f_type; /* type or count */
49 u_char f_flags; /* see below */
50 char *f_special; /* special make rule if present */
51 char *f_depends; /* additional dependancies */
52 char *f_clean; /* File list to add to clean rule */
53 char *f_needs;
54 /*
55 * Random values:
56 * swap space parameters for swap areas
57 * root device, etc. for system specifications
58 */
59 union {
60 struct { /* when swap specification */
61 dev_t fuw_swapdev;
62 int fuw_swapsize;
63 int fuw_swapflag;
64 } fuw;
65 struct { /* when system specification */
66 dev_t fus_rootdev;
67 dev_t fus_dumpdev;
68 } fus;
69 struct { /* when component dev specification */
70 dev_t fup_compdev;
71 int fup_compinfo;
72 } fup;
73 } fun;
74#define f_swapdev fun.fuw.fuw_swapdev
75#define f_swapsize fun.fuw.fuw_swapsize
76#define f_swapflag fun.fuw.fuw_swapflag
77#define f_rootdev fun.fus.fus_rootdev
78#define f_dumpdev fun.fus.fus_dumpdev
79#define f_compdev fun.fup.fup_compdev
80#define f_compinfo fun.fup.fup_compinfo
81};
82
83/*
84 * Types.
85 */
86#define DRIVER 1
87#define NORMAL 2
88#define INVISIBLE 3
89#define PROFILING 4
90#define SYSTEMSPEC 5
91#define SWAPSPEC 6
92#define COMPDEVICE 7
1/*
2 * Copyright (c) 1980, 1993
3 * The Regents of the University of California. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 *
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
33 * @(#)config.h 8.1 (Berkeley) 6/6/93
34 */
35
36/*
37 * Config.
38 */
39#include <sys/types.h>
40#include <stdlib.h>
41#include <string.h>
42
43#define NODEV ((dev_t)-1)
44
45struct file_list {
46 struct file_list *f_next;
47 char *f_fn; /* the name */
48 int f_type; /* type or count */
49 u_char f_flags; /* see below */
50 char *f_special; /* special make rule if present */
51 char *f_depends; /* additional dependancies */
52 char *f_clean; /* File list to add to clean rule */
53 char *f_needs;
54 /*
55 * Random values:
56 * swap space parameters for swap areas
57 * root device, etc. for system specifications
58 */
59 union {
60 struct { /* when swap specification */
61 dev_t fuw_swapdev;
62 int fuw_swapsize;
63 int fuw_swapflag;
64 } fuw;
65 struct { /* when system specification */
66 dev_t fus_rootdev;
67 dev_t fus_dumpdev;
68 } fus;
69 struct { /* when component dev specification */
70 dev_t fup_compdev;
71 int fup_compinfo;
72 } fup;
73 } fun;
74#define f_swapdev fun.fuw.fuw_swapdev
75#define f_swapsize fun.fuw.fuw_swapsize
76#define f_swapflag fun.fuw.fuw_swapflag
77#define f_rootdev fun.fus.fus_rootdev
78#define f_dumpdev fun.fus.fus_dumpdev
79#define f_compdev fun.fup.fup_compdev
80#define f_compinfo fun.fup.fup_compinfo
81};
82
83/*
84 * Types.
85 */
86#define DRIVER 1
87#define NORMAL 2
88#define INVISIBLE 3
89#define PROFILING 4
90#define SYSTEMSPEC 5
91#define SWAPSPEC 6
92#define COMPDEVICE 7
93#define COMPSPEC 8
94#define NODEPEND 9
95#define LOCAL 10
93#define NODEPEND 8
94#define LOCAL 9
96#define DEVDONE 0x80000000
97#define TYPEMASK 0x7fffffff
98
99/*
100 * Attributes (flags).
101 */
102#define CONFIGDEP 1
103#define NO_IMPLCT_RULE 2
104#define NO_OBJ 4
105#define BEFORE_DEPEND 8
106
95#define DEVDONE 0x80000000
96#define TYPEMASK 0x7fffffff
97
98/*
99 * Attributes (flags).
100 */
101#define CONFIGDEP 1
102#define NO_IMPLCT_RULE 2
103#define NO_OBJ 4
104#define BEFORE_DEPEND 8
105
107struct idlst {
108 char *id;
109 struct idlst *id_next;
110};
111
112struct device {
113 int d_type; /* CONTROLLER, DEVICE, bus adaptor */
114 struct device *d_conn; /* what it is connected to */
115 char *d_name; /* name of device (e.g. rk11) */
106struct device {
107 int d_type; /* CONTROLLER, DEVICE, bus adaptor */
108 struct device *d_conn; /* what it is connected to */
109 char *d_name; /* name of device (e.g. rk11) */
116 struct idlst *d_vec; /* interrupt vectors */
117 int d_pri; /* interrupt priority */
118 int d_addr; /* address of csr */
119 int d_unit; /* unit number */
120 int d_drive; /* drive number */
121 int d_target; /* target number */
122 int d_lun; /* unit number */
123 int d_slave; /* slave number */
124#define QUES -1 /* -1 means '?' */
125#define UNKNOWN -2 /* -2 means not set yet */
126 int d_dk; /* if init 1 set to number for iostat */
127 int d_flags; /* flags for device init */
128 int d_conflicts; /* I'm allowed to conflict */
129 int d_disabled; /* nonzero to skip probe/attach */
130 char *d_port; /* io port base manifest constant */
131 int d_portn; /* io port base (if number not manifest) */
110 int d_unit; /* unit number */
111 int d_drive; /* drive number */
112 int d_target; /* target number */
113 int d_lun; /* unit number */
114 int d_slave; /* slave number */
115#define QUES -1 /* -1 means '?' */
116#define UNKNOWN -2 /* -2 means not set yet */
117 int d_dk; /* if init 1 set to number for iostat */
118 int d_flags; /* flags for device init */
119 int d_conflicts; /* I'm allowed to conflict */
120 int d_disabled; /* nonzero to skip probe/attach */
121 char *d_port; /* io port base manifest constant */
122 int d_portn; /* io port base (if number not manifest) */
132 char *d_mask; /* interrupt mask */
133 int d_maddr; /* io memory base */
134 int d_msize; /* io memory size */
135 int d_drq; /* DMA request */
136 int d_irq; /* interrupt request */
137 struct device *d_next; /* Next one in list */
138};
139#define TO_NEXUS (struct device *)-1
140#define TO_VBA (struct device *)-2
141
142struct config {
143 char *c_dev;
144 char *s_sysname;
145};
146
147/*
148 * Config has a global notion of which machine type is
149 * being used. It uses the name of the machine in choosing
150 * files and directories. Thus if the name of the machine is ``i386'',
151 * it will build from ``Makefile.i386'' and use ``../i386/inline''
152 * in the makerules, etc.
153 */
154int machine;
155char *machinename;
156#define MACHINE_I386 1
157#define MACHINE_PC98 2
158#define MACHINE_ALPHA 3
159
160/*
161 * For each machine, a set of CPU's may be specified as supported.
162 * These and the options (below) are put in the C flags in the makefile.
163 */
164struct cputype {
165 char *cpu_name;
166 struct cputype *cpu_next;
167} *cputype;
168
169/*
170 * A set of options may also be specified which are like CPU types,
171 * but which may also specify values for the options.
172 * A separate set of options may be defined for make-style options.
173 */
174struct opt {
175 char *op_name;
176 char *op_value;
177 int op_line; /* line number for error-reporting */
178 int op_ownfile; /* true = own file, false = makefile */
179 struct opt *op_next;
180} *opt, *mkopt;
181
182struct opt_list {
183 char *o_name;
184 char *o_file;
185 struct opt_list *o_next;
186} *otab;
187
188extern char *ident;
189extern int do_trace;
190
191char *get_word __P((FILE *));
192char *get_quoted_word __P((FILE *));
193char *path __P((char *));
194char *raisestr __P((char *));
195void moveifchanged __P((const char *, const char *));
196dev_t nametodev __P((char *, int, int, char));
197char *devtoname __P((dev_t));
198void init_dev __P((struct device *));
199void newbus_ioconf __P((void));
200int yyparse __P((void));
201int yylex __P((void));
202void options __P((void));
203void makefile __P((void));
204void headers __P((void));
205void swapconf __P((void));
206
207
208extern int seen_scbus;
209extern struct device *dtab;
210
211extern char errbuf[80];
212extern int yyline;
213
214extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
215
216extern int profiling;
217extern int debugging;
218
219extern int maxusers;
220extern u_int loadaddress;
221
222extern int old_config_present; /* Old config/build directory still there */
223
224extern char *PREFIX; /* Config file name - for error messages */
225
226#define eq(a,b) (!strcmp(a,b))
123 int d_maddr; /* io memory base */
124 int d_msize; /* io memory size */
125 int d_drq; /* DMA request */
126 int d_irq; /* interrupt request */
127 struct device *d_next; /* Next one in list */
128};
129#define TO_NEXUS (struct device *)-1
130#define TO_VBA (struct device *)-2
131
132struct config {
133 char *c_dev;
134 char *s_sysname;
135};
136
137/*
138 * Config has a global notion of which machine type is
139 * being used. It uses the name of the machine in choosing
140 * files and directories. Thus if the name of the machine is ``i386'',
141 * it will build from ``Makefile.i386'' and use ``../i386/inline''
142 * in the makerules, etc.
143 */
144int machine;
145char *machinename;
146#define MACHINE_I386 1
147#define MACHINE_PC98 2
148#define MACHINE_ALPHA 3
149
150/*
151 * For each machine, a set of CPU's may be specified as supported.
152 * These and the options (below) are put in the C flags in the makefile.
153 */
154struct cputype {
155 char *cpu_name;
156 struct cputype *cpu_next;
157} *cputype;
158
159/*
160 * A set of options may also be specified which are like CPU types,
161 * but which may also specify values for the options.
162 * A separate set of options may be defined for make-style options.
163 */
164struct opt {
165 char *op_name;
166 char *op_value;
167 int op_line; /* line number for error-reporting */
168 int op_ownfile; /* true = own file, false = makefile */
169 struct opt *op_next;
170} *opt, *mkopt;
171
172struct opt_list {
173 char *o_name;
174 char *o_file;
175 struct opt_list *o_next;
176} *otab;
177
178extern char *ident;
179extern int do_trace;
180
181char *get_word __P((FILE *));
182char *get_quoted_word __P((FILE *));
183char *path __P((char *));
184char *raisestr __P((char *));
185void moveifchanged __P((const char *, const char *));
186dev_t nametodev __P((char *, int, int, char));
187char *devtoname __P((dev_t));
188void init_dev __P((struct device *));
189void newbus_ioconf __P((void));
190int yyparse __P((void));
191int yylex __P((void));
192void options __P((void));
193void makefile __P((void));
194void headers __P((void));
195void swapconf __P((void));
196
197
198extern int seen_scbus;
199extern struct device *dtab;
200
201extern char errbuf[80];
202extern int yyline;
203
204extern struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
205
206extern int profiling;
207extern int debugging;
208
209extern int maxusers;
210extern u_int loadaddress;
211
212extern int old_config_present; /* Old config/build directory still there */
213
214extern char *PREFIX; /* Config file name - for error messages */
215
216#define eq(a,b) (!strcmp(a,b))