- fprintf(fp, "\nstruct mba_device mbdinit[] = {\n");
- fprintf(fp, "\t/* Device, Unit, Mba, Drive, Dk */\n");
- for (dp = dtab; dp != NULL; dp = dp->d_next)
- {
- mp = dp->d_conn;
- if (dp->d_unit == QUES || mp == NULL || mp == TO_NEXUS || !eq(mp->d_name, "mba"))
- continue;
- if (dp->d_addr) {
- printf("can't specify csr address on mba for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_vec != NULL) {
- printf("can't specify vector for %s%d on mba\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_drive == UNKNOWN) {
- printf("drive not specified for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- if (dp->d_slave != UNKNOWN) {
- printf("can't specify slave number for %s%d\n",
- dp->d_name, dp->d_unit);
- continue;
- }
- fprintf(fp, "\t{ &%sdriver, %d, %s, %s, %d },\n",
- dp->d_name, dp->d_unit, qu(mp->d_unit),
- qu(dp->d_drive), dp->d_dk);
+ fprintf(fp, "#include \"../machine/pte.h\"\n");
+ fprintf(fp, "#include \"../h/param.h\"\n");
+ fprintf(fp, "#include \"../h/buf.h\"\n");
+ fprintf(fp, "#include \"../h/map.h\"\n");
+ fprintf(fp, "#include \"../h/vm.h\"\n");
+ fprintf(fp, "\n");
+ fprintf(fp, "#include \"../vaxmba/mbavar.h\"\n");
+ fprintf(fp, "#include \"../vaxuba/ubavar.h\"\n\n");
+ fprintf(fp, "\n");
+ fprintf(fp, "#define C (caddr_t)\n\n");
+ /*
+ * First print the mba initialization structures
+ */
+ if (seen_mba) {
+ for (dp = dtab; dp != 0; dp = dp->d_next) {
+ mp = dp->d_conn;
+ if (mp == 0 || mp == TO_NEXUS ||
+ !eq(mp->d_name, "mba"))
+ continue;
+ fprintf(fp, "extern struct mba_driver %sdriver;\n",
+ dp->d_name);
+ }
+ fprintf(fp, "\nstruct mba_device mbdinit[] = {\n");
+ fprintf(fp, "\t/* Device, Unit, Mba, Drive, Dk */\n");
+ for (dp = dtab; dp != 0; dp = dp->d_next) {
+ mp = dp->d_conn;
+ if (dp->d_unit == QUES || mp == 0 ||
+ mp == TO_NEXUS || !eq(mp->d_name, "mba"))
+ continue;
+ if (dp->d_addr) {
+ printf("can't specify csr address on mba for %s%d\n",
+ dp->d_name, dp->d_unit);
+ continue;
+ }
+ if (dp->d_vec != 0) {
+ printf("can't specify vector for %s%d on mba\n",
+ dp->d_name, dp->d_unit);
+ continue;
+ }
+ if (dp->d_drive == UNKNOWN) {
+ printf("drive not specified for %s%d\n",
+ dp->d_name, dp->d_unit);
+ continue;
+ }
+ if (dp->d_slave != UNKNOWN) {
+ printf("can't specify slave number for %s%d\n",
+ dp->d_name, dp->d_unit);
+ continue;
+ }
+ fprintf(fp, "\t{ &%sdriver, %d, %s,",
+ dp->d_name, dp->d_unit, qu(mp->d_unit));
+ fprintf(fp, " %s, %d },\n",
+ qu(dp->d_drive), dp->d_dk);
+ }
+ fprintf(fp, "\t0\n};\n\n");
+ /*
+ * Print the mbsinit structure
+ * Driver Controller Unit Slave
+ */
+ fprintf(fp, "struct mba_slave mbsinit [] = {\n");
+ fprintf(fp, "\t/* Driver, Ctlr, Unit, Slave */\n");
+ for (dp = dtab; dp != 0; dp = dp->d_next) {
+ /*
+ * All slaves are connected to something which
+ * is connected to the massbus.
+ */
+ if ((mp = dp->d_conn) == 0 || mp == TO_NEXUS)
+ continue;
+ np = mp->d_conn;
+ if (np == 0 || np == TO_NEXUS ||
+ !eq(np->d_name, "mba"))
+ continue;
+ fprintf(fp, "\t{ &%sdriver, %s",
+ mp->d_name, qu(mp->d_unit));
+ fprintf(fp, ", %2d, %s },\n",
+ dp->d_unit, qu(dp->d_slave));
+ }
+ fprintf(fp, "\t0\n};\n\n");