* Copyright (c) 1980 Regents of the University of California.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* PATCHES MAGIC LEVEL PATCH THAT GOT US HERE
* -------------------- ----- ----------------------
* CURRENT PATCH LEVEL: 2 00158
* -------------------- ----- ----------------------
* 26 Mar 93 Rodney W. Grimes Added interrupt counters for vmstat,
* also false and stray counter names.
* 26 Apr 93 Bruce Evans Support for intr-0.1
* 17 May 93 Rodney W. Grimes Changed id_num to be unique. Misc
* other changes to make intr-0.1 work
* Interrupt counter names are now built
* using BUILD_VECTORS, no longer output
static char sccsid
[] = "@(#)mkglue.c 5.10 (Berkeley) 1/15/91";
* Make the bus adaptor interrupt glue files.
* Create the UNIBUS interrupt vector glue file.
register struct device
*dp
, *mp
;
fp
= fopen(path("ubglue.s"), "w");
perror(path("ubglue.s"));
gp
= fopen(path("ubvec.s"), "w");
for (dp
= dtab
; dp
!= 0; dp
= dp
->d_next
) {
if (mp
!= 0 && mp
!= (struct device
*)-1 &&
!eq(mp
->d_name
, "mba")) {
for (id
= dp
->d_vec
; id
; id
= id
->id_next
) {
for (id2
= dp
->d_vec
; id2
; id2
= id2
->id_next
) {
if (!strcmp(id
->id
, id2
->id
))
for (dp
= dtab
; dp
!= 0; dp
= dp
->d_next
) {
if (mp
!= 0 && mp
!= (struct device
*)-1 &&
!eq(mp
->d_name
, "mba")) {
for (id
= dp
->d_vec
; id
; id
= id
->id_next
) {
for (id2
= dp
->d_vec
; id2
; id2
= id2
->id_next
) {
if (!strcmp(id
->id
, id2
->id
))
static int cntcnt
= 0; /* number of interrupt counters allocated */
* Print a UNIBUS interrupt vector.
dump_ubavec(fp
, vector
, number
)
(void) sprintf(v
, "%s%d", vector
, number
);
fprintf(fp
, "\t.globl\t_X%s\n\t.align\t2\n_X%s:\n\tpushr\t$0x3f\n",
fprintf(fp
, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt
++);
if (strncmp(vector
, "dzx", 3) == 0)
fprintf(fp
, "\tmovl\t$%d,r0\n\tjmp\tdzdma\n\n", number
);
else if (strncmp(vector
, "dpx", 3) == 0)
fprintf(fp
, "\tmovl\t$%d,r0\n\tjmp\tdpxdma\n\n", number
);
else if (strncmp(vector
, "dpr", 3) == 0)
fprintf(fp
, "\tmovl\t$%d,r0\n\tjmp\tdprdma\n\n", number
);
if (strncmp(vector
, "uur", 3) == 0) {
fprintf(fp
, "#ifdef UUDMA\n");
fprintf(fp
, "\tmovl\t$%d,r0\n\tjsb\tuudma\n", number
);
fprintf(fp
, "\tpushl\t$%d\n", number
);
fprintf(fp
, "\tcalls\t$1,_%s\n\tpopr\t$0x3f\n", vector
);
fprintf(fp
, "\tincl\t_cnt+V_INTR\n\trei\n\n");
* Create the VERSAbus interrupt vector glue file.
register struct device
*dp
, *mp
;
fp
= fopen(path("vbglue.s"), "w");
perror(path("vbglue.s"));
gp
= fopen(path("vbvec.s"), "w");
for (dp
= dtab
; dp
!= 0; dp
= dp
->d_next
) {
if (mp
== 0 || mp
== (struct device
*)-1 ||
for (id
= dp
->d_vec
; id
; id
= id
->id_next
)
for (id2
= dp
->d_vec
; id2
; id2
= id2
->id_next
) {
dump_vbavec(fp
, id
->id
, dp
->d_unit
);
for (dp
= dtab
; dp
!= 0; dp
= dp
->d_next
) {
if (mp
!= 0 && mp
!= (struct device
*)-1 &&
!eq(mp
->d_name
, "mba")) {
for (id
= dp
->d_vec
; id
; id
= id
->id_next
) {
for (id2
= dp
->d_vec
; id2
; id2
= id2
->id_next
) {
* Print a VERSAbus interrupt vector
dump_vbavec(fp
, vector
, number
)
(void) sprintf(v
, "%s%d", vector
, number
);
fprintf(fp
, "SCBVEC(%s):\n", v
);
fprintf(fp
, "\tCHECK_SFE(4)\n");
fprintf(fp
, "\tSAVE_FPSTAT(4)\n");
fprintf(fp
, "\tPUSHR\n");
fprintf(fp
, "\tincl\t_fltintrcnt+(4*%d)\n", cntcnt
++);
fprintf(fp
, "\tpushl\t$%d\n", number
);
fprintf(fp
, "\tcallf\t$8,_%s\n", vector
);
fprintf(fp
, "\tincl\t_cnt+V_INTR\n");
fprintf(fp
, "\tREST_FPSTAT\n");
fprintf(fp
, "\trei\n\n");
* HP9000/300 interrupts are auto-vectored.
* Code is hardwired in locore.s
static char *vaxinames
[] = {
"clock", "cnr", "cnx", "tur", "tux",
"mba0", "mba1", "mba2", "mba3",
"uba0", "uba1", "uba2", "uba3"
static char *tahoeinames
[] = {
"clock", "cnr", "cnx", "rmtr", "rmtx", "buserr",
char **si_names
; /* list of standard interrupt names */
int si_n
; /* number of such names */
{ vaxinames
, sizeof (vaxinames
) / sizeof (vaxinames
[0]) },
{ tahoeinames
, (sizeof (tahoeinames
) / sizeof (tahoeinames
[0])) }
* Start the interrupt name table with the names
* of the standard vectors not directly associated
* with a bus. Also, dump the defines needed to
* reference the associated counters into a separate
* file which is prepended to locore.s.
register struct stdintrs
*si
= &stdintrs
[machine
-1];
fprintf(fp
, "\n\t.globl\t_intrnames\n");
fprintf(fp
, "\n\t.globl\t_eintrnames\n");
fprintf(fp
, "\t.data\n");
fprintf(fp
, "_intrnames:\n");
for (i
= 0; i
< si
->si_n
; i
++) {
if (cp
[0] == 'i' && cp
[1] == 'n' && cp
[2] == 't') {
for (tp
= buf
; *cp
; cp
++)
fprintf(gp
, "#define\tI_%s\t%d\n", buf
, i
*sizeof (long));
fprintf(fp
, "\t.asciz\t\"%s\"\n", *cpp
);
dump_intname(fp
, vector
, number
)
register char *cp
= vector
;
fprintf(fp
, "\t.asciz\t\"");
* Skip any "int" or "intr" in the name.
if (cp
[0] == 'i' && cp
[1] == 'n' && cp
[2] == 't') {
fprintf(fp
, "%d\"\n", number
);
* Reserve space for the interrupt counters.
struct stdintrs
*si
= &stdintrs
[machine
-1];
fprintf(fp
, "_eintrnames:\n");
fprintf(fp
, "\n\t.globl\t_intrcnt\n");
fprintf(fp
, "\n\t.globl\t_eintrcnt\n");
fprintf(fp
, "\t.align 2\n");
fprintf(fp
, "_intrcnt:\n");
fprintf(fp
, "\t.space\t4 * %d\n", si
->si_n
);
fprintf(fp
, "_fltintrcnt:\n");
fprintf(fp
, "\t.space\t4 * %d\n", cntcnt
);
fprintf(fp
, "_eintrcnt:\n\n");
fprintf(fp
, "\t.text\n");
* Create the ISA interrupt vector glue file.
register struct device
*dp
, *mp
;
fp
= fopen(path("vector.h"), "w");
perror(path("vector.h"));
* Macros for interrupt vector routines\n\
* Generated by config program\n\
#define BUILD_VECTORS \\\n\
BUILD_VECTOR(clk, 0,0,0, _highmask, _hardclock,1,1, al);\\\n");
for (dp
= dtab
; dp
!= 0; dp
= dp
->d_next
) {
if (mp
!= 0 && /* mp != (struct device *)-1 &&*/
for (id
= dp
->d_vec
; id
; id
= id
->id_next
) {
for (id2
= dp
->d_vec
; id2
; id2
= id2
->id_next
) {
build_vector(fp
, dp
, id
, count
);
if (!strcmp(id
->id
, id2
->id
))
fprintf(fp
, "\n\n#define NR_REAL_INT_HANDLERS %d\n", count
);
build_vector(fp
, dp
, id
, offset
)
register struct device
*dp
;
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%dmask,", dp
->d_name
, dp
->d_unit
);
fprintf(fp
, ", _%smask, ", dp
->d_mask
);
fprintf(fp
, " _%s,%d,1", id
->id
, 1 + dp
->d_irq
/ 8);
fprintf(fp
, "_AND_2, ah");