From 2549f345601ae2dcfee1b113a21ac2d3087e1e34 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 10 Dec 2015 05:40:13 -0800 Subject: [PATCH] VAX: Change HALT behavior to dispatch non polling events prior to returning to SCP. This allows pending I/O (console, or otherwise) to complete before dropping back to the sim> prompt. This better simulates the model where scp is analogous to the console processor on the older VAX simulators. This better addresses the incomplete I/O problems discussed in #208 --- VAX/vax_cpu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/VAX/vax_cpu.c b/VAX/vax_cpu.c index 827276d2..99e12845 100644 --- a/VAX/vax_cpu.c +++ b/VAX/vax_cpu.c @@ -2582,10 +2582,12 @@ for ( ;; ) { else if (cpu_unit.flags & UNIT_CONH) /* halt to console? */ cc = con_halt (CON_HLTINS, cc); /* enter firmware */ else { - /* allow potentially pending console output to */ - /* be displayed before dropping back to scp */ - if (sim_interval <= SERIAL_OUT_WAIT) { - sim_interval -= SERIAL_OUT_WAIT; + /* allow potentially pending I/O (console output, + or other devices) to complete before dropping + back to scp */ + while ((sim_clock_queue != QUEUE_LIST_END) && + ((sim_clock_queue->flags & UNIT_IDLE) == 0)) { + sim_interval = 0; temp = sim_process_event (); if (temp) ABORT (temp);