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