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