+
+/*
+ * Create the ISA interrupt vector glue file.
+ */
+vector() {
+ register FILE *fp, *gp;
+ register struct device *dp, *mp;
+ int count;
+
+ 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\
+\n\
+#define VEC(name) .align 4; .globl _V/**/name; _V/**/name:\n\n");
+
+ fprintf(fp,"\
+ .globl _hardclock\n\
+VEC(clk)\n\
+ INTR(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;
+
+ 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, ",
+ dp->d_name, dp->d_unit, 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);
+}