xref: /original-bsd/usr.sbin/config/config.h (revision 9a897be2)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.
4  *
5  * %sccs.include.redist.c%
6  *
7  *	@(#)config.h	5.10 (Berkeley) 06/01/90
8  */
9 
10 /*
11  * Config.
12  */
13 #include <sys/types.h>
14 
15 #define	NODEV	((dev_t)-1)
16 
17 struct file_list {
18 	struct	file_list *f_next;
19 	char	*f_fn;			/* the name */
20 	u_char	f_type;			/* see below */
21 	u_char	f_flags;		/* see below */
22 	short	f_special;		/* requires special make rule */
23 	char	*f_needs;
24 	/*
25 	 * Random values:
26 	 *	swap space parameters for swap areas
27 	 *	root device, etc. for system specifications
28 	 */
29 	union {
30 		struct {		/* when swap specification */
31 			dev_t	fuw_swapdev;
32 			int	fuw_swapsize;
33 		} fuw;
34 		struct {		/* when system specification */
35 			dev_t	fus_rootdev;
36 			dev_t	fus_argdev;
37 			dev_t	fus_dumpdev;
38 		} fus;
39 	} fun;
40 #define	f_swapdev	fun.fuw.fuw_swapdev
41 #define	f_swapsize	fun.fuw.fuw_swapsize
42 #define	f_rootdev	fun.fus.fus_rootdev
43 #define	f_argdev	fun.fus.fus_argdev
44 #define	f_dumpdev	fun.fus.fus_dumpdev
45 };
46 
47 /*
48  * Types.
49  */
50 #define DRIVER		1
51 #define NORMAL		2
52 #define	INVISIBLE	3
53 #define	PROFILING	4
54 #define	SYSTEMSPEC	5
55 #define	SWAPSPEC	6
56 
57 /*
58  * Attributes (flags).
59  */
60 #define	CONFIGDEP	1
61 
62 struct	idlst {
63 	char	*id;
64 	struct	idlst *id_next;
65 };
66 
67 struct device {
68 	int	d_type;			/* CONTROLLER, DEVICE, bus adaptor */
69 	struct	device *d_conn;		/* what it is connected to */
70 	char	*d_name;		/* name of device (e.g. rk11) */
71 	struct	idlst *d_vec;		/* interrupt vectors */
72 	int	d_pri;			/* interrupt priority */
73 	int	d_addr;			/* address of csr */
74 	int	d_unit;			/* unit number */
75 	int	d_drive;		/* drive number */
76 	int	d_slave;		/* slave number */
77 #define QUES	-1	/* -1 means '?' */
78 #define	UNKNOWN -2	/* -2 means not set yet */
79 	int	d_dk;			/* if init 1 set to number for iostat */
80 	int	d_flags;		/* flags for device init */
81 	struct	device *d_next;		/* Next one in list */
82 };
83 #define TO_NEXUS	(struct device *)-1
84 #define TO_VBA		(struct device *)-2
85 
86 struct config {
87 	char	*c_dev;
88 	char	*s_sysname;
89 };
90 
91 /*
92  * Config has a global notion of which machine type is
93  * being used.  It uses the name of the machine in choosing
94  * files and directories.  Thus if the name of the machine is ``vax'',
95  * it will build from ``Makefile.vax'' and use ``../vax/inline''
96  * in the makerules, etc.
97  */
98 int	machine;
99 char	*machinename;
100 #define	MACHINE_VAX	1
101 #define	MACHINE_TAHOE	2
102 #define MACHINE_HP300	3
103 
104 /*
105  * For each machine, a set of CPU's may be specified as supported.
106  * These and the options (below) are put in the C flags in the makefile.
107  */
108 struct cputype {
109 	char	*cpu_name;
110 	struct	cputype *cpu_next;
111 } *cputype;
112 
113 /*
114  * A set of options may also be specified which are like CPU types,
115  * but which may also specify values for the options.
116  * A separate set of options may be defined for make-style options.
117  */
118 struct opt {
119 	char	*op_name;
120 	char	*op_value;
121 	struct	opt *op_next;
122 } *opt, *mkopt;
123 
124 char	*ident;
125 char	*ns();
126 char	*tc();
127 char	*qu();
128 char	*get_word();
129 char	*path();
130 char	*raise();
131 
132 int	do_trace;
133 
134 char	*index();
135 char	*rindex();
136 char	*malloc();
137 char	*strcpy();
138 char	*strcat();
139 
140 #if MACHINE_VAX
141 int	seen_mba, seen_uba;
142 #endif
143 #if MACHINE_TAHOE
144 int	seen_vba;
145 #endif
146 
147 struct	device *connect();
148 struct	device *dtab;
149 dev_t	nametodev();
150 char	*devtoname();
151 
152 char	errbuf[80];
153 int	yyline;
154 
155 struct	file_list *ftab, *conf_list, **confp;
156 
157 int	timezone, hadtz;
158 int	dst;
159 int	profiling;
160 int	debugging;
161 
162 int	maxusers;
163 
164 #define eq(a,b)	(!strcmp(a,b))
165