From 5f0370749e411a794ec13b3abc1d68b810dabac2 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 6 Sep 2018 02:35:23 -0700 Subject: [PATCH] PDP11: Allow a device to have a linked list of DIB structures This allows a single device to have multiple disjoint parts of the I/O page --- PDP11/pdp11_defs.h | 1 + PDP11/pdp11_io.c | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/PDP11/pdp11_defs.h b/PDP11/pdp11_defs.h index 65bcf793..6fbbf9b7 100644 --- a/PDP11/pdp11_defs.h +++ b/PDP11/pdp11_defs.h @@ -527,6 +527,7 @@ struct pdp_dib { /* simulated through a single */ /* DEVICE structure (e.g., DZ, VH, DL, DC). */ /* Populated by auto-configure */ + struct pdp_dib *next; /* devices with more than one DIB can chain them */ }; typedef struct pdp_dib DIB; diff --git a/PDP11/pdp11_io.c b/PDP11/pdp11_io.c index 9453e612..7c171899 100644 --- a/PDP11/pdp11_io.c +++ b/PDP11/pdp11_io.c @@ -406,17 +406,18 @@ for (i = 0; i < 7; i++) /* seed PIRQ intr */ if ((r = cpu_build_dib ())) /* build CPU entries */ return r; for (i = 0; (dptr = sim_devices[i]) != NULL; i++) { /* loop thru dev */ - dibp = (DIB *) dptr->ctxt; /* get DIB */ - if (dibp && !(dptr->flags & DEV_DIS)) { /* defined, enabled? */ - if (dptr->flags & DEV_MBUS) { /* Massbus? */ - if ((r = build_mbus_tab (dptr, dibp))) /* add to Mbus tab */ - return r; - } - else { /* no, Unibus */ - if ((r = build_ubus_tab (dptr, dibp))) /* add to Unibus tab */ - return r; - } - } /* end if enabled */ + for (dibp = (DIB *) dptr->ctxt; dibp; dibp = dibp->next) { /* loop thru dibs */ + if (dibp && !(dptr->flags & DEV_DIS)) { /* defined, enabled? */ + if (dptr->flags & DEV_MBUS) { /* Massbus? */ + if ((r = build_mbus_tab (dptr, dibp))) /* add to Mbus tab */ + return r; + } + else { /* no, Unibus */ + if ((r = build_ubus_tab (dptr, dibp))) /* add to Unibus tab */ + return r; + } + } /* end if enabled */ + } } /* end for */ return SCPE_OK; }