date and time created 88/07/22 16:08:01 by bostic
[unix-history] / usr / src / usr.sbin / config / config.h
CommitLineData
cd68466f
DF
1/*
2 * Copyright (c) 1980 Regents of the University of California.
86f9c1e9 3 * All rights reserved.
cd68466f 4 *
86f9c1e9 5 * Redistribution and use in source and binary forms are permitted
b8c620d6
KB
6 * provided that the above copyright notice and this paragraph are
7 * duplicated in all such forms and that any documentation,
8 * advertising materials, and other materials related to such
9 * distribution and use acknowledge that the software was developed
10 * by the University of California, Berkeley. The name of the
11 * University may not be used to endorse or promote products derived
12 * from this software without specific prior written permission.
13 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
14 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
15 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
86f9c1e9 16 *
b8c620d6 17 * @(#)config.h 5.8 (Berkeley) %G%
cd68466f 18 */
358ba8d4 19
12c6954d 20/*
22d68ad0 21 * Config.
12c6954d 22 */
36edb824
SL
23#include <sys/types.h>
24
25#define NODEV ((dev_t)-1)
26
358ba8d4 27struct file_list {
36edb824 28 struct file_list *f_next;
12c6954d 29 char *f_fn; /* the name */
3c812eeb
SL
30 u_char f_type; /* see below */
31 u_char f_flags; /* see below */
3b3885f0 32 short f_special; /* requires special make rule */
12c6954d 33 char *f_needs;
36edb824
SL
34 /*
35 * Random values:
36 * swap space parameters for swap areas
37 * root device, etc. for system specifications
38 */
39 union {
40 struct { /* when swap specification */
41 dev_t fuw_swapdev;
42 int fuw_swapsize;
43 } fuw;
44 struct { /* when system specification */
45 dev_t fus_rootdev;
46 dev_t fus_argdev;
47 dev_t fus_dumpdev;
48 } fus;
49 } fun;
50#define f_swapdev fun.fuw.fuw_swapdev
51#define f_swapsize fun.fuw.fuw_swapsize
52#define f_rootdev fun.fus.fus_rootdev
53#define f_argdev fun.fus.fus_argdev
54#define f_dumpdev fun.fus.fus_dumpdev
358ba8d4 55};
3c812eeb
SL
56
57/*
58 * Types.
59 */
12c6954d
BJ
60#define DRIVER 1
61#define NORMAL 2
62#define INVISIBLE 3
63#define PROFILING 4
36edb824
SL
64#define SYSTEMSPEC 5
65#define SWAPSPEC 6
358ba8d4 66
3c812eeb
SL
67/*
68 * Attributes (flags).
69 */
70#define CONFIGDEP 1
71
08f9a943 72struct idlst {
12c6954d
BJ
73 char *id;
74 struct idlst *id_next;
08f9a943
BJ
75};
76
358ba8d4 77struct device {
a0105456 78 int d_type; /* CONTROLLER, DEVICE, bus adaptor */
12c6954d
BJ
79 struct device *d_conn; /* what it is connected to */
80 char *d_name; /* name of device (e.g. rk11) */
22d68ad0 81 struct idlst *d_vec; /* interrupt vectors */
12c6954d
BJ
82 int d_pri; /* interrupt priority */
83 int d_addr; /* address of csr */
84 int d_unit; /* unit number */
85 int d_drive; /* drive number */
86 int d_slave; /* slave number */
a5e18d6b
MT
87#define QUES -1 /* -1 means '?' */
88#define UNKNOWN -2 /* -2 means not set yet */
821eeaae 89 int d_dk; /* if init 1 set to number for iostat */
12c6954d
BJ
90 int d_flags; /* nlags for device init */
91 struct device *d_next; /* Next one in list */
358ba8d4 92};
22d68ad0 93#define TO_NEXUS (struct device *)-1
a0105456 94#define TO_VBA (struct device *)-2
358ba8d4
MT
95
96struct config {
12c6954d
BJ
97 char *c_dev;
98 char *s_sysname;
358ba8d4
MT
99};
100
12c6954d
BJ
101/*
102 * Config has a global notion of which machine type is
103 * being used. It uses the name of the machine in choosing
104 * files and directories. Thus if the name of the machine is ``vax'',
05b83a6c 105 * it will build from ``Makefile.vax'' and use ``../vax/inline''
12c6954d
BJ
106 * in the makerules, etc.
107 */
108int machine;
109char *machinename;
110#define MACHINE_VAX 1
a0105456 111#define MACHINE_TAHOE 2
12c6954d
BJ
112
113/*
114 * For each machine, a set of CPU's may be specified as supported.
115 * These and the options (below) are put in the C flags in the makefile.
116 */
a5e18d6b 117struct cputype {
12c6954d
BJ
118 char *cpu_name;
119 struct cputype *cpu_next;
a5e18d6b 120} *cputype;
12c6954d
BJ
121
122/*
123 * A set of options may also be specified which are like CPU types,
124 * but which may also specify values for the options.
7c1d4665 125 * A separate set of options may be defined for make-style options.
12c6954d 126 */
e809ccba 127struct opt {
12c6954d
BJ
128 char *op_name;
129 char *op_value;
22d68ad0 130 struct opt *op_next;
7c1d4665 131} *opt, *mkopt;
12c6954d 132
22d68ad0
BJ
133char *ident;
134char *ns();
135char *tc();
136char *qu();
137char *get_word();
138char *path();
139char *raise();
140
821eeaae 141int do_trace;
12c6954d 142
22d68ad0
BJ
143char *index();
144char *rindex();
145char *malloc();
146char *strcpy();
147char *strcat();
22d68ad0 148
12c6954d 149#if MACHINE_VAX
821eeaae 150int seen_mba, seen_uba;
12c6954d 151#endif
a0105456
SL
152#if MACHINE_TAHOE
153int seen_vba;
154#endif
12c6954d
BJ
155
156struct device *connect();
157struct device *dtab;
36edb824
SL
158dev_t nametodev();
159char *devtoname();
12c6954d
BJ
160
161char errbuf[80];
162int yyline;
163
36edb824 164struct file_list *ftab, *conf_list, **confp;
12c6954d 165
22d68ad0 166int timezone, hadtz;
12c6954d 167int dst;
8486638c 168int profiling;
12c6954d
BJ
169
170int maxusers;
171
172#define eq(a,b) (!strcmp(a,b))