|
|
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: ! 12: ubglue() ! 13: { ! 14: register FILE *fp; ! 15: register struct device *dp, *mp; ! 16: ! 17: fp = fopen(path("ubglue.s"), "w"); ! 18: if (fp == 0) { ! 19: perror(path("ubglue.s")); ! 20: exit(1); ! 21: } ! 22: for (dp = dtab; dp != 0; dp = dp->d_next) { ! 23: mp = dp->d_conn; ! 24: if (mp != 0 && mp != (struct device *)-1 && ! 25: !eq(mp->d_name, "mba")) { ! 26: struct idlst *id, *id2; ! 27: ! 28: for (id = dp->d_vec; id; id = id->id_next) { ! 29: for (id2 = dp->d_vec; id2; id2 = id2->id_next) { ! 30: if (id2 == id) { ! 31: dump_vec(fp, id->id, dp->d_unit); ! 32: break; ! 33: } ! 34: if (!strcmp(id->id, id2->id)) ! 35: break; ! 36: } ! 37: } ! 38: } ! 39: } ! 40: (void) fclose(fp); ! 41: } ! 42: ! 43: /* ! 44: * print an interrupt vector ! 45: */ ! 46: dump_vec(fp, vector, number) ! 47: register FILE *fp; ! 48: char *vector; ! 49: int number; ! 50: { ! 51: char nbuf[80]; ! 52: register char *v = nbuf; ! 53: ! 54: (void) sprintf(v, "%s%d", vector, number); ! 55: fprintf(fp, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n", ! 56: v, v); ! 57: if (strncmp(vector, "dzx", 3) == 0) ! 58: fprintf(fp, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number); ! 59: else { ! 60: if (strncmp(vector, "uur", 3) == 0) { ! 61: fprintf(fp, "#ifdef UUDMA\n"); ! 62: fprintf(fp, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number); ! 63: fprintf(fp, "#endif\n"); ! 64: } ! 65: fprintf(fp, "\tpushl\t$%d\n", number); ! 66: fprintf(fp, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector); ! 67: fprintf(fp, "#if defined(VAX750) || defined(VAX730)\n"); ! 68: fprintf(fp, "\tincl\t_cnt+V_INTR\n#endif\n\trei\n\n"); ! 69: } ! 70: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.