mirror of
https://github.com/simh/simh.git
synced 2026-01-11 23:52:58 +00:00
Non Unibus and Non Qbus VAXen: Properly handle the boot ROM device support
- Previously the Option ROM device (OR) logic improperly used the UNIT UNIT_ATT flag to indicate a devices with Option ROM support. This bit has specific meaning to many SCP capabilities while there are numerous device specific fields in the UNIT structure which DEVICEs can use as needed. - Enhance SCP SHOW output for Option ROM units to indicate the DEVICE which each enabled ROM is related to. Fixes #1210
This commit is contained in:
parent
7222199448
commit
dd82ea0851
@ -98,7 +98,7 @@ int32 ka_rd (int32 pa);
|
||||
void ka_wr (int32 pa, int32 val, int32 lnt);
|
||||
int32 con_halt (int32 code, int32 cc);
|
||||
|
||||
extern t_stat or_map (uint32 index, uint8 *rom, t_addr size);
|
||||
extern t_stat or_map (DEVICE *dptr, uint32 index, uint8 *rom, t_addr size);
|
||||
extern t_stat or_unmap (uint32 index);
|
||||
extern void rom_wr_B (int32 pa, int32 val);
|
||||
extern int32 iccs_rd (void);
|
||||
@ -874,7 +874,7 @@ for (i = 0; (cdptr = sim_devices[i]) != NULL; i++) { /* loop over all devices
|
||||
continue;
|
||||
|
||||
if (cdibp->rom_array != NULL) /* device has an option ROM? */
|
||||
or_map (cdibp->rom_index, cdibp->rom_array, cdibp->rom_size);
|
||||
or_map (cdptr, cdibp->rom_index, cdibp->rom_array, cdibp->rom_size);
|
||||
}
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
@ -132,7 +132,7 @@ int32 con_halt (int32 code, int32 cc);
|
||||
int32 tmr_tir_rd (void);
|
||||
void tmr_sched ();
|
||||
|
||||
extern t_stat or_map (uint32 index, uint8 *rom, t_addr size);
|
||||
extern t_stat or_map (DEVICE *dptr, uint32 index, uint8 *rom, t_addr size);
|
||||
extern t_stat or_unmap (uint32 index);
|
||||
extern void rom_wr_B (int32 pa, int32 val);
|
||||
extern int32 iccs_rd (void);
|
||||
@ -1015,7 +1015,7 @@ for (i = 0; (cdptr = sim_devices[i]) != NULL; i++) { /* loop over all devices
|
||||
continue;
|
||||
|
||||
if (cdibp->rom_array != NULL) /* device has an option ROM? */
|
||||
or_map (cdibp->rom_index, cdibp->rom_array, cdibp->rom_size);
|
||||
or_map (cdptr, cdibp->rom_index, cdibp->rom_array, cdibp->rom_size);
|
||||
}
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
@ -108,7 +108,7 @@ int32 con_halt (int32 code, int32 cc);
|
||||
int32 tmr_tir_rd (void);
|
||||
void tmr_sched ();
|
||||
|
||||
extern t_stat or_map (uint32 index, uint8 *rom, t_addr size);
|
||||
extern t_stat or_map (DEVICE *dptr, uint32 index, uint8 *rom, t_addr size);
|
||||
extern t_stat or_unmap (uint32 index);
|
||||
extern void rom_wr_B (int32 pa, int32 val);
|
||||
extern int32 iccs_rd (void);
|
||||
@ -993,7 +993,7 @@ for (i = 0; (cdptr = sim_devices[i]) != NULL; i++) { /* loop over all devices
|
||||
continue;
|
||||
|
||||
if (cdibp->rom_array != NULL) /* device has an option ROM? */
|
||||
or_map (cdibp->rom_index, cdibp->rom_array, cdibp->rom_size);
|
||||
or_map (cdptr, cdibp->rom_index, cdibp->rom_array, cdibp->rom_size);
|
||||
}
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
@ -61,6 +61,7 @@ t_stat nvr_attach (UNIT *uptr, CONST char *cptr);
|
||||
t_stat nvr_detach (UNIT *uptr);
|
||||
const char *nvr_description (DEVICE *dptr);
|
||||
t_stat or_reset (DEVICE *dptr);
|
||||
t_stat or_show (FILE* st, UNIT* uptr, int32 val, CONST void* desc);
|
||||
t_stat or_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
|
||||
const char *or_description (DEVICE *dptr);
|
||||
t_stat clk_svc (UNIT *uptr);
|
||||
@ -127,19 +128,28 @@ DEVICE nvr_dev = {
|
||||
or_reg OR register list
|
||||
*/
|
||||
|
||||
#define OR_ROM up7 /* unit member holding the pointer to the ROM data */
|
||||
#define OR_DEVICE up8 /* unit member holding the pointer to DEVICE the ROM operates */
|
||||
|
||||
UNIT or_unit[] = {
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, ORSIZE) },
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, ORSIZE) },
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, ORSIZE) },
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, ORSIZE) }
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, 0) },
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, 0) },
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, 0) },
|
||||
{ UDATA (NULL, UNIT_FIX+UNIT_RO+UNIT_BINK, 0) }
|
||||
};
|
||||
|
||||
REG or_reg[] = {
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
MTAB or_mod[] = {
|
||||
{ MTAB_XTD|MTAB_VUN, 1, "DEVICE", NULL ,
|
||||
NULL, &or_show, NULL, "Option ROM device" },
|
||||
{ 0 }
|
||||
};
|
||||
|
||||
DEVICE or_dev = {
|
||||
"OR", or_unit, or_reg, NULL,
|
||||
"OR", or_unit, or_reg, or_mod,
|
||||
OR_COUNT, 16, ORAWIDTH, 4, 16, 32,
|
||||
NULL, NULL, &or_reset,
|
||||
NULL, NULL, NULL,
|
||||
@ -412,11 +422,11 @@ int32 or_rd (int32 pa)
|
||||
uint32 off = (pa - ORBASE); /* offset from start of option roms */
|
||||
uint32 rn = ((off >> 18) & 0x3); /* rom number (0 - 3) */
|
||||
UNIT *uptr = &or_dev.units[rn]; /* get unit */
|
||||
uint8 *opr = (uint8*) uptr->filebuf;
|
||||
uint8 *opr = (uint8*) uptr->OR_ROM;
|
||||
int32 data = 0;
|
||||
uint32 rg;
|
||||
|
||||
if ((uptr->flags & UNIT_ATT) && (opr != NULL)) {
|
||||
if (opr != NULL) {
|
||||
switch (opr[0]) { /* number of ROM chips */
|
||||
case 1:
|
||||
rg = (off >> 2) & (uptr->capac - 1);
|
||||
@ -447,6 +457,15 @@ t_stat or_reset (DEVICE *dptr)
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat or_show (FILE* st, UNIT* uptr, int32 val, CONST void* desc)
|
||||
{
|
||||
if (uptr->OR_ROM)
|
||||
fprintf(st, "ROM for %s device", sim_dname((DEVICE *)uptr->OR_DEVICE));
|
||||
else
|
||||
fprintf(st, "No Option Enabled");
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat or_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr)
|
||||
{
|
||||
fprintf (st, "Option ROMs (OR)\n\n");
|
||||
@ -457,21 +476,25 @@ fprintf (st, "which option boards are present.\n");
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat or_map (uint32 index, uint8 *rom, t_addr size)
|
||||
t_stat or_map (DEVICE *dptr, uint32 index, uint8 *rom, t_addr size)
|
||||
{
|
||||
UNIT *uptr = &or_unit[index];
|
||||
uptr->filebuf = (void *)rom;
|
||||
|
||||
if (size > ORSIZE)
|
||||
return sim_messagef (SCPE_IERR, "%s: %s device ROM size of %u exceeds available address slot size %u\n",
|
||||
sim_uname(uptr), sim_dname (dptr), size, ORSIZE);
|
||||
uptr->OR_ROM = (void *)rom;
|
||||
uptr->OR_DEVICE = (void *)dptr;
|
||||
uptr->capac = size;
|
||||
uptr->flags |= UNIT_ATT;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
t_stat or_unmap (uint32 index)
|
||||
{
|
||||
UNIT *uptr = &or_unit[index];
|
||||
uptr->filebuf = NULL;
|
||||
uptr->OR_ROM = NULL;
|
||||
uptr->OR_DEVICE = NULL;
|
||||
uptr->capac = 0;
|
||||
uptr->flags &= ~UNIT_ATT;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user