1
0
mirror of https://github.com/simh/simh.git synced 2026-03-23 17:22:11 +00:00

sigma: DP device fixes

- TIO status routine always returns DVS_AUTO instead of proper status.
- DP_SEEK definition is off by 1.
- reset does not properly initialize controller, seek threads.
This commit is contained in:
Ken Rector
2022-06-29 08:07:10 -10:00
committed by Mark Pizzolato
parent 622dc28bc8
commit 29404358d7
2 changed files with 27 additions and 15 deletions

View File

@@ -111,6 +111,9 @@
105. RAD: write check was reading words off disk instead of bytes.
106. RAD: end of transfer routine checking for address error incorrectly.
107. DK: end of transfer routine checking for address error incorrectly.
108. DP: TIO status routine always returns DVS_AUTO instead of proper status.
109. DP: DP_SEEK definition is off by 1.
110. DP: reset does not properly initialize controller, seek threads.
Diagnostic Notes

View File

@@ -1,6 +1,6 @@
/* sigma_dp.c: moving head disk pack controller
Copyright (c) 2008-2017, Robert M Supnik
Copyright (c) 2008-2022, Robert M Supnik
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
@@ -25,6 +25,10 @@
dp moving head disk pack controller
29-Jun-22 RMS Fixed initialization errors in ctrl, seek units (Ken Rector)
28-Jun-22 RMS Fixed off-by-1 error in DP_SEEK definition (Ken Rector)
07-Jun-22 RMS Removed unused variables (V4)
06-Jun-22 RMS Fixed incorrect return in TIO status (Ken Rector)
13-Mar-17 RMS Fixed bug in selecting 3281 unit F (COVERITY)
Transfers are always done a sector at a time.
@@ -75,7 +79,7 @@
#define DP_WDSC 256 /* words/sector */
#define DP_BYHD 8 /* byte/header */
#define DP_NUMDR ((uint32) ((DP_Q10B (ctx->dp_ctype))? DP_NUMDR_10B: DP_NUMDR_16B))
#define DP_SEEK (DP_CONT) /* offset to seek units */
#define DP_SEEK (DP_CONT + 1) /* offset to seek units */
/* Address bytes */
@@ -930,7 +934,6 @@ t_bool dp_end_sec (UNIT *uptr, uint32 lnt, uint32 exp, uint32 st)
{
uint32 cidx = uptr->UCTX;
uint32 dva = dp_dib[cidx].dva;
uint32 dtype = GET_DTYPE (uptr->flags);
DP_CTX *ctx = &dp_ctx[cidx];
if (st != CHS_ZBC) { /* end record? */
@@ -965,20 +968,19 @@ uint32 stat = DVS_AUTO;
for (i = 0; i < DP_NUMDR; i++) {
if (sim_is_active (&dp_unit[i])) {
stat |= (DVS_CBUSY|(CC2 << DVT_V_CC));
stat |= (DVS_CBUSY | (CC2 << DVT_V_CC));
break;
}
}
if (sim_is_active (&dp_unit[un]) ||
sim_is_active (&dp_unit[un + DP_SEEK]))
stat |= (DVS_DBUSY|(CC2 << DVT_V_CC));
return DVS_AUTO;
stat |= (DVS_DBUSY | (CC2 << DVT_V_CC));
return stat;
}
uint32 dp_tdv_status (uint32 cidx, uint32 un)
{
uint32 st;
DP_CTX *ctx = &dp_ctx[cidx];
UNIT *dp_unit = dp_dev[cidx].units;
t_bool on_cyl;
@@ -996,7 +998,6 @@ return st;
uint32 dp_aio_status (uint32 cidx, uint32 un)
{
uint32 st;
DP_CTX *ctx = &dp_ctx[cidx];
UNIT *dp_unit = dp_dev[cidx].units;
t_bool on_cyl;
@@ -1032,6 +1033,7 @@ while (tptr->byte != 0) {
data = (uint8) ((ctx->dp_flags & tptr->mask) >> tptr->fpos);
c[tptr->byte] |= (data << tptr->tpos);
}
tptr++;
}
return;
}
@@ -1196,7 +1198,16 @@ else if (chan_chk_chi (dp_dib[cidx].dva) < 0) /* any int? */
return;
}
/* Reset routine */
/* Reset routines */
void dp_reset_unit (UNIT *uptr, uint32 cidx)
{
sim_cancel (uptr); /* stop dev thread */
uptr->UDA = 0;
uptr->UCMD = 0;
uptr->UCTX = cidx;
return;
}
t_stat dp_reset (DEVICE *dptr)
{
@@ -1209,12 +1220,10 @@ if (cidx >= DP_NUMCTL)
return SCPE_IERR;
dp_unit = dptr->units;
ctx = &dp_ctx[cidx];
for (i = 0; i < DP_NUMDR_16B; i++) {
sim_cancel (&dp_unit[i]); /* stop dev thread */
sim_cancel (&dp_unit[i + DP_SEEK]); /* stop seek thread */
dp_unit[i].UDA = 0;
dp_unit[i].UCMD = 0;
dp_unit[i].UCTX = cidx;
dp_reset_unit (&dp_unit[DP_CONT], cidx); /* reset controller */
for (i = 0; i < DP_NUMDR_16B; i++) { /* reset drives */
dp_reset_unit (&dp_unit[i], cidx);
dp_reset_unit (&dp_unit[i + DP_SEEK], cidx); /* reset seek thread */
}
ctx->dp_flags = 0;
ctx->dp_ski = 0;