|
|
1.1 root 1: #ifndef lint
2: static char sccsid[] = "@(#)mkubglue.c 1.11 (Berkeley) 8/11/83";
3: #endif
4:
5: /*
6: * Make the uba interrupt file ubglue.s
7: */
8: #include <stdio.h>
9: #include "config.h"
10: #include "y.tab.h"
11: #include "maxconf.h"
12:
13: ubglue()
14: {
15: register FILE *fp;
16: register struct device *dp, *mp;
17: int i,j;
18:
19: fp = fopen(path("ubglue.s"), "w");
20: if (fp == 0) {
21: perror(path("ubglue.s"));
22: exit(1);
23: }
24: for (dp = dtab; dp != 0; dp = dp->d_next) {
25: /*
26: printdp(dp);
27: */
28: mp = dp->d_conn;
29: if (mp != 0 && mp != (struct device *)-1 &&
30: !eq(mp->d_name, "mba")) {
31: struct idlst *id, *id2;
32:
33: for (id = dp->d_vec; id; id = id->id_next) {
34: for (id2 = dp->d_vec; id2; id2 = id2->id_next) {
35: if (id2 == id) {
36: dump_vec(fp, id->id, dp->d_unit);
37: /* increment counter for each
38: /* vector which is dumped.
39: */
40: for(i=0;i<=maxvects;i++)
41: if(!strcmp(id->id,max_conf[i].mc_intname))
42: max_conf[i].mc_count++;
43: break;
44: }
45: if (!strcmp(id->id, id2->id))
46: break;
47: }
48: }
49: }
50: }
51: for(i=0 ; i<=maxvects ; i++)
52: for(j=max_conf[i].mc_count;j < max_conf[i].mc_max;j++)
53: dump_dummy(fp,max_conf[i].mc_intname,j);
54: (void) fclose(fp);
55: }
56:
57: printdp(dp)
58: register struct device *dp;
59: {
60: struct idlst *id;
61: printf("dp=%x, Type=%d, connected to %x, name:%s\n",
62: dp,dp->d_type,dp->d_conn,dp->d_name);
63: printf("vectors:");
64: for (id = dp->d_vec; id; id = id->id_next)
65: printf(" %s, ",id->id);
66: printf("\n pri=%d, addr=%d, unit=%d, drive=%d, slave=%d \n",
67: dp->d_pri,dp->d_addr,dp->d_unit,dp->d_drive,dp->d_slave);
68: printf("Next one in list: %x\n",dp->d_next);
69: }
70:
71:
72:
73: /*
74: * print an interrupt vector
75: */
76: dump_vec(fp, vector, number)
77: register FILE *fp;
78: char *vector;
79: int number;
80: {
81: char nbuf[80];
82: register char *v = nbuf;
83:
84: (void) sprintf(v, "%s%d", vector, number);
85: fprintf(fp, "SCBVEC(%s):\n", v);
86: fprintf(fp, "\tCHECK_SFE(4)\n");
87: fprintf(fp, "\tSAVE_FPSTAT(4)\n");
88: fprintf(fp, "\tPUSHR\n");
89: fprintf(fp, "\tpushl\t$%d\n", number);
90: fprintf(fp, "\tcallf\t$8,_%s\n", vector);
91: fprintf(fp, "\tincl\t_cnt+V_INTR\n");
92: fprintf(fp, "\tPOPR\n");
93: fprintf(fp, "\tREST_FPSTAT\n");
94: fprintf(fp, "\trei\n\n");
95: /* We will have to change some of the names of the driver routines... */
96:
97:
98: }
99: /*
100: * print an unimplemented (in the present configuration)interrupt vector
101: */
102: dump_dummy(fp, vector, number)
103: register FILE *fp;
104: char *vector;
105: int number;
106: {
107: char nbuf[80];
108: register char *v = nbuf;
109:
110: (void) sprintf(v, "%s%d", vector, number);
111: fprintf(fp, "SCBVEC(%s):\n", v);
112: fprintf(fp, "\tSAVE_FPSTAT(4);\n");
113: fprintf(fp, "\tPUSHR;\n");
114: fprintf(fp, "\tPRINTF(0,\"******* Unimplemented interrupt ");
115: fprintf(fp, "(%s) ********\\n\");\n", v);
116: fprintf(fp, "\tPOPR;\n\trei\n\n");
117: fprintf(fp, "\tREST_FPSTAT;\n\trei\n\n");
118:
119:
120: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.