check for and warn about overlaps.
SCCS-vsn: sys/vax/vax/autoconf.c 7.3
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
*
- * @(#)autoconf.c 7.2 (Berkeley) %G%
+ * @(#)autoconf.c 7.3 (Berkeley) %G%
continue;
}
printf("vec %o, ipl %x\n", cvec, br);
continue;
}
printf("vec %o, ipl %x\n", cvec, br);
+ csralloc(ualloc, addr, i);
um->um_alive = 1;
um->um_ubanum = numuba;
um->um_hd = &uba_hd[numuba];
um->um_alive = 1;
um->um_ubanum = numuba;
um->um_hd = &uba_hd[numuba];
continue;
}
printf("vec %o, ipl %x\n", cvec, br);
continue;
}
printf("vec %o, ipl %x\n", cvec, br);
- while (--i >= 0)
- ualloc[ubdevreg(addr+i)] = 1;
+ csralloc(ualloc, addr, i);
ui->ui_hd = &uba_hd[numuba];
for (ivec = ui->ui_intr; *ivec; ivec++) {
ui->ui_hd->uh_vec[cvec/4] =
ui->ui_hd = &uba_hd[numuba];
for (ivec = ui->ui_intr; *ivec; ivec++) {
ui->ui_hd->uh_vec[cvec/4] =
wmemfree(ualloc, 8*1024);
}
wmemfree(ualloc, 8*1024);
}
+/*
+ * Mark addresses starting at "addr" and continuing
+ * "size" bytes as allocated in the map "ualloc".
+ * Warn if the new allocation overlaps a previous allocation.
+ */
+static
+csralloc(ualloc, addr, size)
+ caddr_t ualloc;
+ u_short addr;
+ register int size;
+{
+ register caddr_t p;
+ int warned = 0;
+
+ p = &ualloc[ubdevreg(addr+size)];
+ while (--size >= 0) {
+ if (*--p && !warned) {
+ printf(
+ "WARNING: device registers overlap those for a previous device!\n");
+ warned = 1;
+ }
+ *p = 1;
+ }
+}
+
/*
* Make an IO register area accessible at physical address physa
* by mapping kernel ptes starting at pte.
/*
* Make an IO register area accessible at physical address physa
* by mapping kernel ptes starting at pte.