summaryrefslogtreecommitdiffstats
path: root/usr.sbin/config/mkglue.c
diff options
context:
space:
mode:
authorrgrimes <rgrimes@FreeBSD.org>1994-05-26 13:24:02 +0000
committerrgrimes <rgrimes@FreeBSD.org>1994-05-26 13:24:02 +0000
commitc8f1a26f8dda7f5350f6d52f5bbc4f5ec1a46cc4 (patch)
tree091be2a230c62c316ca02cf1016e73b206c14d25 /usr.sbin/config/mkglue.c
parent28839c379536620b072ba59884f5eed06d72e94d (diff)
downloadFreeBSD-src-c8f1a26f8dda7f5350f6d52f5bbc4f5ec1a46cc4.zip
FreeBSD-src-c8f1a26f8dda7f5350f6d52f5bbc4f5ec1a46cc4.tar.gz
Upgrade config to be compatible with our i386 port, pull in 95% of the
changes that have been made in FreeBSD 1.x, except for possibly the nfs diskless support this is a completed config.
Diffstat (limited to 'usr.sbin/config/mkglue.c')
-rw-r--r--usr.sbin/config/mkglue.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/usr.sbin/config/mkglue.c b/usr.sbin/config/mkglue.c
index e738515..f941e5f 100644
--- a/usr.sbin/config/mkglue.c
+++ b/usr.sbin/config/mkglue.c
@@ -338,31 +338,24 @@ vector() {
register struct device *dp, *mp;
int count;
- fp = fopen(path("vector.s"), "w");
+ fp = fopen(path("vector.h"), "w");
if (fp == 0) {
- perror(path("vector.s"));
+ perror(path("vector.h"));
exit(1);
}
- fprintf(fp,"\
+ fprintf(fp, "\
/*\n\
* AT/386\n\
- * Interrupt vector routines\n\
+ * Macros for 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");
+ */\n\
+\n");
- fprintf(fp,"\
- .globl _hardclock\n\
-VEC(clk)\n\
- INTR1(0, _highmask, 0)\n\
- call _hardclock \n\
- INTREXIT1\n\n\n");
+ fprintf(fp, "\
+#define BUILD_VECTORS \\\n\
+ BUILD_VECTOR(clk, 0,0,0, _high_imask, _clkintr,1,1, al);\\\n");
- count=0;
+ count=1;
for (dp = dtab; dp != 0; dp = dp->d_next) {
mp = dp->d_conn;
if (mp != 0 && /* mp != (struct device *)-1 &&*/
@@ -372,29 +365,36 @@ VEC(clk)\n\
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;
+ build_vector(fp, dp, id, count);
+ count++;
+ if (!strcmp(id->id, id2->id))
+ break;
}
- if (!strcmp(id->id, id2->id))
- break;
}
}
}
}
+ fprintf(fp, "\n\n#define NR_REAL_INT_HANDLERS %d\n", count);
(void) fclose(fp);
}
+
+build_vector(fp, dp, id, offset)
+ register FILE *fp;
+ register struct device *dp;
+ struct idlst *id;
+ int offset;
+{
+ fprintf(fp, "\tBUILD_%sVECTOR(%s%d, %d,%d,%d",
+ strcmp(dp->d_name, "sio") == 0 ? "FAST_" : "",
+ dp->d_name, dp->d_unit, dp->d_unit, dp->d_irq, offset);
+ if (eq(dp->d_mask, "null"))
+ fprintf(fp, ", _%s%d_imask,", dp->d_name, dp->d_unit);
+ else
+ fprintf(fp, ", _%s_imask, ", dp->d_mask);
+ fprintf(fp, " _%s,%d,1", id->id, 1 + dp->d_irq / 8);
+ if (dp->d_irq < 8)
+ fprintf(fp, ", al");
+ else
+ fprintf(fp, "_AND_2, ah");
+ fprintf(fp, ");\\\n");
+}
OpenPOWER on IntegriCloud