From 2df1433d7111660128487cf49a04313123d47363 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Tue, 3 Jan 2017 12:01:53 -0800 Subject: [PATCH] All VAX: Defer taking any HALT action until pending events have fired --- VAX/vax_cpu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/VAX/vax_cpu.c b/VAX/vax_cpu.c index ab3ad723..aeabae68 100644 --- a/VAX/vax_cpu.c +++ b/VAX/vax_cpu.c @@ -2586,12 +2586,10 @@ for ( ;; ) { case HALT: if (PSL & PSL_CUR) /* not kern? rsvd inst */ RSVD_INST_FAULT; - else if (cpu_unit.flags & UNIT_CONH) /* halt to console? */ - cc = con_halt (CON_HLTINS, cc); /* enter firmware */ else { /* allow potentially pending I/O (console output, - or other devices) to complete before dropping - back to scp */ + or other devices) to complete before taking + the appropriate halt action */ while ((sim_clock_queue != QUEUE_LIST_END) && ((sim_clock_queue->flags & UNIT_IDLE) == 0)) { sim_interval = 0; @@ -2600,7 +2598,10 @@ for ( ;; ) { ABORT (temp); SET_IRQL; /* update interrupts */ } - ABORT (STOP_HALT); /* halt to simulator */ + if (cpu_unit.flags & UNIT_CONH) /* halt to console? */ + cc = con_halt (CON_HLTINS, cc); /* enter firmware */ + else + ABORT (STOP_HALT); /* halt to simulator */ } case NOP: