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