]>
git.saurik.com Git - apple/xnu.git/blob - SETUP/config/config.h
2 * Copyright (c) 1999-2009 Apple Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * "Portions Copyright (c) 1999 Apple Computer, Inc. All Rights
7 * Reserved. This file contains Original Code and/or Modifications of
8 * Original Code as defined in and that are subject to the Apple Public
9 * Source License Version 1.0 (the 'License'). You may not use this file
10 * except in compliance with the License. Please obtain a copy of the
11 * License at http://www.apple.com/publicsource and read it before using
14 * The Original Code and all software distributed under the License are
15 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
16 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
17 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
19 * License for the specific language governing rights and limitations
22 * @APPLE_LICENSE_HEADER_END@
25 * Mach Operating System
26 * Copyright (c) 1990 Carnegie-Mellon University
27 * Copyright (c) 1989 Carnegie-Mellon University
28 * Copyright (c) 1988 Carnegie-Mellon University
29 * Copyright (c) 1987 Carnegie-Mellon University
30 * All rights reserved. The CMU software License Agreement specifies
31 * the terms and conditions for use and redistribution.
35 * Copyright (c) 1980 Regents of the University of California.
36 * All rights reserved.
38 * Redistribution and use in source and binary forms are permitted
39 * provided that the above copyright notice and this paragraph are
40 * duplicated in all such forms and that any documentation,
41 * advertising materials, and other materials related to such
42 * distribution and use acknowledge that the software was developed
43 * by the University of California, Berkeley. The name of the
44 * University may not be used to endorse or promote products derived
45 * from this software without specific prior written permission.
46 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
47 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
48 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
50 * @(#)config.h 5.8 (Berkeley) 6/18/88
58 #include <sys/types.h>
59 #include <sys/param.h>
64 struct file_list
*f_next
;
65 char *f_fn
; /* the name */
66 u_char f_type
; /* see below */
67 u_char f_flags
; /* see below */
68 short f_special
; /* requires special make rule */
70 char *f_extra
; /* stuff to add to make line */
73 * swap space parameters for swap areas
74 * root device, etc. for system specifications
77 struct { /* when swap specification */
81 struct { /* when system specification */
87 #define f_swapdev fun.fuw.fuw_swapdev
88 #define f_swapsize fun.fuw.fuw_swapsize
89 #define f_rootdev fun.fus.fus_rootdev
90 #define f_argdev fun.fus.fus_argdev
91 #define f_dumpdev fun.fus.fus_dumpdev
105 * Attributes (flags).
107 #define CONFIGDEP 0x01 /* obsolete? */
108 #define OPTIONSDEF 0x02 /* options definition entry */
109 #define ORDERED 0x04 /* don't list in OBJ's, keep "files" order */
110 #define SEDIT 0x08 /* run sed filter (SQT) */
113 * Maximum number of fields for variable device fields (SQT).
119 struct idlst
*id_next
;
120 int id_vec
; /* Sun interrupt vector number */
124 int d_type
; /* CONTROLLER, DEVICE, bus adaptor */
125 struct device
*d_conn
; /* what it is connected to */
126 const char *d_name
; /* name of device (e.g. rk11) */
127 struct idlst
*d_vec
; /* interrupt vectors */
128 int d_pri
; /* interrupt priority */
129 int d_addr
; /* address of csr */
130 int d_unit
; /* unit number */
131 int d_drive
; /* drive number */
132 int d_slave
; /* slave number */
133 #define QUES -1 /* -1 means '?' */
134 #define UNKNOWN -2 /* -2 means not set yet */
135 int d_dk
; /* if init 1 set to number for iostat */
136 int d_flags
; /* nlags for device init */
137 struct device
*d_next
; /* Next one in list */
138 u_short d_mach
; /* Sun - machine type (0 = all)*/
139 u_short d_bus
; /* Sun - bus type (0 = unknown) */
140 u_long d_fields
[NFIELDS
]; /* fields values (SQT) */
141 int d_bin
; /* interrupt bin (SQT) */
142 int d_addrmod
; /* address modifier (MIPS) */
143 char *d_init
; /* pseudo device init routine name */
145 #define TO_NEXUS (struct device *)-1
146 #define TO_SLOT (struct device *)-1
154 * Config has a global notion of which machine type is
155 * being used. It uses the name of the machine in choosing
156 * files and directories. Thus if the name of the machine is ``vax'',
157 * it will build from ``Makefile.vax'' and use ``../vax/inline''
158 * in the makerules, etc.
161 extern const char *machinename
;
162 #define MACHINE_VAX 1
163 #define MACHINE_SUN 2
164 #define MACHINE_ROMP 3
165 #define MACHINE_SUN2 4
166 #define MACHINE_SUN3 5
167 #define MACHINE_MMAX 6
168 #define MACHINE_SQT 7
169 #define MACHINE_SUN4 8
170 #define MACHINE_I386 9
171 #define MACHINE_IX 10
172 #define MACHINE_MIPSY 11
173 #define MACHINE_MIPS 12
174 #define MACHINE_I860 13
175 #define MACHINE_M68K 14
176 #define MACHINE_M88K 15
177 #define MACHINE_M98K 16
178 #define MACHINE_HPPA 17
179 #define MACHINE_SPARC 18
180 #define MACHINE_PPC 19
181 #define MACHINE_ARM 20
182 #define MACHINE_X86_64 21
185 * For each machine, a set of CPU's may be specified as supported.
186 * These and the options (below) are put in the C flags in the makefile.
190 struct cputype
*cpu_next
;
193 extern struct cputype
*cputype
;
196 * In order to configure and build outside the kernel source tree,
197 * we may wish to specify where the source tree lives.
199 extern const char *source_directory
;
200 extern const char *object_directory
;
201 extern char *config_directory
;
203 FILE *fopenp(const char *fpath
, char *file
, char *complete
, const char *ftype
);
204 const char *get_VPATH(void);
205 #define VPATH get_VPATH()
208 * A set of options may also be specified which are like CPU types,
209 * but which may also specify values for the options.
210 * A separate set of options may be defined for make-style options.
218 extern struct opt
*opt
, *mkopt
, *opt_tail
, *mkopt_tail
;
221 const char *get_word(FILE *fp
);
222 char *ns(const char *str
);
224 char *path(const char *file
);
229 extern int seen_mba
, seen_uba
;
232 extern int seen_vme
, seen_mbii
;
234 extern struct device
*dtab
;
235 dev_t
nametodev(char *name
, int defunit
, char defpartition
);
236 char *devtoname(dev_t dev
);
238 extern char errbuf
[80];
241 extern struct file_list
*ftab
, *conf_list
, **confp
;
242 extern char *build_directory
;
244 extern int profiling
;
248 #define eq(a,b) (!strcmp(a,b))
258 /* External function references */
259 char *get_rest(FILE *fp
);
262 void yyerror(const char *s
);
264 void vax_ioconf(void);
265 void sun_ioconf(void);
266 void romp_ioconf(void);
267 void mmax_ioconf(void);
268 void sqt_ioconf(void);
269 void i386_ioconf(void);
270 void mips_ioconf(void);
271 void m68k_ioconf(void);
272 void m88k_ioconf(void);
273 void m98k_ioconf(void);
274 void hppa_ioconf(void);
275 void sparc_ioconf(void);
276 void ppc_ioconf(void);
277 void arm_ioconf(void);
278 void x86_64_ioconf(void);
287 int opteq(const char *cp
, const char *dp
);
289 void init_dev(struct device
*dp
);
290 void newdev(struct device
*dp
);
291 void dev_param(struct device
*dp
, const char *str
, long num
);
293 int searchp(const char *spath
, char *file
, char *fullname
, int (*func
)(char *));