2 * Mach Operating System
3 * Copyright (c) 1990 Carnegie-Mellon University
4 * Copyright (c) 1989 Carnegie-Mellon University
5 * Copyright (c) 1988 Carnegie-Mellon University
6 * Copyright (c) 1987 Carnegie-Mellon University
7 * All rights reserved. The CMU software License Agreement specifies
8 * the terms and conditions for use and redistribution.
12 * Copyright (c) 1988 Regents of the University of California.
13 * All rights reserved.
15 * Redistribution and use in source and binary forms are permitted
16 * provided that the above copyright notice and this paragraph are
17 * duplicated in all such forms and that any documentation,
18 * advertising materials, and other materials related to such
19 * distribution and use acknowledge that the software was developed
20 * by the University of California, Berkeley. The name of the
21 * University may not be used to endorse or promote products derived
22 * from this software without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
24 * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
25 * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27 * @(#)config.y 5.8 (Berkeley) 6/18/88
33 struct file_list *file;
64 struct device *curp = 0;
71 void deverror(const char *systemname, const char *devtype);
91 { do_trace = !do_trace; } |
99 { machinename = ns($2); }
103 MAKEOPTIONS Mkopt_list
106 { build_directory = ns($2); }
109 { object_directory = ns($2); }
112 { source_directory = ns($2); }
117 Opt_list COMMA Option
125 struct opt *op = (struct opt *)malloc(sizeof (struct opt));
126 op->op_name = ns($1);
127 op->op_next = (struct opt *) 0;
129 if (opt == (struct opt *) 0)
132 opt_tail->op_next = op;
136 Save_id EQUALS Opt_value
138 struct opt *op = (struct opt *)malloc(sizeof (struct opt));
139 op->op_name = ns($1);
140 op->op_next = (struct opt *) 0;
141 op->op_value = ns($3);
142 if (opt == (struct opt *) 0)
145 opt_tail->op_next = op;
154 { $$ = val_id = ns($1); } |
157 (void) sprintf(nb, "%u", $1);
158 $$ = val_id = ns(nb);
160 /* lambda from MIPS -- WHY */
161 { $$ = val_id = ns(""); }
166 { $$ = temp_id = ns($1); }
170 Mkopt_list COMMA Mkoption
178 struct opt *op = (struct opt *)malloc(sizeof (struct opt));
179 op->op_name = ns($1);
180 op->op_next = (struct opt *) 0;
185 Save_id EQUALS Opt_value
187 struct opt *op = (struct opt *)malloc(sizeof (struct opt));
188 op->op_name = ns($1);
189 op->op_next = (struct opt *) 0;
190 op->op_value = ns($3);
191 if (mkopt == (struct opt *) 0)
194 mkopt_tail->op_next = op;
207 PSEUDO_DEVICE Init_dev Dev
210 cur.d_type = PSEUDO_DEVICE;
212 PSEUDO_DEVICE Init_dev Dev NUMBER
215 cur.d_type = PSEUDO_DEVICE;
218 PSEUDO_DEVICE Init_dev Dev INIT ID
221 cur.d_type = PSEUDO_DEVICE;
224 PSEUDO_DEVICE Init_dev Dev NUMBER INIT ID
227 cur.d_type = PSEUDO_DEVICE;
239 yyerror(const char *s)
241 fprintf(stderr, "config: line %d: %s\n", yyline, s);
245 * return the passed string in a new space
252 cp = malloc((unsigned)(strlen(str)+1));
253 (void) strcpy(cp, str);
258 * add a device to the list of devices
261 newdev(struct device *dp)
263 register struct device *np;
265 np = (struct device *) malloc(sizeof *np);
276 init_dev(struct device *dp)
279 dp->d_name = "OHNO!!!";
280 dp->d_type = PSEUDO_DEVICE;
282 dp->d_slave = UNKNOWN;
287 deverror(const char *systemname, const char *devtype)
290 fprintf(stderr, "config: %s: %s device not configured\n",
291 systemname, devtype);