From 44ef17f9714d490b5cbf3c573b7a4d537ee47d63 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 23 Nov 2015 15:45:46 -0800 Subject: [PATCH] TIMER: Fix recently revised sim_idle_capable for hosts which aren't idle capable. --- scp.c | 9 +++++---- sim_timer.c | 6 ++++-- sim_timer.h | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/scp.c b/scp.c index 9116a43e..e00e9909 100644 --- a/scp.c +++ b/scp.c @@ -4276,14 +4276,15 @@ if (vdelt) fprintf (st, " %s", SIM_VERSION_MODE); #endif if (flag) { - uint32 idle_capable, os_tick_size; + t_bool idle_capable; + uint32 os_ms_sleep_1, os_tick_size; fprintf (st, "\n\tSimulator Framework Capabilities:"); fprintf (st, "\n\t\t%s", sim_si64); fprintf (st, "\n\t\t%s", sim_sa64); fprintf (st, "\n\t\t%s", eth_capabilities()); - idle_capable = sim_timer_idle_capable (&os_tick_size); - fprintf (st, "\n\t\tIdle/Throttling support is %savailable", ((idle_capable == 0) ? "NOT " : "")); + idle_capable = sim_timer_idle_capable (&os_ms_sleep_1, &os_tick_size); + fprintf (st, "\n\t\tIdle/Throttling support is %savailable", idle_capable ? "" : "NOT "); if (sim_disk_vhd_support()) fprintf (st, "\n\t\tVirtual Hard Disk (VHD) support"); if (sim_disk_raw_support()) @@ -4333,7 +4334,7 @@ if (flag) { fprintf (st, "\n\t\tNo RegEx support for EXPECT commands"); #endif fprintf (st, "\n\t\tOS clock resolution: %dms", os_tick_size); - fprintf (st, "\n\t\tTime taken by msleep(1): %dms", idle_capable); + fprintf (st, "\n\t\tTime taken by msleep(1): %dms", os_ms_sleep_1); #if defined(__VMS) if (1) { char *arch = diff --git a/sim_timer.c b/sim_timer.c index b3fdc39d..60b687d1 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -743,11 +743,13 @@ return (sim_idle_rate_ms != 0); /* sim_timer_idle_capable - tell if the host is Idle capable and what the host OS tick size is */ -uint32 sim_timer_idle_capable (uint32 *host_tick_ms) +t_bool sim_timer_idle_capable (uint32 *host_ms_sleep_1, uint32 *host_tick_ms) { if (host_tick_ms) *host_tick_ms = sim_os_clock_resoluton_ms; -return sim_idle_rate_ms; +if (host_ms_sleep_1) + *host_ms_sleep_1 = sim_os_sleep_min_ms; +return (sim_idle_rate_ms != 0); } /* sim_show_timers - show running timer information */ diff --git a/sim_timer.h b/sim_timer.h index 57508b69..ea22503e 100644 --- a/sim_timer.h +++ b/sim_timer.h @@ -124,7 +124,7 @@ t_stat sim_register_clock_unit (UNIT *uptr); t_stat sim_clock_coschedule (UNIT *uptr, int32 interval); t_stat sim_clock_coschedule_tmr (UNIT *uptr, int32 tmr, int32 interval); double sim_timer_inst_per_sec (void); -uint32 sim_timer_idle_capable (uint32 *hoat_tick_ms); +t_bool sim_timer_idle_capable (uint32 *host_ms_sleep_1, uint32 *host_tick_ms); extern t_bool sim_idle_enab; /* idle enabled flag */ extern volatile t_bool sim_idle_wait; /* idle waiting flag */