1995-02-13 03:41:55 +03:00
|
|
|
#!/usr/bin/awk -f
|
|
|
|
#
|
1995-03-30 02:50:47 +04:00
|
|
|
# $NetBSD: mkoldconf.awk,v 1.3 1995/03/29 22:50:51 ragge Exp $
|
1995-02-13 03:41:55 +03:00
|
|
|
#
|
|
|
|
|
1995-02-23 20:50:56 +03:00
|
|
|
/tmscd/{
|
|
|
|
tmsplats[ntms]=$2;
|
|
|
|
tmsaddr[ntms]=$5;
|
|
|
|
ntms++;
|
|
|
|
}
|
|
|
|
|
1995-02-13 03:41:55 +03:00
|
|
|
/racd/{
|
|
|
|
raplats[nra]=$2;
|
|
|
|
raaddr[nra]=$5;
|
|
|
|
nra++;
|
|
|
|
}
|
|
|
|
|
|
|
|
/decd/{
|
|
|
|
deplats[nde]=$2;
|
|
|
|
deaddr[nde]=$5;
|
|
|
|
nde++;
|
|
|
|
}
|
|
|
|
|
1995-03-30 02:50:47 +04:00
|
|
|
/qecd/{
|
|
|
|
qeplats[nqe]=$2;
|
|
|
|
qeaddr[nqe]=$5;
|
|
|
|
nqe++;
|
|
|
|
}
|
|
|
|
|
1995-02-13 03:41:55 +03:00
|
|
|
{
|
|
|
|
if(savenext==1){
|
|
|
|
l=sprintf("%d",$2)
|
|
|
|
udanummer[l-1]=nuda-1
|
|
|
|
savenext=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
1995-02-23 20:50:56 +03:00
|
|
|
{
|
|
|
|
if(tmssavenext==1){
|
|
|
|
l=sprintf("%d",$2)
|
|
|
|
tmsnummer[l-1]=ntmscp-1
|
|
|
|
tmssavenext=0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/tmscpcd/{
|
|
|
|
tmscpplats[ntmscp]=$2;
|
1995-03-30 02:50:47 +04:00
|
|
|
tmscpaddr[ntmscp]=$5;
|
1995-02-23 20:50:56 +03:00
|
|
|
ntmscp++;
|
|
|
|
tmssavenext=1;
|
|
|
|
}
|
|
|
|
|
1995-02-13 03:41:55 +03:00
|
|
|
/udacd/{
|
|
|
|
udaplats[nuda]=$2;
|
|
|
|
udaddr[nuda]=$5;
|
|
|
|
nuda++;
|
|
|
|
savenext=1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/};/{
|
|
|
|
k=0;
|
|
|
|
m=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
if (k==1){
|
|
|
|
for(i=1;i<NF+1;i++){
|
|
|
|
loc[loccnt+i]=$i;
|
|
|
|
}
|
|
|
|
loccnt+=NF;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/static int loc/{
|
|
|
|
k=1;
|
|
|
|
loccnt=0;
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
if(m==1){
|
|
|
|
for(i=1;i<NF+1;i++){
|
|
|
|
pv[i]=$i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/static short pv/{
|
|
|
|
m=1;
|
|
|
|
}
|
|
|
|
|
|
|
|
END{
|
|
|
|
|
|
|
|
printf "#include \"sys/param.h\"\n"
|
|
|
|
printf "#include \"machine/pte.h\"\n"
|
|
|
|
printf "#include \"sys/buf.h\"\n"
|
|
|
|
printf "#include \"sys/map.h\"\n"
|
|
|
|
|
|
|
|
printf "#include \"vax/uba/ubavar.h\"\n"
|
|
|
|
|
|
|
|
printf "int antal_ra=%d;\n",nra-1
|
|
|
|
printf "int antal_de=%d;\n",nde-1
|
|
|
|
printf "int antal_uda=%d;\n",nuda-1
|
1995-02-23 20:50:56 +03:00
|
|
|
printf "int antal_tms=%d;\n",ntms-1
|
|
|
|
printf "int antal_tmscp=%d;\n",ntmscp-1
|
1995-02-13 03:41:55 +03:00
|
|
|
|
|
|
|
printf "extern struct uba_driver udadriver;\n"
|
|
|
|
printf "extern struct uba_driver dedriver;\n"
|
1995-03-30 02:50:47 +04:00
|
|
|
printf "extern struct uba_driver qedriver;\n"
|
1995-02-23 20:50:56 +03:00
|
|
|
if(ntms) printf "extern struct uba_driver tmscpdriver;\n"
|
|
|
|
if(ntms) printf "int tmscpintr();\n"
|
1995-02-13 03:41:55 +03:00
|
|
|
printf "int deintr();\n"
|
1995-03-30 02:50:47 +04:00
|
|
|
printf "int qeintr();\n"
|
1995-02-13 03:41:55 +03:00
|
|
|
printf "int udaintr();\n"
|
1995-02-23 20:50:56 +03:00
|
|
|
printf "int udacd=0, racd=0, tmscpcd=0, tmscd=0;\n"
|
1995-02-13 03:41:55 +03:00
|
|
|
printf "#define C (caddr_t)\n"
|
|
|
|
|
|
|
|
printf "struct uba_ctlr ubminit[]={\n"
|
|
|
|
for(i=1;i<nuda;i++){
|
|
|
|
k=sprintf("%d",udaddr[i])
|
|
|
|
printf " { &udadriver, %d,0,0,udaintr,C %s},\n",
|
|
|
|
udaplats[i],loc[k+1]
|
|
|
|
}
|
1995-02-23 20:50:56 +03:00
|
|
|
for(i=1;i<ntmscp;i++){
|
|
|
|
k=sprintf("%d",tmscpaddr[i])
|
1995-03-30 02:50:47 +04:00
|
|
|
if(ntms)printf " { &tmscpdriver, %d,'?',0,tmscpintr,C %s},\n",
|
1995-02-23 20:50:56 +03:00
|
|
|
tmscpplats[i],loc[k+1]
|
|
|
|
}
|
1995-02-13 03:41:55 +03:00
|
|
|
printf "0};\n"
|
|
|
|
|
|
|
|
printf "struct uba_device ubdinit[]={\n"
|
|
|
|
for(i=1;i<nra;i++){
|
|
|
|
k=sprintf("%d",raaddr[i])
|
|
|
|
printf " { &udadriver,%d,%d,0,%d,0,0,1,0},\n",raplats[i],
|
|
|
|
rr++/4,loc[k+1]
|
|
|
|
}
|
|
|
|
for(i=1;i<nde;i++){
|
|
|
|
k=sprintf("%d",deaddr[i])
|
|
|
|
printf " {&dedriver,%d,-1,0,-1,deintr,C %s0,0},\n",deplats[i],
|
|
|
|
loc[k+1]
|
|
|
|
}
|
1995-03-30 02:50:47 +04:00
|
|
|
for(i=1;i<nqe;i++){
|
|
|
|
k=sprintf("%d",qeaddr[i])
|
|
|
|
printf " {&qedriver,%d,-1,0,-1,qeintr,C %s0,0},\n",qeplats[i],
|
|
|
|
loc[k+1]
|
|
|
|
}
|
1995-02-23 20:50:56 +03:00
|
|
|
for(i=1;i<ntms;i++){
|
|
|
|
k=sprintf("%d",tmsaddr[i])
|
1995-03-30 02:50:47 +04:00
|
|
|
printf " {&tmscpdriver,%d,0,'?',0,0,C 0,1,0},\n",tmsplats[i]
|
1995-02-23 20:50:56 +03:00
|
|
|
}
|
1995-02-13 03:41:55 +03:00
|
|
|
printf "0};\n"
|
1995-02-23 20:50:56 +03:00
|
|
|
|
1995-02-13 03:41:55 +03:00
|
|
|
}
|
1995-02-23 20:50:56 +03:00
|
|
|
|