Kconfig reindented to 4 spaces.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -12,8 +12,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -30,7 +30,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)config.h 8.1 (Berkeley) 6/6/93
|
||||
* @(#)config.h 8.1 (Berkeley) 6/6/93
|
||||
*/
|
||||
|
||||
/*
|
||||
@@ -40,95 +40,95 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define NODEV ((dev_t)-1)
|
||||
#define NODEV ((dev_t)-1)
|
||||
|
||||
struct file_list {
|
||||
struct file_list *f_next;
|
||||
char *f_fn; /* the name */
|
||||
u_char f_type; /* see below */
|
||||
u_char f_flags; /* see below */
|
||||
char *f_special; /* special make rule if present */
|
||||
char *f_needs;
|
||||
/*
|
||||
* Random values:
|
||||
* swap space parameters for swap areas
|
||||
* root device, etc. for system specifications
|
||||
*/
|
||||
union {
|
||||
struct { /* when swap specification */
|
||||
dev_t fuw_swapdev;
|
||||
int fuw_swapsize;
|
||||
int fuw_swapflag;
|
||||
} fuw;
|
||||
struct { /* when system specification */
|
||||
dev_t fus_rootdev;
|
||||
dev_t fus_dumpdev;
|
||||
} fus;
|
||||
struct { /* when component dev specification */
|
||||
dev_t fup_compdev;
|
||||
int fup_compinfo;
|
||||
} fup;
|
||||
} fun;
|
||||
#define f_swapdev fun.fuw.fuw_swapdev
|
||||
#define f_swapsize fun.fuw.fuw_swapsize
|
||||
#define f_swapflag fun.fuw.fuw_swapflag
|
||||
#define f_rootdev fun.fus.fus_rootdev
|
||||
#define f_dumpdev fun.fus.fus_dumpdev
|
||||
#define f_compdev fun.fup.fup_compdev
|
||||
#define f_compinfo fun.fup.fup_compinfo
|
||||
struct file_list *f_next;
|
||||
char *f_fn; /* the name */
|
||||
u_char f_type; /* see below */
|
||||
u_char f_flags; /* see below */
|
||||
char *f_special; /* special make rule if present */
|
||||
char *f_needs;
|
||||
/*
|
||||
* Random values:
|
||||
* swap space parameters for swap areas
|
||||
* root device, etc. for system specifications
|
||||
*/
|
||||
union {
|
||||
struct { /* when swap specification */
|
||||
dev_t fuw_swapdev;
|
||||
int fuw_swapsize;
|
||||
int fuw_swapflag;
|
||||
} fuw;
|
||||
struct { /* when system specification */
|
||||
dev_t fus_rootdev;
|
||||
dev_t fus_dumpdev;
|
||||
} fus;
|
||||
struct { /* when component dev specification */
|
||||
dev_t fup_compdev;
|
||||
int fup_compinfo;
|
||||
} fup;
|
||||
} fun;
|
||||
#define f_swapdev fun.fuw.fuw_swapdev
|
||||
#define f_swapsize fun.fuw.fuw_swapsize
|
||||
#define f_swapflag fun.fuw.fuw_swapflag
|
||||
#define f_rootdev fun.fus.fus_rootdev
|
||||
#define f_dumpdev fun.fus.fus_dumpdev
|
||||
#define f_compdev fun.fup.fup_compdev
|
||||
#define f_compinfo fun.fup.fup_compinfo
|
||||
};
|
||||
|
||||
/*
|
||||
* Types.
|
||||
*/
|
||||
#define DRIVER 1
|
||||
#define NORMAL 2
|
||||
#define INVISIBLE 3
|
||||
#define PROFILING 4
|
||||
#define SYSTEMSPEC 5
|
||||
#define SWAPSPEC 6
|
||||
#define COMPDEVICE 7
|
||||
#define COMPSPEC 8
|
||||
#define DRIVER 1
|
||||
#define NORMAL 2
|
||||
#define INVISIBLE 3
|
||||
#define PROFILING 4
|
||||
#define SYSTEMSPEC 5
|
||||
#define SWAPSPEC 6
|
||||
#define COMPDEVICE 7
|
||||
#define COMPSPEC 8
|
||||
|
||||
/*
|
||||
* Attributes (flags).
|
||||
*/
|
||||
#define CONFIGDEP 1
|
||||
#define CONFIGDEP 1
|
||||
|
||||
struct idlst {
|
||||
char *id;
|
||||
struct idlst *id_next;
|
||||
struct idlst {
|
||||
char *id;
|
||||
struct idlst *id_next;
|
||||
};
|
||||
|
||||
struct device {
|
||||
int d_type; /* CONTROLLER, DEVICE, bus adaptor */
|
||||
struct device *d_conn; /* what it is connected to */
|
||||
char *d_name; /* name of device (e.g. rk11) */
|
||||
struct idlst *d_vec; /* interrupt vectors */
|
||||
int d_pri; /* interrupt priority */
|
||||
int d_addr; /* address of csr */
|
||||
int d_unit; /* unit number */
|
||||
int d_drive; /* drive number */
|
||||
int d_slave; /* slave number */
|
||||
#define QUES -1 /* -1 means '?' */
|
||||
#define UNKNOWN -2 /* -2 means not set yet */
|
||||
int d_dk; /* if init 1 set to number for iostat */
|
||||
int d_flags; /* flags for device init */
|
||||
char *d_port; /* io port base manifest constant */
|
||||
int d_portn; /* io port base (if number not manifest) */
|
||||
char *d_mask; /* interrupt mask */
|
||||
int d_maddr; /* io memory base */
|
||||
int d_msize; /* io memory size */
|
||||
int d_drq; /* DMA request */
|
||||
int d_irq; /* interrupt request */
|
||||
struct device *d_next; /* Next one in list */
|
||||
int d_type; /* CONTROLLER, DEVICE, bus adaptor */
|
||||
struct device *d_conn; /* what it is connected to */
|
||||
char *d_name; /* name of device (e.g. rk11) */
|
||||
struct idlst *d_vec; /* interrupt vectors */
|
||||
int d_pri; /* interrupt priority */
|
||||
int d_addr; /* address of csr */
|
||||
int d_unit; /* unit number */
|
||||
int d_drive; /* drive number */
|
||||
int d_slave; /* slave number */
|
||||
#define QUES -1 /* -1 means '?' */
|
||||
#define UNKNOWN -2 /* -2 means not set yet */
|
||||
int d_dk; /* if init 1 set to number for iostat */
|
||||
int d_flags; /* flags for device init */
|
||||
char *d_port; /* io port base manifest constant */
|
||||
int d_portn; /* io port base (if number not manifest) */
|
||||
char *d_mask; /* interrupt mask */
|
||||
int d_maddr; /* io memory base */
|
||||
int d_msize; /* io memory size */
|
||||
int d_drq; /* DMA request */
|
||||
int d_irq; /* interrupt request */
|
||||
struct device *d_next; /* Next one in list */
|
||||
};
|
||||
#define TO_NEXUS (struct device *)-1
|
||||
#define TO_VBA (struct device *)-2
|
||||
#define TO_NEXUS (struct device *)-1
|
||||
#define TO_VBA (struct device *)-2
|
||||
|
||||
struct config {
|
||||
char *c_dev;
|
||||
char *s_sysname;
|
||||
char *c_dev;
|
||||
char *s_sysname;
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -138,12 +138,12 @@ struct config {
|
||||
* it will build from ``Makefile.vax'' and use ``../vax/inline''
|
||||
* in the makerules, etc.
|
||||
*/
|
||||
int machine;
|
||||
char *machinename;
|
||||
#define MACHINE_VAX 1
|
||||
#define MACHINE_TAHOE 2
|
||||
int machine;
|
||||
char *machinename;
|
||||
#define MACHINE_VAX 1
|
||||
#define MACHINE_TAHOE 2
|
||||
#define MACHINE_HP300 3
|
||||
#define MACHINE_I386 4
|
||||
#define MACHINE_I386 4
|
||||
#define MACHINE_MIPS 5
|
||||
#define MACHINE_PMAX 6
|
||||
#define MACHINE_LUNA68K 7
|
||||
@@ -155,8 +155,8 @@ char *machinename;
|
||||
* These and the options (below) are put in the C flags in the makefile.
|
||||
*/
|
||||
struct cputype {
|
||||
char *cpu_name;
|
||||
struct cputype *cpu_next;
|
||||
char *cpu_name;
|
||||
struct cputype *cpu_next;
|
||||
} *cputype;
|
||||
|
||||
/*
|
||||
@@ -165,53 +165,53 @@ struct cputype {
|
||||
* A separate set of options may be defined for make-style options.
|
||||
*/
|
||||
struct opt {
|
||||
char *op_name;
|
||||
char *op_value;
|
||||
struct opt *op_next;
|
||||
char *op_name;
|
||||
char *op_value;
|
||||
struct opt *op_next;
|
||||
} *opt, *mkopt;
|
||||
|
||||
char *ident;
|
||||
char *ldscript;
|
||||
char *ns();
|
||||
char *tc();
|
||||
char *qu();
|
||||
char *get_word();
|
||||
char *get_quoted_word();
|
||||
char *path();
|
||||
char *raise();
|
||||
char *ident;
|
||||
char *ldscript;
|
||||
char *ns();
|
||||
char *tc();
|
||||
char *qu();
|
||||
char *get_word();
|
||||
char *get_quoted_word();
|
||||
char *path();
|
||||
char *raise();
|
||||
|
||||
int do_trace;
|
||||
int do_trace;
|
||||
|
||||
#if MACHINE_VAX
|
||||
int seen_mba, seen_uba;
|
||||
int seen_mba, seen_uba;
|
||||
#endif
|
||||
#if MACHINE_TAHOE
|
||||
int seen_vba;
|
||||
int seen_vba;
|
||||
#endif
|
||||
#if MACHINE_I386
|
||||
int seen_isa;
|
||||
int seen_isa;
|
||||
#endif
|
||||
int seen_cd;
|
||||
int seen_cd;
|
||||
|
||||
struct device *connect();
|
||||
struct device *dtab;
|
||||
dev_t nametodev();
|
||||
char *devtoname();
|
||||
struct device *connect();
|
||||
struct device *dtab;
|
||||
dev_t nametodev();
|
||||
char *devtoname();
|
||||
|
||||
char errbuf[80];
|
||||
int yyline;
|
||||
char errbuf[80];
|
||||
int yyline;
|
||||
|
||||
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
|
||||
struct file_list *ftab, *conf_list, **confp, *comp_list, **compp;
|
||||
|
||||
int zone, hadtz;
|
||||
int dst;
|
||||
int hz;
|
||||
int profiling;
|
||||
int debugging;
|
||||
int zone, hadtz;
|
||||
int dst;
|
||||
int hz;
|
||||
int profiling;
|
||||
int debugging;
|
||||
|
||||
int maxusers;
|
||||
int maxusers;
|
||||
|
||||
#define eq(a,b) (!strcmp(a,b))
|
||||
#define eq(a,b) (!strcmp(a,b))
|
||||
|
||||
void init_dev(register struct device *dp);
|
||||
int yyparse(void);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,7 +4,7 @@
|
||||
%{
|
||||
/*-
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -16,8 +16,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -34,7 +34,7 @@
|
||||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)lang.l 8.1 (Berkeley) 6/6/93
|
||||
* @(#)lang.l 8.1 (Berkeley) 6/6/93
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -48,156 +48,156 @@
|
||||
*/
|
||||
|
||||
struct kt {
|
||||
char *kt_name;
|
||||
int kt_val;
|
||||
char *kt_name;
|
||||
int kt_val;
|
||||
} key_words[] = {
|
||||
{ "and", AND },
|
||||
{ "args", ARGS },
|
||||
{ "at", AT },
|
||||
{ "and", AND },
|
||||
{ "args", ARGS },
|
||||
{ "at", AT },
|
||||
#if MACHINE_I386
|
||||
{ "bio", BIO },
|
||||
{ "bio", BIO },
|
||||
#endif
|
||||
{ "config", CONFIG },
|
||||
{ "controller", CONTROLLER },
|
||||
{ "cpu", CPU },
|
||||
{ "csr", CSR },
|
||||
{ "device", DEVICE },
|
||||
{ "disk", DISK },
|
||||
{ "drive", DRIVE },
|
||||
{ "config", CONFIG },
|
||||
{ "controller", CONTROLLER },
|
||||
{ "cpu", CPU },
|
||||
{ "csr", CSR },
|
||||
{ "device", DEVICE },
|
||||
{ "disk", DISK },
|
||||
{ "drive", DRIVE },
|
||||
#if MACHINE_I386
|
||||
{ "drq", DRQ },
|
||||
{ "drq", DRQ },
|
||||
#endif
|
||||
{ "dst", DST },
|
||||
{ "dumps", DUMPS },
|
||||
{ "flags", FLAGS },
|
||||
{ "hz", HZ },
|
||||
{ "ident", IDENT },
|
||||
{ "interleave", INTERLEAVE },
|
||||
{ "dst", DST },
|
||||
{ "dumps", DUMPS },
|
||||
{ "flags", FLAGS },
|
||||
{ "hz", HZ },
|
||||
{ "ident", IDENT },
|
||||
{ "interleave", INTERLEAVE },
|
||||
#if MACHINE_I386
|
||||
{ "iomem", IOMEM },
|
||||
{ "iosiz", IOSIZ },
|
||||
{ "irq", IRQ },
|
||||
{ "iomem", IOMEM },
|
||||
{ "iosiz", IOSIZ },
|
||||
{ "irq", IRQ },
|
||||
#endif
|
||||
{ "ldscript", LDSCRIPT },
|
||||
{ "machine", MACHINE },
|
||||
{ "major", MAJOR },
|
||||
{ "makeoptions", MAKEOPTIONS },
|
||||
{ "master", MASTER },
|
||||
{ "maxusers", MAXUSERS },
|
||||
{ "minor", MINOR },
|
||||
{ "ldscript", LDSCRIPT },
|
||||
{ "machine", MACHINE },
|
||||
{ "major", MAJOR },
|
||||
{ "makeoptions", MAKEOPTIONS },
|
||||
{ "master", MASTER },
|
||||
{ "maxusers", MAXUSERS },
|
||||
{ "minor", MINOR },
|
||||
#if MACHINE_I386
|
||||
{ "net", NET },
|
||||
{ "net", NET },
|
||||
#endif
|
||||
{ "nexus", NEXUS },
|
||||
{ "on", ON },
|
||||
{ "options", OPTIONS },
|
||||
{ "nexus", NEXUS },
|
||||
{ "on", ON },
|
||||
{ "options", OPTIONS },
|
||||
#if MACHINE_I386
|
||||
{ "port", PORT },
|
||||
{ "port", PORT },
|
||||
#endif
|
||||
{ "priority", PRIORITY },
|
||||
{ "pseudo-device",PSEUDO_DEVICE },
|
||||
{ "root", ROOT },
|
||||
{ "priority", PRIORITY },
|
||||
{ "pseudo-device", PSEUDO_DEVICE },
|
||||
{ "root", ROOT },
|
||||
#if MACHINE_HP300 || MACHINE_LUNA68K
|
||||
{ "scode", NEXUS },
|
||||
{ "scode", NEXUS },
|
||||
#endif
|
||||
{ "sequential", SEQUENTIAL },
|
||||
{ "size", SIZE },
|
||||
{ "slave", SLAVE },
|
||||
{ "swap", SWAP },
|
||||
{ "tape", DEVICE },
|
||||
{ "sequential", SEQUENTIAL },
|
||||
{ "size", SIZE },
|
||||
{ "slave", SLAVE },
|
||||
{ "swap", SWAP },
|
||||
{ "tape", DEVICE },
|
||||
#if MACHINE_I386
|
||||
{ "tty", TTY },
|
||||
{ "tty", TTY },
|
||||
#endif
|
||||
{ "timezone", TIMEZONE },
|
||||
{ "trace", TRACE },
|
||||
{ "vector", VECTOR },
|
||||
{ 0, 0 },
|
||||
{ "timezone", TIMEZONE },
|
||||
{ "trace", TRACE },
|
||||
{ "vector", VECTOR },
|
||||
{ 0, 0 },
|
||||
};
|
||||
|
||||
int kw_lookup(char *word);
|
||||
int octal(char *str);
|
||||
int hex(char *str);
|
||||
%}
|
||||
WORD [A-Za-z_][-A-Za-z_]*
|
||||
WORD [A-Za-z_][-A-Za-z_]*
|
||||
%%
|
||||
{WORD} {
|
||||
int i;
|
||||
{WORD} {
|
||||
int i;
|
||||
|
||||
if ((i = kw_lookup(yytext)) == -1)
|
||||
{
|
||||
yylval.str = yytext;
|
||||
tprintf("id(%s) ", yytext);
|
||||
return ID;
|
||||
}
|
||||
tprintf("(%s) ", yytext);
|
||||
return i;
|
||||
}
|
||||
\"[^"]+\" {
|
||||
yytext[strlen(yytext)-1] = '\0';
|
||||
yylval.str = yytext + 1;
|
||||
return ID;
|
||||
}
|
||||
0[0-7]* {
|
||||
yylval.val = octal(yytext);
|
||||
tprintf("#O:%o ", yylval.val);
|
||||
return NUMBER;
|
||||
}
|
||||
0x[0-9a-fA-F]+ {
|
||||
yylval.val = hex(yytext);
|
||||
tprintf("#X:%x ", yylval.val);
|
||||
return NUMBER;
|
||||
}
|
||||
[1-9][0-9]* {
|
||||
yylval.val = atoi(yytext);
|
||||
tprintf("#D:%d ", yylval.val);
|
||||
return NUMBER;
|
||||
}
|
||||
[0-9]"."[0-9]* {
|
||||
double atof();
|
||||
yylval.val = (int) (60 * atof(yytext) + 0.5);
|
||||
return FPNUMBER;
|
||||
}
|
||||
"-" {
|
||||
return MINUS;
|
||||
}
|
||||
"?" {
|
||||
yylval.val = -1;
|
||||
tprintf("? ");
|
||||
return NUMBER;
|
||||
}
|
||||
\n/[ \t] {
|
||||
yyline++;
|
||||
tprintf("\n... ");
|
||||
}
|
||||
\n {
|
||||
yyline++;
|
||||
tprintf("\n");
|
||||
return SEMICOLON;
|
||||
}
|
||||
#.* { /* Ignored (comment) */; }
|
||||
[ \t]* { /* Ignored (white space) */; }
|
||||
";" { return SEMICOLON; }
|
||||
"," { return COMMA; }
|
||||
"=" { return EQUALS; }
|
||||
"@" { return AT; }
|
||||
. { return yytext[0]; }
|
||||
if ((i = kw_lookup(yytext)) == -1)
|
||||
{
|
||||
yylval.str = yytext;
|
||||
tprintf("id(%s) ", yytext);
|
||||
return ID;
|
||||
}
|
||||
tprintf("(%s) ", yytext);
|
||||
return i;
|
||||
}
|
||||
\"[^"]+\" {
|
||||
yytext[strlen(yytext)-1] = '\0';
|
||||
yylval.str = yytext + 1;
|
||||
return ID;
|
||||
}
|
||||
0[0-7]* {
|
||||
yylval.val = octal(yytext);
|
||||
tprintf("#O:%o ", yylval.val);
|
||||
return NUMBER;
|
||||
}
|
||||
0x[0-9a-fA-F]+ {
|
||||
yylval.val = hex(yytext);
|
||||
tprintf("#X:%x ", yylval.val);
|
||||
return NUMBER;
|
||||
}
|
||||
[1-9][0-9]* {
|
||||
yylval.val = atoi(yytext);
|
||||
tprintf("#D:%d ", yylval.val);
|
||||
return NUMBER;
|
||||
}
|
||||
[0-9]"."[0-9]* {
|
||||
double atof();
|
||||
yylval.val = (int) (60 * atof(yytext) + 0.5);
|
||||
return FPNUMBER;
|
||||
}
|
||||
"-" {
|
||||
return MINUS;
|
||||
}
|
||||
"?" {
|
||||
yylval.val = -1;
|
||||
tprintf("? ");
|
||||
return NUMBER;
|
||||
}
|
||||
\n/[ \t] {
|
||||
yyline++;
|
||||
tprintf("\n... ");
|
||||
}
|
||||
\n {
|
||||
yyline++;
|
||||
tprintf("\n");
|
||||
return SEMICOLON;
|
||||
}
|
||||
#.* { /* Ignored (comment) */; }
|
||||
[ \t]* { /* Ignored (white space) */; }
|
||||
";" { return SEMICOLON; }
|
||||
"," { return COMMA; }
|
||||
"=" { return EQUALS; }
|
||||
"@" { return AT; }
|
||||
. { return yytext[0]; }
|
||||
|
||||
%%
|
||||
/*
|
||||
* kw_lookup
|
||||
* Look up a string in the keyword table. Returns a -1 if the
|
||||
* string is not a keyword otherwise it returns the keyword number
|
||||
* Look up a string in the keyword table. Returns a -1 if the
|
||||
* string is not a keyword otherwise it returns the keyword number
|
||||
*/
|
||||
int
|
||||
kw_lookup(word)
|
||||
register char *word;
|
||||
{
|
||||
register struct kt *kp;
|
||||
register struct kt *kp;
|
||||
|
||||
for (kp = key_words; kp->kt_name != 0; kp++)
|
||||
if (eq(word, kp->kt_name))
|
||||
return kp->kt_val;
|
||||
return -1;
|
||||
for (kp = key_words; kp->kt_name != 0; kp++)
|
||||
if (eq(word, kp->kt_name))
|
||||
return kp->kt_val;
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -207,18 +207,18 @@ int
|
||||
octal(str)
|
||||
char *str;
|
||||
{
|
||||
int num;
|
||||
int num;
|
||||
|
||||
(void) sscanf(str, "%o", &num);
|
||||
return num;
|
||||
(void) sscanf(str, "%o", &num);
|
||||
return num;
|
||||
}
|
||||
|
||||
int
|
||||
hex(str)
|
||||
char *str;
|
||||
{
|
||||
int num;
|
||||
int num;
|
||||
|
||||
(void) sscanf(str+2, "%x", &num);
|
||||
return num;
|
||||
(void) sscanf(str+2, "%x", &num);
|
||||
return num;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -12,8 +12,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -46,190 +46,188 @@ static char *PREFIX;
|
||||
* system given a description of the desired system.
|
||||
*/
|
||||
int main(argc, argv)
|
||||
int argc;
|
||||
char **argv;
|
||||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
struct stat buf;
|
||||
int ch;
|
||||
char *p;
|
||||
extern char *optarg;
|
||||
extern int optind;
|
||||
struct stat buf;
|
||||
int ch;
|
||||
char *p;
|
||||
|
||||
while ((ch = getopt(argc, argv, "gp")) != EOF)
|
||||
switch (ch) {
|
||||
case 'g':
|
||||
debugging++;
|
||||
break;
|
||||
case 'p':
|
||||
profiling++;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
while ((ch = getopt(argc, argv, "gp")) != EOF)
|
||||
switch (ch) {
|
||||
case 'g':
|
||||
debugging++;
|
||||
break;
|
||||
case 'p':
|
||||
profiling++;
|
||||
break;
|
||||
case '?':
|
||||
default:
|
||||
goto usage;
|
||||
}
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
if (argc != 1) {
|
||||
usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
if (argc != 1) {
|
||||
usage: fputs("usage: config [-gp] sysname\n", stderr);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (freopen(PREFIX = *argv, "r", stdin) == NULL) {
|
||||
fprintf(stderr, "--- PREFIX\n");
|
||||
perror(PREFIX);
|
||||
exit(2);
|
||||
}
|
||||
mkdir("../../compile", 0777);
|
||||
if (stat(p = path((char *)NULL), &buf)) {
|
||||
if (mkdir(p, 0777)) {
|
||||
fprintf(stderr, "--- mkdir path\n");
|
||||
perror(p);
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR) {
|
||||
fprintf(stderr, "config: %s isn't a directory.\n", p);
|
||||
exit(2);
|
||||
}
|
||||
if (freopen(PREFIX = *argv, "r", stdin) == NULL) {
|
||||
perror(PREFIX);
|
||||
exit(2);
|
||||
}
|
||||
mkdir("../../compile", 0777);
|
||||
if (stat(p = path((char *)NULL), &buf)) {
|
||||
if (mkdir(p, 0777)) {
|
||||
perror(p);
|
||||
exit(2);
|
||||
}
|
||||
}
|
||||
else if ((buf.st_mode & S_IFMT) != S_IFDIR) {
|
||||
fprintf(stderr, "config: %s isn't a directory.\n", p);
|
||||
exit(2);
|
||||
}
|
||||
|
||||
dtab = NULL;
|
||||
confp = &conf_list;
|
||||
compp = &comp_list;
|
||||
if (yyparse())
|
||||
exit(3);
|
||||
switch (machine) {
|
||||
dtab = NULL;
|
||||
confp = &conf_list;
|
||||
compp = &comp_list;
|
||||
if (yyparse())
|
||||
exit(3);
|
||||
switch (machine) {
|
||||
|
||||
case MACHINE_VAX:
|
||||
vax_ioconf(); /* Print ioconf.c */
|
||||
ubglue(); /* Create ubglue.s */
|
||||
break;
|
||||
case MACHINE_VAX:
|
||||
vax_ioconf(); /* Print ioconf.c */
|
||||
ubglue(); /* Create ubglue.s */
|
||||
break;
|
||||
|
||||
case MACHINE_TAHOE:
|
||||
tahoe_ioconf();
|
||||
vbglue();
|
||||
break;
|
||||
case MACHINE_TAHOE:
|
||||
tahoe_ioconf();
|
||||
vbglue();
|
||||
break;
|
||||
|
||||
case MACHINE_HP300:
|
||||
case MACHINE_LUNA68K:
|
||||
hp300_ioconf();
|
||||
hpglue();
|
||||
break;
|
||||
case MACHINE_HP300:
|
||||
case MACHINE_LUNA68K:
|
||||
hp300_ioconf();
|
||||
hpglue();
|
||||
break;
|
||||
|
||||
case MACHINE_I386:
|
||||
i386_ioconf(); /* Print ioconf.c */
|
||||
vector(); /* Create vector.s */
|
||||
break;
|
||||
case MACHINE_I386:
|
||||
i386_ioconf(); /* Print ioconf.c */
|
||||
vector(); /* Create vector.s */
|
||||
break;
|
||||
|
||||
case MACHINE_MIPS:
|
||||
case MACHINE_PMAX:
|
||||
pmax_ioconf();
|
||||
break;
|
||||
case MACHINE_MIPS:
|
||||
case MACHINE_PMAX:
|
||||
pmax_ioconf();
|
||||
break;
|
||||
|
||||
case MACHINE_PIC32:
|
||||
pic32_ioconf();
|
||||
break;
|
||||
case MACHINE_PIC32:
|
||||
pic32_ioconf();
|
||||
break;
|
||||
|
||||
case MACHINE_NEWS3400:
|
||||
news_ioconf();
|
||||
break;
|
||||
case MACHINE_NEWS3400:
|
||||
news_ioconf();
|
||||
break;
|
||||
|
||||
default:
|
||||
printf("Specify machine type, e.g. ``machine vax''\n");
|
||||
exit(1);
|
||||
}
|
||||
makefile(); /* build Makefile */
|
||||
headers(); /* make a lot of .h files */
|
||||
swapconf(); /* swap config files */
|
||||
printf("Don't forget to run \"make depend\"\n");
|
||||
exit(0);
|
||||
default:
|
||||
printf("Specify machine type, e.g. ``machine vax''\n");
|
||||
exit(1);
|
||||
}
|
||||
makefile(); /* build Makefile */
|
||||
headers(); /* make a lot of .h files */
|
||||
swapconf(); /* swap config files */
|
||||
printf("Don't forget to run \"make depend\"\n");
|
||||
exit(0);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_word
|
||||
* returns EOF on end of file
|
||||
* NULL on end of line
|
||||
* pointer to the word otherwise
|
||||
* returns EOF on end of file
|
||||
* NULL on end of line
|
||||
* pointer to the word otherwise
|
||||
*/
|
||||
char *
|
||||
get_word(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
static char line[80];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
static char line[80];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
(void) ungetc(ch, fp);
|
||||
return (line);
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
(void) ungetc(ch, fp);
|
||||
return (line);
|
||||
}
|
||||
|
||||
/*
|
||||
* get_quoted_word
|
||||
* like get_word but will accept something in double or single quotes
|
||||
* (to allow embedded spaces).
|
||||
* like get_word but will accept something in double or single quotes
|
||||
* (to allow embedded spaces).
|
||||
*/
|
||||
char *
|
||||
get_quoted_word(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
static char line[256];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
static char line[256];
|
||||
register int ch;
|
||||
register char *cp;
|
||||
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
if (ch == '"' || ch == '\'') {
|
||||
register int quote = ch;
|
||||
while ((ch = getc(fp)) != EOF)
|
||||
if (ch != ' ' && ch != '\t')
|
||||
break;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
if (ch == '\n')
|
||||
return (NULL);
|
||||
cp = line;
|
||||
if (ch == '"' || ch == '\'') {
|
||||
register int quote = ch;
|
||||
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (ch == quote)
|
||||
break;
|
||||
if (ch == '\n') {
|
||||
*cp = 0;
|
||||
printf("config: missing quote reading `%s'\n",
|
||||
line);
|
||||
exit(2);
|
||||
}
|
||||
*cp++ = ch;
|
||||
}
|
||||
} else {
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
if (ch != EOF)
|
||||
(void) ungetc(ch, fp);
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
return (line);
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (ch == quote)
|
||||
break;
|
||||
if (ch == '\n') {
|
||||
*cp = 0;
|
||||
printf("config: missing quote reading `%s'\n",
|
||||
line);
|
||||
exit(2);
|
||||
}
|
||||
*cp++ = ch;
|
||||
}
|
||||
} else {
|
||||
*cp++ = ch;
|
||||
while ((ch = getc(fp)) != EOF) {
|
||||
if (isspace(ch))
|
||||
break;
|
||||
*cp++ = ch;
|
||||
}
|
||||
if (ch != EOF)
|
||||
(void) ungetc(ch, fp);
|
||||
}
|
||||
*cp = 0;
|
||||
if (ch == EOF)
|
||||
return ((char *)EOF);
|
||||
return (line);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -237,18 +235,19 @@ get_quoted_word(fp)
|
||||
*/
|
||||
char *
|
||||
path(file)
|
||||
char *file;
|
||||
char *file;
|
||||
{
|
||||
register char *cp;
|
||||
register char *cp;
|
||||
|
||||
#define CDIR "../../compile/"
|
||||
cp = malloc((unsigned int)(sizeof(CDIR) + strlen(PREFIX) +
|
||||
(file ? strlen(file) : 0) + 2));
|
||||
(void) strcpy(cp, CDIR);
|
||||
(void) strcat(cp, PREFIX);
|
||||
if (file) {
|
||||
(void) strcat(cp, "/");
|
||||
(void) strcat(cp, file);
|
||||
}
|
||||
return (cp);
|
||||
#define CDIR "../../compile/"
|
||||
|
||||
cp = malloc((unsigned int)(sizeof(CDIR) + strlen(PREFIX) +
|
||||
(file ? strlen(file) : 0) + 2));
|
||||
(void) strcpy(cp, CDIR);
|
||||
(void) strcat(cp, PREFIX);
|
||||
if (file) {
|
||||
(void) strcat(cp, "/");
|
||||
(void) strcat(cp, file);
|
||||
}
|
||||
return (cp);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -12,8 +12,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -39,57 +39,57 @@
|
||||
#include "y.tab.h"
|
||||
#include <ctype.h>
|
||||
|
||||
static int cntcnt = 0; /* number of interrupt counters allocated */
|
||||
static int cntcnt = 0; /* number of interrupt counters allocated */
|
||||
|
||||
/*
|
||||
* Print a UNIBUS interrupt vector.
|
||||
*/
|
||||
void dump_ubavec(fp, vector, number)
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
{
|
||||
char nbuf[80];
|
||||
register char *v = nbuf;
|
||||
char nbuf[80];
|
||||
register char *v = nbuf;
|
||||
|
||||
(void) sprintf(v, "%s%d", vector, number);
|
||||
fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
|
||||
v, v);
|
||||
fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
|
||||
if (strncmp(vector, "dzx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number);
|
||||
else if (strncmp(vector, "dpx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number);
|
||||
else if (strncmp(vector, "dpr", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number);
|
||||
else {
|
||||
if (strncmp(vector, "uur", 3) == 0) {
|
||||
fprintf(fp, "#ifdef UUDMA\n");
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number);
|
||||
fprintf(fp, "#endif\n");
|
||||
}
|
||||
fprintf(fp, "\tpushl\t$%d\n", number);
|
||||
fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector);
|
||||
fprintf(fp, "\tincl\t_cnt+V_INTR\n\trei\n\n");
|
||||
}
|
||||
(void) sprintf(v, "%s%d", vector, number);
|
||||
fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
|
||||
v, v);
|
||||
fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
|
||||
if (strncmp(vector, "dzx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number);
|
||||
else if (strncmp(vector, "dpx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number);
|
||||
else if (strncmp(vector, "dpr", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number);
|
||||
else {
|
||||
if (strncmp(vector, "uur", 3) == 0) {
|
||||
fprintf(fp, "#ifdef UUDMA\n");
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number);
|
||||
fprintf(fp, "#endif\n");
|
||||
}
|
||||
fprintf(fp, "\tpushl\t$%d\n", number);
|
||||
fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector);
|
||||
fprintf(fp, "\tincl\t_cnt+V_INTR\n\trei\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
static char *vaxinames[] = {
|
||||
"clock", "cnr", "cnx", "tur", "tux",
|
||||
"mba0", "mba1", "mba2", "mba3",
|
||||
"uba0", "uba1", "uba2", "uba3"
|
||||
static char *vaxinames[] = {
|
||||
"clock", "cnr", "cnx", "tur", "tux",
|
||||
"mba0", "mba1", "mba2", "mba3",
|
||||
"uba0", "uba1", "uba2", "uba3"
|
||||
};
|
||||
|
||||
static char *tahoeinames[] = {
|
||||
"clock", "cnr", "cnx", "rmtr", "rmtx", "buserr",
|
||||
static char *tahoeinames[] = {
|
||||
"clock", "cnr", "cnx", "rmtr", "rmtx", "buserr",
|
||||
};
|
||||
|
||||
static struct stdintrs {
|
||||
char **si_names; /* list of standard interrupt names */
|
||||
int si_n; /* number of such names */
|
||||
static struct stdintrs {
|
||||
char **si_names; /* list of standard interrupt names */
|
||||
int si_n; /* number of such names */
|
||||
} stdintrs[] = {
|
||||
{ vaxinames, sizeof (vaxinames) / sizeof (vaxinames[0]) },
|
||||
{ tahoeinames, (sizeof (tahoeinames) / sizeof (tahoeinames[0])) }
|
||||
{ vaxinames, sizeof (vaxinames) / sizeof (vaxinames[0]) },
|
||||
{ tahoeinames, (sizeof (tahoeinames) / sizeof (tahoeinames[0])) }
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -100,80 +100,80 @@ static struct stdintrs {
|
||||
* file which is prepended to locore.s.
|
||||
*/
|
||||
void dump_std(fp, gp)
|
||||
register FILE *fp, *gp;
|
||||
register FILE *fp, *gp;
|
||||
{
|
||||
register struct stdintrs *si = &stdintrs[machine-1];
|
||||
register char **cpp;
|
||||
register int i;
|
||||
register struct stdintrs *si = &stdintrs[machine-1];
|
||||
register char **cpp;
|
||||
register int i;
|
||||
|
||||
fprintf(fp, "\n\t.globl\t_intrnames\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrnames\n");
|
||||
fprintf(fp, "\t.data\n");
|
||||
fprintf(fp, "_intrnames:\n");
|
||||
cpp = si->si_names;
|
||||
for (i = 0; i < si->si_n; i++) {
|
||||
register char *cp, *tp;
|
||||
char buf[80];
|
||||
fprintf(fp, "\n\t.globl\t_intrnames\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrnames\n");
|
||||
fprintf(fp, "\t.data\n");
|
||||
fprintf(fp, "_intrnames:\n");
|
||||
cpp = si->si_names;
|
||||
for (i = 0; i < si->si_n; i++) {
|
||||
register char *cp, *tp;
|
||||
char buf[80];
|
||||
|
||||
cp = *cpp;
|
||||
if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
|
||||
cp += 3;
|
||||
if (*cp == 'r')
|
||||
cp++;
|
||||
}
|
||||
for (tp = buf; *cp; cp++)
|
||||
if (islower(*cp))
|
||||
*tp++ = toupper(*cp);
|
||||
else
|
||||
*tp++ = *cp;
|
||||
*tp = '\0';
|
||||
fprintf(gp, "#define\tI_%s\t%d\n", buf, i * (int)sizeof (long));
|
||||
fprintf(fp, "\t.asciz\t\"%s\"\n", *cpp);
|
||||
cpp++;
|
||||
}
|
||||
cp = *cpp;
|
||||
if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
|
||||
cp += 3;
|
||||
if (*cp == 'r')
|
||||
cp++;
|
||||
}
|
||||
for (tp = buf; *cp; cp++)
|
||||
if (islower(*cp))
|
||||
*tp++ = toupper(*cp);
|
||||
else
|
||||
*tp++ = *cp;
|
||||
*tp = '\0';
|
||||
fprintf(gp, "#define\tI_%s\t%d\n", buf, i * (int)sizeof (long));
|
||||
fprintf(fp, "\t.asciz\t\"%s\"\n", *cpp);
|
||||
cpp++;
|
||||
}
|
||||
}
|
||||
|
||||
void dump_intname(fp, vector, number)
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
{
|
||||
register char *cp = vector;
|
||||
register char *cp = vector;
|
||||
|
||||
fprintf(fp, "\t.asciz\t\"");
|
||||
/*
|
||||
* Skip any "int" or "intr" in the name.
|
||||
*/
|
||||
while (*cp)
|
||||
if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
|
||||
cp += 3;
|
||||
if (*cp == 'r')
|
||||
cp++;
|
||||
} else {
|
||||
putc(*cp, fp);
|
||||
cp++;
|
||||
}
|
||||
fprintf(fp, "%d\"\n", number);
|
||||
fprintf(fp, "\t.asciz\t\"");
|
||||
/*
|
||||
* Skip any "int" or "intr" in the name.
|
||||
*/
|
||||
while (*cp)
|
||||
if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
|
||||
cp += 3;
|
||||
if (*cp == 'r')
|
||||
cp++;
|
||||
} else {
|
||||
putc(*cp, fp);
|
||||
cp++;
|
||||
}
|
||||
fprintf(fp, "%d\"\n", number);
|
||||
}
|
||||
|
||||
/*
|
||||
* Reserve space for the interrupt counters.
|
||||
*/
|
||||
void dump_ctrs(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
struct stdintrs *si = &stdintrs[machine-1];
|
||||
struct stdintrs *si = &stdintrs[machine-1];
|
||||
|
||||
fprintf(fp, "_eintrnames:\n");
|
||||
fprintf(fp, "\n\t.globl\t_intrcnt\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrcnt\n");
|
||||
fprintf(fp, "\t.align 2\n");
|
||||
fprintf(fp, "_intrcnt:\n");
|
||||
fprintf(fp, "\t.space\t4 * %d\n", si->si_n);
|
||||
fprintf(fp, "_fltintrcnt:\n");
|
||||
fprintf(fp, "\t.space\t4 * %d\n", cntcnt);
|
||||
fprintf(fp, "_eintrcnt:\n\n");
|
||||
fprintf(fp, "\t.text\n");
|
||||
fprintf(fp, "_eintrnames:\n");
|
||||
fprintf(fp, "\n\t.globl\t_intrcnt\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrcnt\n");
|
||||
fprintf(fp, "\t.align 2\n");
|
||||
fprintf(fp, "_intrcnt:\n");
|
||||
fprintf(fp, "\t.space\t4 * %d\n", si->si_n);
|
||||
fprintf(fp, "_fltintrcnt:\n");
|
||||
fprintf(fp, "\t.space\t4 * %d\n", cntcnt);
|
||||
fprintf(fp, "_eintrcnt:\n\n");
|
||||
fprintf(fp, "\t.text\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -181,86 +181,86 @@ void dump_ctrs(fp)
|
||||
*/
|
||||
void ubglue()
|
||||
{
|
||||
register FILE *fp, *gp;
|
||||
register struct device *dp, *mp;
|
||||
register FILE *fp, *gp;
|
||||
register struct device *dp, *mp;
|
||||
|
||||
fp = fopen(path("ubglue.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("ubglue.s"));
|
||||
exit(1);
|
||||
}
|
||||
gp = fopen(path("ubvec.s"), "w");
|
||||
if (gp == 0) {
|
||||
perror(path("ubvec.s"));
|
||||
exit(1);
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
fp = fopen(path("ubglue.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("ubglue.s"));
|
||||
exit(1);
|
||||
}
|
||||
gp = fopen(path("ubvec.s"), "w");
|
||||
if (gp == 0) {
|
||||
perror(path("ubvec.s"));
|
||||
exit(1);
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_ubavec(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_std(fp, gp);
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_ubavec(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_std(fp, gp);
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_intname(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_ctrs(fp);
|
||||
(void) fclose(fp);
|
||||
(void) fclose(gp);
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_intname(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_ctrs(fp);
|
||||
(void) fclose(fp);
|
||||
(void) fclose(gp);
|
||||
}
|
||||
|
||||
/*
|
||||
* Print a VERSAbus interrupt vector
|
||||
*/
|
||||
void dump_vbavec(fp, vector, number)
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
{
|
||||
char nbuf[80];
|
||||
register char *v = nbuf;
|
||||
char nbuf[80];
|
||||
register char *v = nbuf;
|
||||
|
||||
(void) sprintf(v, "%s%d", vector, number);
|
||||
fprintf(fp, "SCBVEC(%s):\n", v);
|
||||
fprintf(fp, "\tCHECK_SFE(4)\n");
|
||||
fprintf(fp, "\tSAVE_FPSTAT(4)\n");
|
||||
fprintf(fp, "\tPUSHR\n");
|
||||
fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
|
||||
fprintf(fp, "\tpushl\t$%d\n", number);
|
||||
fprintf(fp, "\tcallf\t$8,_%s\n", vector);
|
||||
fprintf(fp, "\tincl\t_cnt+V_INTR\n");
|
||||
fprintf(fp, "\tPOPR\n");
|
||||
fprintf(fp, "\tREST_FPSTAT\n");
|
||||
fprintf(fp, "\trei\n\n");
|
||||
(void) sprintf(v, "%s%d", vector, number);
|
||||
fprintf(fp, "SCBVEC(%s):\n", v);
|
||||
fprintf(fp, "\tCHECK_SFE(4)\n");
|
||||
fprintf(fp, "\tSAVE_FPSTAT(4)\n");
|
||||
fprintf(fp, "\tPUSHR\n");
|
||||
fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
|
||||
fprintf(fp, "\tpushl\t$%d\n", number);
|
||||
fprintf(fp, "\tcallf\t$8,_%s\n", vector);
|
||||
fprintf(fp, "\tincl\t_cnt+V_INTR\n");
|
||||
fprintf(fp, "\tPOPR\n");
|
||||
fprintf(fp, "\tREST_FPSTAT\n");
|
||||
fprintf(fp, "\trei\n\n");
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -268,59 +268,59 @@ void dump_vbavec(fp, vector, number)
|
||||
*/
|
||||
void vbglue()
|
||||
{
|
||||
register FILE *fp, *gp;
|
||||
register struct device *dp, *mp;
|
||||
register FILE *fp, *gp;
|
||||
register struct device *dp, *mp;
|
||||
|
||||
fp = fopen(path("vbglue.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("vbglue.s"));
|
||||
exit(1);
|
||||
}
|
||||
gp = fopen(path("vbvec.s"), "w");
|
||||
if (gp == 0) {
|
||||
perror(path("vbvec.s"));
|
||||
exit(1);
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
struct idlst *id, *id2;
|
||||
fp = fopen(path("vbglue.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("vbglue.s"));
|
||||
exit(1);
|
||||
}
|
||||
gp = fopen(path("vbvec.s"), "w");
|
||||
if (gp == 0) {
|
||||
perror(path("vbvec.s"));
|
||||
exit(1);
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
mp = dp->d_conn;
|
||||
if (mp == 0 || mp == (struct device *)-1 ||
|
||||
eq(mp->d_name, "mba"))
|
||||
continue;
|
||||
for (id = dp->d_vec; id; id = id->id_next)
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id == id2) {
|
||||
dump_vbavec(fp, id->id, dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (eq(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
dump_std(fp, gp);
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
mp = dp->d_conn;
|
||||
if (mp == 0 || mp == (struct device *)-1 ||
|
||||
eq(mp->d_name, "mba"))
|
||||
continue;
|
||||
for (id = dp->d_vec; id; id = id->id_next)
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id == id2) {
|
||||
dump_vbavec(fp, id->id, dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (eq(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
dump_std(fp, gp);
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_intname(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (eq(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_ctrs(fp);
|
||||
(void) fclose(fp);
|
||||
(void) fclose(gp);
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_intname(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (eq(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_ctrs(fp);
|
||||
(void) fclose(fp);
|
||||
(void) fclose(gp);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -336,67 +336,67 @@ void hpglue()
|
||||
*/
|
||||
void vector()
|
||||
{
|
||||
register FILE *fp;
|
||||
register struct device *dp, *mp;
|
||||
int count;
|
||||
register FILE *fp;
|
||||
register struct device *dp, *mp;
|
||||
int count;
|
||||
|
||||
fp = fopen(path("vector.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("vector.s"));
|
||||
exit(1);
|
||||
}
|
||||
fprintf(fp,"\
|
||||
fp = fopen(path("vector.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("vector.s"));
|
||||
exit(1);
|
||||
}
|
||||
fprintf(fp,"\
|
||||
/*\n\
|
||||
* AT/386\n\
|
||||
* Interrupt vector routines\n\
|
||||
* Generated by config program\n\
|
||||
*/ \n\
|
||||
\n\
|
||||
#include \"i386/isa/isa.h\"\n\
|
||||
#include \"i386/isa/icu.h\"\n\
|
||||
#include \"i386/isa/isa.h\"\n\
|
||||
#include \"i386/isa/icu.h\"\n\
|
||||
\n\
|
||||
#define VEC(name) .align 4; .globl _V/**/name; _V/**/name:\n\n");
|
||||
#define VEC(name) .align 4; .globl _V/**/name; _V/**/name:\n\n");
|
||||
|
||||
fprintf(fp,"\
|
||||
.globl _hardclock\n\
|
||||
fprintf(fp,"\
|
||||
.globl _hardclock\n\
|
||||
VEC(clk)\n\
|
||||
INTR1(0, _highmask, 0)\n\
|
||||
call _hardclock \n\
|
||||
INTREXIT1\n\n\n");
|
||||
INTR1(0, _highmask, 0)\n\
|
||||
call _hardclock \n\
|
||||
INTREXIT1\n\n\n");
|
||||
|
||||
count=0;
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && /* mp != (struct device *)-1 &&*/
|
||||
eq(mp->d_name, "isa")) {
|
||||
struct idlst *id, *id2;
|
||||
count=0;
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && /* mp != (struct device *)-1 &&*/
|
||||
eq(mp->d_name, "isa")) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
if(dp->d_irq == -1) continue;
|
||||
fprintf(fp,"\t.globl _%s, _%s%dmask\n\t.data\n",
|
||||
id->id, dp->d_name, dp->d_unit);
|
||||
fprintf(fp,"_%s%dmask:\t.long 0\n\t.text\n",
|
||||
dp->d_name, dp->d_unit);
|
||||
fprintf(fp,"VEC(%s%d)\n\tINTR%d(%d, ",
|
||||
dp->d_name, dp->d_unit,
|
||||
dp->d_irq / 8 + 1, dp->d_unit);
|
||||
if(eq(dp->d_mask,"null"))
|
||||
fprintf(fp,"_%s%dmask, ",
|
||||
dp->d_name, dp->d_unit);
|
||||
else
|
||||
fprintf(fp,"_%smask, ",
|
||||
dp->d_mask);
|
||||
fprintf(fp,"%d)\n\tcall\t_%s\n\tINTREXIT%d\n\n\n",
|
||||
++count, id->id, (dp->d_irq > 7)?2:1);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
(void) fclose(fp);
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
if(dp->d_irq == -1) continue;
|
||||
fprintf(fp,"\t.globl _%s, _%s%dmask\n\t.data\n",
|
||||
id->id, dp->d_name, dp->d_unit);
|
||||
fprintf(fp,"_%s%dmask:\t.long 0\n\t.text\n",
|
||||
dp->d_name, dp->d_unit);
|
||||
fprintf(fp,"VEC(%s%d)\n\tINTR%d(%d, ",
|
||||
dp->d_name, dp->d_unit,
|
||||
dp->d_irq / 8 + 1, dp->d_unit);
|
||||
if(eq(dp->d_mask,"null"))
|
||||
fprintf(fp,"_%s%dmask, ",
|
||||
dp->d_name, dp->d_unit);
|
||||
else
|
||||
fprintf(fp,"_%smask, ",
|
||||
dp->d_mask);
|
||||
fprintf(fp,"%d)\n\tcall\t_%s\n\tINTREXIT%d\n\n\n",
|
||||
++count, id->id, (dp->d_irq > 7)?2:1);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
(void) fclose(fp);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -12,8 +12,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -41,82 +41,82 @@
|
||||
#include "y.tab.h"
|
||||
|
||||
void do_header(dev, hname, count)
|
||||
char *dev, *hname;
|
||||
int count;
|
||||
char *dev, *hname;
|
||||
int count;
|
||||
{
|
||||
char *file, *name, *inw, *toheader(), *tomacro();
|
||||
struct file_list *fl, *fl_head, *tflp;
|
||||
FILE *inf, *outf;
|
||||
int inc, oldcount;
|
||||
char *file, *name, *inw, *toheader(), *tomacro();
|
||||
struct file_list *fl, *fl_head, *tflp;
|
||||
FILE *inf, *outf;
|
||||
int inc, oldcount;
|
||||
|
||||
file = toheader(hname);
|
||||
name = tomacro(dev);
|
||||
inf = fopen(file, "r");
|
||||
oldcount = -1;
|
||||
if (inf == 0) {
|
||||
outf = fopen(file, "w");
|
||||
if (outf == 0) {
|
||||
perror(file);
|
||||
exit(1);
|
||||
}
|
||||
fprintf(outf, "#define %s %d\n", name, count);
|
||||
(void) fclose(outf);
|
||||
return;
|
||||
}
|
||||
fl_head = NULL;
|
||||
for (;;) {
|
||||
char *cp;
|
||||
if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
|
||||
break;
|
||||
if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
|
||||
break;
|
||||
inw = ns(inw);
|
||||
cp = get_word(inf);
|
||||
if (cp == 0 || cp == (char *)EOF)
|
||||
break;
|
||||
inc = atoi(cp);
|
||||
if (eq(inw, name)) {
|
||||
oldcount = inc;
|
||||
inc = count;
|
||||
}
|
||||
cp = get_word(inf);
|
||||
if (cp == (char *)EOF)
|
||||
break;
|
||||
fl = (struct file_list *) malloc(sizeof *fl);
|
||||
bzero(fl, sizeof(*fl));
|
||||
fl->f_fn = inw;
|
||||
fl->f_type = inc;
|
||||
fl->f_next = fl_head;
|
||||
fl_head = fl;
|
||||
}
|
||||
(void) fclose(inf);
|
||||
if (count == oldcount) {
|
||||
for (fl = fl_head; fl != NULL; fl = tflp) {
|
||||
tflp = fl->f_next;
|
||||
free(fl);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (oldcount == -1) {
|
||||
fl = (struct file_list *) malloc(sizeof *fl);
|
||||
bzero(fl, sizeof(*fl));
|
||||
fl->f_fn = name;
|
||||
fl->f_type = count;
|
||||
fl->f_next = fl_head;
|
||||
fl_head = fl;
|
||||
}
|
||||
outf = fopen(file, "w");
|
||||
if (outf == 0) {
|
||||
perror(file);
|
||||
exit(1);
|
||||
}
|
||||
for (fl = fl_head; fl != NULL; fl = tflp) {
|
||||
fprintf(outf,
|
||||
"#define %s %u\n", fl->f_fn, count ? fl->f_type : 0);
|
||||
tflp = fl->f_next;
|
||||
free(fl);
|
||||
}
|
||||
(void) fclose(outf);
|
||||
file = toheader(hname);
|
||||
name = tomacro(dev);
|
||||
inf = fopen(file, "r");
|
||||
oldcount = -1;
|
||||
if (inf == 0) {
|
||||
outf = fopen(file, "w");
|
||||
if (outf == 0) {
|
||||
perror(file);
|
||||
exit(1);
|
||||
}
|
||||
fprintf(outf, "#define %s %d\n", name, count);
|
||||
(void) fclose(outf);
|
||||
return;
|
||||
}
|
||||
fl_head = NULL;
|
||||
for (;;) {
|
||||
char *cp;
|
||||
if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
|
||||
break;
|
||||
if ((inw = get_word(inf)) == 0 || inw == (char *)EOF)
|
||||
break;
|
||||
inw = ns(inw);
|
||||
cp = get_word(inf);
|
||||
if (cp == 0 || cp == (char *)EOF)
|
||||
break;
|
||||
inc = atoi(cp);
|
||||
if (eq(inw, name)) {
|
||||
oldcount = inc;
|
||||
inc = count;
|
||||
}
|
||||
cp = get_word(inf);
|
||||
if (cp == (char *)EOF)
|
||||
break;
|
||||
fl = (struct file_list *) malloc(sizeof *fl);
|
||||
bzero(fl, sizeof(*fl));
|
||||
fl->f_fn = inw;
|
||||
fl->f_type = inc;
|
||||
fl->f_next = fl_head;
|
||||
fl_head = fl;
|
||||
}
|
||||
(void) fclose(inf);
|
||||
if (count == oldcount) {
|
||||
for (fl = fl_head; fl != NULL; fl = tflp) {
|
||||
tflp = fl->f_next;
|
||||
free(fl);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (oldcount == -1) {
|
||||
fl = (struct file_list *) malloc(sizeof *fl);
|
||||
bzero(fl, sizeof(*fl));
|
||||
fl->f_fn = name;
|
||||
fl->f_type = count;
|
||||
fl->f_next = fl_head;
|
||||
fl_head = fl;
|
||||
}
|
||||
outf = fopen(file, "w");
|
||||
if (outf == 0) {
|
||||
perror(file);
|
||||
exit(1);
|
||||
}
|
||||
for (fl = fl_head; fl != NULL; fl = tflp) {
|
||||
fprintf(outf,
|
||||
"#define %s %u\n", fl->f_fn, count ? fl->f_type : 0);
|
||||
tflp = fl->f_next;
|
||||
free(fl);
|
||||
}
|
||||
(void) fclose(outf);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -124,51 +124,51 @@ void do_header(dev, hname, count)
|
||||
* whatever the device is connected to
|
||||
*/
|
||||
void do_count(dev, hname, search)
|
||||
register char *dev, *hname;
|
||||
int search;
|
||||
register char *dev, *hname;
|
||||
int search;
|
||||
{
|
||||
register struct device *dp, *mp;
|
||||
register int count, hicount;
|
||||
register struct device *dp, *mp;
|
||||
register int count, hicount;
|
||||
|
||||
/*
|
||||
* After this loop, "count" will be the actual number of units,
|
||||
* and "hicount" will be the highest unit declared. do_header()
|
||||
* must use this higher of these values.
|
||||
*/
|
||||
for (hicount = count = 0, dp = dtab; dp != 0; dp = dp->d_next)
|
||||
if (dp->d_unit != -1 && eq(dp->d_name, dev)) {
|
||||
if (dp->d_type == PSEUDO_DEVICE) {
|
||||
count =
|
||||
dp->d_slave != UNKNOWN ? dp->d_slave : 1;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
/*
|
||||
* Allow holes in unit numbering,
|
||||
* assumption is unit numbering starts
|
||||
* at zero.
|
||||
*/
|
||||
if (dp->d_unit + 1 > hicount)
|
||||
hicount = dp->d_unit + 1;
|
||||
if (search) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != TO_NEXUS &&
|
||||
mp->d_conn != 0 && mp->d_conn != TO_NEXUS) {
|
||||
do_count(mp->d_name, hname, 0);
|
||||
search = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
do_header(dev, hname, count > hicount ? count : hicount);
|
||||
/*
|
||||
* After this loop, "count" will be the actual number of units,
|
||||
* and "hicount" will be the highest unit declared. do_header()
|
||||
* must use this higher of these values.
|
||||
*/
|
||||
for (hicount = count = 0, dp = dtab; dp != 0; dp = dp->d_next)
|
||||
if (dp->d_unit != -1 && eq(dp->d_name, dev)) {
|
||||
if (dp->d_type == PSEUDO_DEVICE) {
|
||||
count =
|
||||
dp->d_slave != UNKNOWN ? dp->d_slave : 1;
|
||||
break;
|
||||
}
|
||||
count++;
|
||||
/*
|
||||
* Allow holes in unit numbering,
|
||||
* assumption is unit numbering starts
|
||||
* at zero.
|
||||
*/
|
||||
if (dp->d_unit + 1 > hicount)
|
||||
hicount = dp->d_unit + 1;
|
||||
if (search) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != TO_NEXUS &&
|
||||
mp->d_conn != 0 && mp->d_conn != TO_NEXUS) {
|
||||
do_count(mp->d_name, hname, 0);
|
||||
search = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
do_header(dev, hname, count > hicount ? count : hicount);
|
||||
}
|
||||
|
||||
void headers()
|
||||
{
|
||||
register struct file_list *fl;
|
||||
register struct file_list *fl;
|
||||
|
||||
for (fl = ftab; fl != 0; fl = fl->f_next)
|
||||
if (fl->f_needs != 0)
|
||||
do_count(fl->f_needs, fl->f_needs, 1);
|
||||
for (fl = ftab; fl != 0; fl = fl->f_next)
|
||||
if (fl->f_needs != 0)
|
||||
do_count(fl->f_needs, fl->f_needs, 1);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -176,28 +176,28 @@ void headers()
|
||||
*/
|
||||
char *
|
||||
toheader(dev)
|
||||
char *dev;
|
||||
char *dev;
|
||||
{
|
||||
static char hbuf[80];
|
||||
static char hbuf[80];
|
||||
|
||||
(void) strcpy(hbuf, path(dev));
|
||||
(void) strcat(hbuf, ".h");
|
||||
return (hbuf);
|
||||
(void) strcpy(hbuf, path(dev));
|
||||
(void) strcat(hbuf, ".h");
|
||||
return (hbuf);
|
||||
}
|
||||
|
||||
/*
|
||||
* convert a dev name to a macro name
|
||||
*/
|
||||
char *tomacro(dev)
|
||||
register char *dev;
|
||||
register char *dev;
|
||||
{
|
||||
static char mbuf[20];
|
||||
register char *cp;
|
||||
static char mbuf[20];
|
||||
register char *cp;
|
||||
|
||||
cp = mbuf;
|
||||
*cp++ = 'N';
|
||||
while (*dev)
|
||||
*cp++ = islower(*dev) ? toupper(*dev++) : *dev++;
|
||||
*cp++ = 0;
|
||||
return (mbuf);
|
||||
cp = mbuf;
|
||||
*cp++ = 'N';
|
||||
while (*dev)
|
||||
*cp++ = islower(*dev) ? toupper(*dev++) : *dev++;
|
||||
*cp++ = 0;
|
||||
return (mbuf);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -12,8 +12,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -42,172 +42,174 @@
|
||||
|
||||
void swapconf()
|
||||
{
|
||||
register struct file_list *fl;
|
||||
struct file_list *do_swap();
|
||||
register struct file_list *fl;
|
||||
struct file_list *do_swap();
|
||||
|
||||
fl = conf_list;
|
||||
while (fl) {
|
||||
if (fl->f_type != SYSTEMSPEC) {
|
||||
fl = fl->f_next;
|
||||
continue;
|
||||
}
|
||||
fl = do_swap(fl);
|
||||
}
|
||||
fl = conf_list;
|
||||
while (fl) {
|
||||
if (fl->f_type != SYSTEMSPEC) {
|
||||
fl = fl->f_next;
|
||||
continue;
|
||||
}
|
||||
fl = do_swap(fl);
|
||||
}
|
||||
}
|
||||
|
||||
struct file_list *
|
||||
do_swap(fl)
|
||||
register struct file_list *fl;
|
||||
register struct file_list *fl;
|
||||
{
|
||||
FILE *fp;
|
||||
char swapname[80];
|
||||
register struct file_list *swap;
|
||||
dev_t dev;
|
||||
FILE *fp;
|
||||
char swapname[80];
|
||||
register struct file_list *swap;
|
||||
dev_t dev;
|
||||
|
||||
if (eq(fl->f_fn, "generic")) {
|
||||
fl = fl->f_next;
|
||||
return (fl->f_next);
|
||||
}
|
||||
(void) sprintf(swapname, "swap%s.c", fl->f_fn);
|
||||
fp = fopen(path(swapname), "w");
|
||||
if (fp == 0) {
|
||||
perror(path(swapname));
|
||||
exit(1);
|
||||
}
|
||||
fprintf(fp, "#include \"sys/param.h\"\n");
|
||||
fprintf(fp, "#include \"sys/conf.h\"\n");
|
||||
fprintf(fp, "\n");
|
||||
/*
|
||||
* If there aren't any swap devices
|
||||
* specified, just return, the error
|
||||
* has already been noted.
|
||||
*/
|
||||
swap = fl->f_next;
|
||||
if (swap == 0 || swap->f_type != SWAPSPEC) {
|
||||
(void) unlink(path(swapname));
|
||||
fclose(fp);
|
||||
return (swap);
|
||||
}
|
||||
fprintf(fp, "dev_t\trootdev = makedev(%d, %d);\n",
|
||||
major(fl->f_rootdev), minor(fl->f_rootdev));
|
||||
fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\n",
|
||||
major(fl->f_dumpdev), minor(fl->f_dumpdev));
|
||||
fprintf(fp, "\n");
|
||||
fprintf(fp, "struct\tswdevt swdevt[] = {\n");
|
||||
do {
|
||||
dev = swap->f_swapdev;
|
||||
fprintf(fp, "\t{ makedev(%d, %d),\t%d,\t%d },\t/* %s */\n",
|
||||
major(dev), minor(dev), swap->f_swapflag,
|
||||
swap->f_swapsize, swap->f_fn);
|
||||
swap = swap->f_next;
|
||||
} while (swap && swap->f_type == SWAPSPEC);
|
||||
fprintf(fp, "\t{ NODEV, 0, 0 }\n");
|
||||
fprintf(fp, "};\n");
|
||||
fclose(fp);
|
||||
return (swap);
|
||||
if (eq(fl->f_fn, "generic")) {
|
||||
fl = fl->f_next;
|
||||
return (fl->f_next);
|
||||
}
|
||||
(void) sprintf(swapname, "swap%s.c", fl->f_fn);
|
||||
fp = fopen(path(swapname), "w");
|
||||
if (fp == 0) {
|
||||
perror(path(swapname));
|
||||
exit(1);
|
||||
}
|
||||
fprintf(fp, "#include \"sys/param.h\"\n");
|
||||
fprintf(fp, "#include \"sys/conf.h\"\n");
|
||||
fprintf(fp, "\n");
|
||||
/*
|
||||
* If there aren't any swap devices
|
||||
* specified, just return, the error
|
||||
* has already been noted.
|
||||
*/
|
||||
swap = fl->f_next;
|
||||
if (swap == 0 || swap->f_type != SWAPSPEC) {
|
||||
(void) unlink(path(swapname));
|
||||
fclose(fp);
|
||||
return (swap);
|
||||
}
|
||||
fprintf(fp, "dev_t\trootdev = makedev(%d, %d);\n",
|
||||
major(fl->f_rootdev), minor(fl->f_rootdev));
|
||||
fprintf(fp, "dev_t\tdumpdev = makedev(%d, %d);\n",
|
||||
major(fl->f_dumpdev), minor(fl->f_dumpdev));
|
||||
fprintf(fp, "\n");
|
||||
fprintf(fp, "struct\tswdevt swdevt[] = {\n");
|
||||
do {
|
||||
dev = swap->f_swapdev;
|
||||
fprintf(fp, "\t{ makedev(%d, %d),\t%d,\t%d },\t/* %s */\n",
|
||||
major(dev), minor(dev), swap->f_swapflag,
|
||||
swap->f_swapsize, swap->f_fn);
|
||||
swap = swap->f_next;
|
||||
} while (swap && swap->f_type == SWAPSPEC);
|
||||
fprintf(fp, "\t{ NODEV, 0, 0 }\n");
|
||||
fprintf(fp, "};\n");
|
||||
fclose(fp);
|
||||
return (swap);
|
||||
}
|
||||
|
||||
static int devtablenotread = 1;
|
||||
static struct devdescription {
|
||||
char *dev_name;
|
||||
int dev_major;
|
||||
struct devdescription *dev_next;
|
||||
static int devtablenotread = 1;
|
||||
|
||||
static struct devdescription {
|
||||
char *dev_name;
|
||||
int dev_major;
|
||||
struct devdescription *dev_next;
|
||||
} *devtable;
|
||||
|
||||
void initdevtable()
|
||||
{
|
||||
char buf[BUFSIZ];
|
||||
int maj;
|
||||
register struct devdescription **dp = &devtable;
|
||||
FILE *fp;
|
||||
char buf[BUFSIZ];
|
||||
int maj;
|
||||
register struct devdescription **dp = &devtable;
|
||||
FILE *fp;
|
||||
|
||||
(void) sprintf(buf, "../conf/devices.%s", machinename);
|
||||
fp = fopen(buf, "r");
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "config: can't open %s\n", buf);
|
||||
exit(1);
|
||||
}
|
||||
while (fscanf(fp, "%s\t%d\n", buf, &maj) == 2) {
|
||||
*dp = (struct devdescription *)malloc(sizeof (**dp));
|
||||
(*dp)->dev_name = ns(buf);
|
||||
(*dp)->dev_major = maj;
|
||||
dp = &(*dp)->dev_next;
|
||||
}
|
||||
*dp = 0;
|
||||
fclose(fp);
|
||||
devtablenotread = 0;
|
||||
(void) sprintf(buf, "../conf/devices.%s", machinename);
|
||||
fp = fopen(buf, "r");
|
||||
if (fp == NULL) {
|
||||
fprintf(stderr, "config: can't open %s\n", buf);
|
||||
exit(1);
|
||||
}
|
||||
while (fscanf(fp, "%s\t%d\n", buf, &maj) == 2) {
|
||||
*dp = (struct devdescription *)malloc(sizeof (**dp));
|
||||
(*dp)->dev_name = ns(buf);
|
||||
(*dp)->dev_major = maj;
|
||||
dp = &(*dp)->dev_next;
|
||||
}
|
||||
*dp = 0;
|
||||
fclose(fp);
|
||||
devtablenotread = 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Given a device name specification figure out:
|
||||
* major device number
|
||||
* partition
|
||||
* device name
|
||||
* unit number
|
||||
* major device number
|
||||
* partition
|
||||
* device name
|
||||
* unit number
|
||||
* This is a hack, but the system still thinks in
|
||||
* terms of major/minor instead of string names.
|
||||
*/
|
||||
dev_t
|
||||
nametodev(name, defunit, defpartition)
|
||||
char *name;
|
||||
int defunit;
|
||||
char defpartition;
|
||||
char *name;
|
||||
int defunit;
|
||||
char defpartition;
|
||||
{
|
||||
char *cp, partition;
|
||||
int unit;
|
||||
register struct devdescription *dp;
|
||||
char *cp, partition;
|
||||
int unit;
|
||||
register struct devdescription *dp;
|
||||
|
||||
cp = name;
|
||||
if (cp == 0) {
|
||||
fprintf(stderr, "config: internal error, nametodev\n");
|
||||
exit(1);
|
||||
}
|
||||
while (*cp && !isdigit(*cp))
|
||||
cp++;
|
||||
unit = *cp ? atoi(cp) : defunit;
|
||||
if (unit < 0 || unit > 31) {
|
||||
fprintf(stderr,
|
||||
"config: %s: invalid device specification, unit out of range\n", name);
|
||||
unit = defunit; /* carry on more checking */
|
||||
}
|
||||
if (*cp) {
|
||||
*cp++ = '\0';
|
||||
while (*cp && isdigit(*cp))
|
||||
cp++;
|
||||
}
|
||||
partition = *cp ? *cp : defpartition;
|
||||
if (partition < 'a' || partition > 'h') {
|
||||
fprintf(stderr,
|
||||
"config: %c: invalid device specification, bad partition\n", *cp);
|
||||
partition = defpartition; /* carry on */
|
||||
}
|
||||
if (devtablenotread)
|
||||
initdevtable();
|
||||
for (dp = devtable; dp; dp = dp->dev_next)
|
||||
if (eq(name, dp->dev_name))
|
||||
break;
|
||||
if (dp == 0) {
|
||||
fprintf(stderr, "config: %s: unknown device\n", name);
|
||||
return (NODEV);
|
||||
}
|
||||
return (makedev(dp->dev_major, (unit << 3) + (partition - 'a')));
|
||||
cp = name;
|
||||
if (cp == 0) {
|
||||
fprintf(stderr, "config: internal error, nametodev\n");
|
||||
exit(1);
|
||||
}
|
||||
while (*cp && !isdigit(*cp))
|
||||
cp++;
|
||||
unit = *cp ? atoi(cp) : defunit;
|
||||
if (unit < 0 || unit > 31) {
|
||||
fprintf(stderr,
|
||||
"config: %s: invalid device specification, unit out of range\n",
|
||||
name);
|
||||
unit = defunit; /* carry on more checking */
|
||||
}
|
||||
if (*cp) {
|
||||
*cp++ = '\0';
|
||||
while (*cp && isdigit(*cp))
|
||||
cp++;
|
||||
}
|
||||
partition = *cp ? *cp : defpartition;
|
||||
if (partition < 'a' || partition > 'h') {
|
||||
fprintf(stderr,
|
||||
"config: %c: invalid device specification, bad partition\n", *cp);
|
||||
partition = defpartition; /* carry on */
|
||||
}
|
||||
if (devtablenotread)
|
||||
initdevtable();
|
||||
for (dp = devtable; dp; dp = dp->dev_next)
|
||||
if (eq(name, dp->dev_name))
|
||||
break;
|
||||
if (dp == 0) {
|
||||
fprintf(stderr, "config: %s: unknown device\n", name);
|
||||
return (NODEV);
|
||||
}
|
||||
return (makedev(dp->dev_major, (unit << 3) + (partition - 'a')));
|
||||
}
|
||||
|
||||
char *
|
||||
devtoname(dev)
|
||||
dev_t dev;
|
||||
dev_t dev;
|
||||
{
|
||||
char buf[80];
|
||||
register struct devdescription *dp;
|
||||
char buf[80];
|
||||
register struct devdescription *dp;
|
||||
|
||||
if (devtablenotread)
|
||||
initdevtable();
|
||||
for (dp = devtable; dp; dp = dp->dev_next)
|
||||
if (major(dev) == dp->dev_major)
|
||||
break;
|
||||
if (dp == 0)
|
||||
dp = devtable;
|
||||
(void) sprintf(buf, "%s%d%c", dp->dev_name,
|
||||
minor(dev) >> 3, (minor(dev) & 07) + 'a');
|
||||
return (ns(buf));
|
||||
if (devtablenotread)
|
||||
initdevtable();
|
||||
for (dp = devtable; dp; dp = dp->dev_next)
|
||||
if (major(dev) == dp->dev_major)
|
||||
break;
|
||||
if (dp == 0)
|
||||
dp = devtable;
|
||||
(void) sprintf(buf, "%s%d%c", dp->dev_name,
|
||||
minor(dev) >> 3, (minor(dev) & 07) + 'a');
|
||||
return (ns(buf));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*-
|
||||
* Copyright (c) 1980, 1993
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
* The Regents of the University of California. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -12,8 +12,8 @@
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
* 3. All advertising materials mentioning features or use of this software
|
||||
* must display the following acknowledgement:
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* This product includes software developed by the University of
|
||||
* California, Berkeley and its contributors.
|
||||
* 4. Neither the name of the University nor the names of its contributors
|
||||
* may be used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
@@ -40,89 +40,89 @@
|
||||
|
||||
ubglue()
|
||||
{
|
||||
register FILE *fp;
|
||||
register struct device *dp, *mp;
|
||||
register FILE *fp;
|
||||
register struct device *dp, *mp;
|
||||
|
||||
fp = fopen(path("ubglue.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("ubglue.s"));
|
||||
exit(1);
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
fp = fopen(path("ubglue.s"), "w");
|
||||
if (fp == 0) {
|
||||
perror(path("ubglue.s"));
|
||||
exit(1);
|
||||
}
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_vec(fp, id->id, dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_std(fp);
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_vec(fp, id->id, dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_std(fp);
|
||||
for (dp = dtab; dp != 0; dp = dp->d_next) {
|
||||
mp = dp->d_conn;
|
||||
if (mp != 0 && mp != (struct device *)-1 &&
|
||||
!eq(mp->d_name, "mba")) {
|
||||
struct idlst *id, *id2;
|
||||
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_intname(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_ctrs(fp);
|
||||
(void) fclose(fp);
|
||||
for (id = dp->d_vec; id; id = id->id_next) {
|
||||
for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
|
||||
if (id2 == id) {
|
||||
dump_intname(fp, id->id,
|
||||
dp->d_unit);
|
||||
break;
|
||||
}
|
||||
if (!strcmp(id->id, id2->id))
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
dump_ctrs(fp);
|
||||
(void) fclose(fp);
|
||||
}
|
||||
|
||||
static int cntcnt = 0; /* number of interrupt counters allocated */
|
||||
static int cntcnt = 0; /* number of interrupt counters allocated */
|
||||
|
||||
/*
|
||||
* print an interrupt vector
|
||||
*/
|
||||
dump_vec(fp, vector, number)
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
{
|
||||
char nbuf[80];
|
||||
register char *v = nbuf;
|
||||
char nbuf[80];
|
||||
register char *v = nbuf;
|
||||
|
||||
(void) sprintf(v, "%s%d", vector, number);
|
||||
fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
|
||||
v, v);
|
||||
fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
|
||||
if (strncmp(vector, "dzx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number);
|
||||
else if (strncmp(vector, "dpx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number);
|
||||
else if (strncmp(vector, "dpr", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number);
|
||||
else {
|
||||
if (strncmp(vector, "uur", 3) == 0) {
|
||||
fprintf(fp, "#ifdef UUDMA\n");
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number);
|
||||
fprintf(fp, "#endif\n");
|
||||
}
|
||||
fprintf(fp, "\tpushl\t$%d\n", number);
|
||||
fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector);
|
||||
fprintf(fp, "\tincl\t_cnt+V_INTR\n\trei\n\n");
|
||||
}
|
||||
(void) sprintf(v, "%s%d", vector, number);
|
||||
fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
|
||||
v, v);
|
||||
fprintf(fp, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt++);
|
||||
if (strncmp(vector, "dzx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number);
|
||||
else if (strncmp(vector, "dpx", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number);
|
||||
else if (strncmp(vector, "dpr", 3) == 0)
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number);
|
||||
else {
|
||||
if (strncmp(vector, "uur", 3) == 0) {
|
||||
fprintf(fp, "#ifdef UUDMA\n");
|
||||
fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number);
|
||||
fprintf(fp, "#endif\n");
|
||||
}
|
||||
fprintf(fp, "\tpushl\t$%d\n", number);
|
||||
fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector);
|
||||
fprintf(fp, "\tincl\t_cnt+V_INTR\n\trei\n\n");
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -132,61 +132,61 @@ dump_vec(fp, vector, number)
|
||||
* with the definitions in scb.s.
|
||||
*/
|
||||
dump_std(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
fprintf(fp, "\n\t.globl\t_intrnames\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrnames\n");
|
||||
fprintf(fp, "\t.data\n");
|
||||
fprintf(fp, "_intrnames:\n");
|
||||
fprintf(fp, "\t.asciz\t\"clock\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"cnr\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"cnx\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"tur\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"tux\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba0\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba1\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba2\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba3\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba0\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba1\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba2\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba3\"\n");
|
||||
#define I_FIXED 13 /* number of names above */
|
||||
fprintf(fp, "\n\t.globl\t_intrnames\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrnames\n");
|
||||
fprintf(fp, "\t.data\n");
|
||||
fprintf(fp, "_intrnames:\n");
|
||||
fprintf(fp, "\t.asciz\t\"clock\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"cnr\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"cnx\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"tur\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"tux\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba0\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba1\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba2\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"mba3\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba0\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba1\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba2\"\n");
|
||||
fprintf(fp, "\t.asciz\t\"uba3\"\n");
|
||||
#define I_FIXED 13 /* number of names above */
|
||||
}
|
||||
|
||||
dump_intname(fp, vector, number)
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
register FILE *fp;
|
||||
char *vector;
|
||||
int number;
|
||||
{
|
||||
register char *cp = vector;
|
||||
register char *cp = vector;
|
||||
|
||||
fprintf(fp, "\t.asciz\t\"");
|
||||
/*
|
||||
* Skip any "int" or "intr" in the name.
|
||||
*/
|
||||
while (*cp)
|
||||
if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
|
||||
cp += 3;
|
||||
if (*cp == 'r')
|
||||
cp++;
|
||||
} else {
|
||||
putc(*cp, fp);
|
||||
cp++;
|
||||
}
|
||||
fprintf(fp, "%d\"\n", number);
|
||||
fprintf(fp, "\t.asciz\t\"");
|
||||
/*
|
||||
* Skip any "int" or "intr" in the name.
|
||||
*/
|
||||
while (*cp)
|
||||
if (cp[0] == 'i' && cp[1] == 'n' && cp[2] == 't') {
|
||||
cp += 3;
|
||||
if (*cp == 'r')
|
||||
cp++;
|
||||
} else {
|
||||
putc(*cp, fp);
|
||||
cp++;
|
||||
}
|
||||
fprintf(fp, "%d\"\n", number);
|
||||
}
|
||||
|
||||
dump_ctrs(fp)
|
||||
register FILE *fp;
|
||||
register FILE *fp;
|
||||
{
|
||||
fprintf(fp, "_eintrnames:\n");
|
||||
fprintf(fp, "\n\t.globl\t_intrcnt\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrcnt\n");
|
||||
fprintf(fp, "_intrcnt:\n", I_FIXED);
|
||||
fprintf(fp, "\t.space\t4 * %d\n", I_FIXED);
|
||||
fprintf(fp, "_fltintrcnt:\n", cntcnt);
|
||||
fprintf(fp, "\t.space\t4 * %d\n", cntcnt);
|
||||
fprintf(fp, "_eintrcnt:\n\n");
|
||||
fprintf(fp, "\t.text\n");
|
||||
fprintf(fp, "_eintrnames:\n");
|
||||
fprintf(fp, "\n\t.globl\t_intrcnt\n");
|
||||
fprintf(fp, "\n\t.globl\t_eintrcnt\n");
|
||||
fprintf(fp, "_intrcnt:\n", I_FIXED);
|
||||
fprintf(fp, "\t.space\t4 * %d\n", I_FIXED);
|
||||
fprintf(fp, "_fltintrcnt:\n", cntcnt);
|
||||
fprintf(fp, "\t.space\t4 * %d\n", cntcnt);
|
||||
fprintf(fp, "_eintrcnt:\n\n");
|
||||
fprintf(fp, "\t.text\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user