1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 11:46:37 +00:00

PDP1, PDP18B: Fixed dt_seterr to handle nx unit select (COVERITY)

This commit is contained in:
Bob Supnik
2017-03-09 20:09:02 -08:00
committed by Mark Pizzolato
parent 3530f0de7d
commit 706de798ba
2 changed files with 22 additions and 18 deletions

View File

@@ -1,6 +1,6 @@
/* pdp1_dt.c: 18b DECtape simulator
Copyright (c) 1993-2015, Robert M Supnik
Copyright (c) 1993-2017, 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,7 @@
dt Type 550/555 DECtape
09-Mar-17 RMS Fixed dt_seterr to handle nx unit select (COVERITY)
28-Mar-15 RMS Revised to use sim_printf
21-Dec-06 RMS Added 16-channel SBS support
23-Jun-06 RMS Fixed conflict in ATTACH switches
@@ -856,16 +857,17 @@ return SCPE_OK;
void dt_seterr (UNIT *uptr, int32 e)
{
int32 mot = DTS_GETMOT (uptr->STATE);
dtsa = dtsa & ~DTA_STSTP; /* clear go */
dtsb = dtsb | DTB_ERF | e; /* set error flag */
if (mot >= DTS_ACCF) { /* ~stopped or stopping? */
sim_cancel (uptr); /* cancel activity */
if (dt_setpos (uptr)) /* update position */
return;
sim_activate (uptr, dt_dctime); /* sched decel */
DTS_SETSTA (DTS_DECF | (mot & DTS_DIR), 0); /* state = decel */
if (uptr != NULL) { /* valid unit? */
int32 mot = DTS_GETMOT (uptr->STATE); /* get motion */
if (mot >= DTS_ACCF) { /* ~stopped or stopping? */
sim_cancel (uptr); /* cancel activity */
if (dt_setpos (uptr)) /* update position */
return;
sim_activate (uptr, dt_dctime); /* sched decel */
DTS_SETSTA (DTS_DECF | (mot & DTS_DIR), 0); /* state = decel */
}
}
DT_UPDINT;
return;