1
0
mirror of https://github.com/simh/simh.git synced 2026-01-27 12:32:24 +00:00

sigma: implement attention interrupt to sigma)mt.c

This commit is contained in:
ken rector
2025-01-30 12:24:29 -08:00
parent fc03fd432e
commit 389a8ade1f

View File

@@ -112,6 +112,7 @@ int32 mt_rwtime = 10000; /* rewind latency */
int32 mt_ctime = 100; /* command latency */
int32 mt_time = 10; /* record latency */
uint32 mt_rwi = 0; /* rewind interrupts */
uint32 mt_atn = 0; /* attention interrupt */
t_mtrlnt mt_bptr;
t_mtrlnt mt_blim;
uint8 mt_xb[MT_MAXFR]; /* transfer buffer */
@@ -152,6 +153,8 @@ t_stat mt_map_err (UNIT *uptr, t_stat r);
int32 mt_clr_int (uint32 dva);
void mt_set_rwi (uint32 un);
void mt_clr_rwi (uint32 un);
void mt_set_atn (uint32 un);
void mt_clr_atn (uint32 un);
/* MT data structures
@@ -631,6 +634,10 @@ for (iu = 0; iu < MT_NUMDR; iu++) { /* rewind int? */
mt_clr_rwi ((uint32) iu);
return (iu | MTAI_INT);
}
if (mt_atn & (1u << iu)) {
mt_clr_atn ((uint32) iu);
return (iu | MTAI_INT);
}
}
return 0;
}
@@ -644,6 +651,15 @@ chan_set_dvi (mt_dib.dva); /* set INP */
return;
}
/* Set ATN interrupt */
void mt_set_atn (uint32 un)
{
mt_atn |= (1u << un);
chan_set_dvi (mt_dib.dva); /* set INP */
return;
}
/* Clear rewind interrupt */
void mt_clr_rwi (uint32 un)
@@ -656,6 +672,16 @@ else if (chan_chk_chi (mt_dib.dva) < 0) /* any int? */
return;
}
void mt_clr_atn (uint32 un)
{
mt_atn &= ~(1u << un);
if (mt_atn != 0) /* more? */
chan_set_dvi (mt_dib.dva);
else if (chan_chk_chi (mt_dib.dva) < 0) /* any int? */
chan_clr_chi (mt_dib.dva); /* clr INP */
return;
}
/* Reset routine */
t_stat mt_reset (DEVICE *dptr)
@@ -684,11 +710,14 @@ return SCPE_OK;
t_stat mt_attach (UNIT *uptr, CONST char *cptr)
{
t_stat r;
uint32 un = uptr - mt_unit;
r = sim_tape_attach (uptr, cptr);
if (r != SCPE_OK)
return r;
uptr->UST = MTDV_BOT;
if (sim_switches & SWMASK('A'))
mt_set_atn (un);
return r;
}