xref: /original-bsd/usr.sbin/config/config.h (revision 557ac071)
1824762f1Sdist /*
2*557ac071Sbostic  * Copyright (c) 1980, 1993
3*557ac071Sbostic  *	The Regents of the University of California.  All rights reserved.
4824762f1Sdist  *
5f31bb95dSbostic  * %sccs.include.redist.c%
6923d6574Sbostic  *
7*557ac071Sbostic  *	@(#)config.h	8.1 (Berkeley) 06/06/93
8824762f1Sdist  */
9731d41e2Sroot 
100c8db73eStoy /*
11d0585f4aSroot  * Config.
120c8db73eStoy  */
132596fdabSsam #include <sys/types.h>
140172bd95Sbostic #include <stdlib.h>
150172bd95Sbostic #include <string.h>
162596fdabSsam 
172596fdabSsam #define	NODEV	((dev_t)-1)
182596fdabSsam 
190c8db73eStoy struct file_list {
202596fdabSsam 	struct	file_list *f_next;
21731d41e2Sroot 	char	*f_fn;			/* the name */
22f7692ae3Ssam 	u_char	f_type;			/* see below */
23f7692ae3Ssam 	u_char	f_flags;		/* see below */
246373cc2fSkarels 	char	*f_special;		/* special make rule if present */
250c8db73eStoy 	char	*f_needs;
262596fdabSsam 	/*
272596fdabSsam 	 * Random values:
282596fdabSsam 	 *	swap space parameters for swap areas
292596fdabSsam 	 *	root device, etc. for system specifications
302596fdabSsam 	 */
312596fdabSsam 	union {
322596fdabSsam 		struct {		/* when swap specification */
332596fdabSsam 			dev_t	fuw_swapdev;
342596fdabSsam 			int	fuw_swapsize;
35359e989cShibler 			int	fuw_swapflag;
362596fdabSsam 		} fuw;
372596fdabSsam 		struct {		/* when system specification */
382596fdabSsam 			dev_t	fus_rootdev;
392596fdabSsam 			dev_t	fus_dumpdev;
402596fdabSsam 		} fus;
41359e989cShibler 		struct {		/* when component dev specification */
42359e989cShibler 			dev_t	fup_compdev;
43359e989cShibler 			int	fup_compinfo;
44359e989cShibler 		} fup;
452596fdabSsam 	} fun;
462596fdabSsam #define	f_swapdev	fun.fuw.fuw_swapdev
472596fdabSsam #define	f_swapsize	fun.fuw.fuw_swapsize
48359e989cShibler #define	f_swapflag	fun.fuw.fuw_swapflag
492596fdabSsam #define	f_rootdev	fun.fus.fus_rootdev
502596fdabSsam #define	f_dumpdev	fun.fus.fus_dumpdev
51359e989cShibler #define f_compdev	fun.fup.fup_compdev
52359e989cShibler #define f_compinfo	fun.fup.fup_compinfo
530c8db73eStoy };
54f7692ae3Ssam 
55f7692ae3Ssam /*
56f7692ae3Ssam  * Types.
57f7692ae3Ssam  */
58731d41e2Sroot #define DRIVER		1
59731d41e2Sroot #define NORMAL		2
60731d41e2Sroot #define	INVISIBLE	3
61731d41e2Sroot #define	PROFILING	4
622596fdabSsam #define	SYSTEMSPEC	5
632596fdabSsam #define	SWAPSPEC	6
64359e989cShibler #define COMPDEVICE	7
65359e989cShibler #define COMPSPEC	8
660c8db73eStoy 
67f7692ae3Ssam /*
68f7692ae3Ssam  * Attributes (flags).
69f7692ae3Ssam  */
70f7692ae3Ssam #define	CONFIGDEP	1
71f7692ae3Ssam 
729d9298e0Sroot struct	idlst {
739d9298e0Sroot 	char	*id;
749d9298e0Sroot 	struct	idlst *id_next;
759d9298e0Sroot };
769d9298e0Sroot 
770c8db73eStoy struct device {
78d8672969Ssam 	int	d_type;			/* CONTROLLER, DEVICE, bus adaptor */
79731d41e2Sroot 	struct	device *d_conn;		/* what it is connected to */
80731d41e2Sroot 	char	*d_name;		/* name of device (e.g. rk11) */
81d0585f4aSroot 	struct	idlst *d_vec;		/* interrupt vectors */
82731d41e2Sroot 	int	d_pri;			/* interrupt priority */
83731d41e2Sroot 	int	d_addr;			/* address of csr */
84731d41e2Sroot 	int	d_unit;			/* unit number */
85731d41e2Sroot 	int	d_drive;		/* drive number */
86731d41e2Sroot 	int	d_slave;		/* slave number */
87ba1a8baaStoy #define QUES	-1	/* -1 means '?' */
88ba1a8baaStoy #define	UNKNOWN -2	/* -2 means not set yet */
89cab430bfSroot 	int	d_dk;			/* if init 1 set to number for iostat */
90839f508cSmckusick 	int	d_flags;		/* flags for device init */
9135683881Swilliam 	char	*d_port;		/* io port base manifest constant */
9235683881Swilliam 	int	d_portn;	/* io port base (if number not manifest) */
9335683881Swilliam 	char	*d_mask;		/* interrupt mask */
9435683881Swilliam 	int	d_maddr;		/* io memory base */
9535683881Swilliam 	int	d_msize;		/* io memory size */
9635683881Swilliam 	int	d_drq;			/* DMA request  */
9735683881Swilliam 	int	d_irq;			/* interrupt request  */
980c8db73eStoy 	struct	device *d_next;		/* Next one in list */
990c8db73eStoy };
100d0585f4aSroot #define TO_NEXUS	(struct device *)-1
101d8672969Ssam #define TO_VBA		(struct device *)-2
1020c8db73eStoy 
1030c8db73eStoy struct config {
1040c8db73eStoy 	char	*c_dev;
1050c8db73eStoy 	char	*s_sysname;
1060c8db73eStoy };
1070c8db73eStoy 
108731d41e2Sroot /*
109731d41e2Sroot  * Config has a global notion of which machine type is
110731d41e2Sroot  * being used.  It uses the name of the machine in choosing
111731d41e2Sroot  * files and directories.  Thus if the name of the machine is ``vax'',
112332fe87bSkarels  * it will build from ``Makefile.vax'' and use ``../vax/inline''
113731d41e2Sroot  * in the makerules, etc.
114731d41e2Sroot  */
115731d41e2Sroot int	machine;
116731d41e2Sroot char	*machinename;
117731d41e2Sroot #define	MACHINE_VAX	1
118d8672969Ssam #define	MACHINE_TAHOE	2
119839f508cSmckusick #define MACHINE_HP300	3
12035683881Swilliam #define	MACHINE_I386	4
12118752b5fSralph #define MACHINE_MIPS	5
12218752b5fSralph #define MACHINE_PMAX	6
1233c4ecf20Smckusick #define MACHINE_LUNA68K	7
124877e30caSmckusick #define MACHINE_NEWS3400	8
125731d41e2Sroot 
126731d41e2Sroot /*
127731d41e2Sroot  * For each machine, a set of CPU's may be specified as supported.
128731d41e2Sroot  * These and the options (below) are put in the C flags in the makefile.
129731d41e2Sroot  */
130ba1a8baaStoy struct cputype {
131ba1a8baaStoy 	char	*cpu_name;
132ba1a8baaStoy 	struct	cputype *cpu_next;
133ba1a8baaStoy } *cputype;
134731d41e2Sroot 
135731d41e2Sroot /*
136731d41e2Sroot  * A set of options may also be specified which are like CPU types,
137731d41e2Sroot  * but which may also specify values for the options.
13894407b3dSkarels  * A separate set of options may be defined for make-style options.
139731d41e2Sroot  */
14072f446f1Stoy struct opt {
14172f446f1Stoy 	char	*op_name;
142f34f2026Skre 	char	*op_value;
143d0585f4aSroot 	struct	opt *op_next;
14494407b3dSkarels } *opt, *mkopt;
145731d41e2Sroot 
146d0585f4aSroot char	*ident;
147d0585f4aSroot char	*ns();
148d0585f4aSroot char	*tc();
149d0585f4aSroot char	*qu();
150d0585f4aSroot char	*get_word();
1516373cc2fSkarels char	*get_quoted_word();
152d0585f4aSroot char	*path();
153d0585f4aSroot char	*raise();
154d0585f4aSroot 
155cab430bfSroot int	do_trace;
156731d41e2Sroot 
157731d41e2Sroot #if MACHINE_VAX
158cab430bfSroot int	seen_mba, seen_uba;
159731d41e2Sroot #endif
160d8672969Ssam #if MACHINE_TAHOE
161d8672969Ssam int	seen_vba;
162d8672969Ssam #endif
16335683881Swilliam #if MACHINE_I386
16435683881Swilliam int	seen_isa;
16535683881Swilliam #endif
166359e989cShibler int	seen_cd;
167731d41e2Sroot 
1680c8db73eStoy struct	device *connect();
1690c8db73eStoy struct	device *dtab;
1702596fdabSsam dev_t	nametodev();
1712596fdabSsam char	*devtoname();
172731d41e2Sroot 
1730c8db73eStoy char	errbuf[80];
1740c8db73eStoy int	yyline;
175731d41e2Sroot 
176359e989cShibler struct	file_list *ftab, *conf_list, **confp, *comp_list, **compp;
177731d41e2Sroot 
178b7637e2cSbostic int	zone, hadtz;
179731d41e2Sroot int	dst;
18047676501Smckusick int	hz;
181bd17112dSsam int	profiling;
182839f508cSmckusick int	debugging;
183731d41e2Sroot 
184731d41e2Sroot int	maxusers;
185731d41e2Sroot 
186731d41e2Sroot #define eq(a,b)	(!strcmp(a,b))
187