TIMER: Fix recently revised sim_idle_capable for hosts which aren't idle capable.

This commit is contained in:
Mark Pizzolato 2015-11-23 15:45:46 -08:00
parent b3b038900c
commit 44ef17f971
3 changed files with 10 additions and 7 deletions

9
scp.c
View file

@ -4276,14 +4276,15 @@ if (vdelt)
fprintf (st, " %s", SIM_VERSION_MODE); fprintf (st, " %s", SIM_VERSION_MODE);
#endif #endif
if (flag) { 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\tSimulator Framework Capabilities:");
fprintf (st, "\n\t\t%s", sim_si64); fprintf (st, "\n\t\t%s", sim_si64);
fprintf (st, "\n\t\t%s", sim_sa64); fprintf (st, "\n\t\t%s", sim_sa64);
fprintf (st, "\n\t\t%s", eth_capabilities()); fprintf (st, "\n\t\t%s", eth_capabilities());
idle_capable = sim_timer_idle_capable (&os_tick_size); idle_capable = sim_timer_idle_capable (&os_ms_sleep_1, &os_tick_size);
fprintf (st, "\n\t\tIdle/Throttling support is %savailable", ((idle_capable == 0) ? "NOT " : "")); fprintf (st, "\n\t\tIdle/Throttling support is %savailable", idle_capable ? "" : "NOT ");
if (sim_disk_vhd_support()) if (sim_disk_vhd_support())
fprintf (st, "\n\t\tVirtual Hard Disk (VHD) support"); fprintf (st, "\n\t\tVirtual Hard Disk (VHD) support");
if (sim_disk_raw_support()) if (sim_disk_raw_support())
@ -4333,7 +4334,7 @@ if (flag) {
fprintf (st, "\n\t\tNo RegEx support for EXPECT commands"); fprintf (st, "\n\t\tNo RegEx support for EXPECT commands");
#endif #endif
fprintf (st, "\n\t\tOS clock resolution: %dms", os_tick_size); 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 defined(__VMS)
if (1) { if (1) {
char *arch = char *arch =

View file

@ -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 */ /* 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) if (host_tick_ms)
*host_tick_ms = sim_os_clock_resoluton_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 */ /* sim_show_timers - show running timer information */

View file

@ -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 (UNIT *uptr, int32 interval);
t_stat sim_clock_coschedule_tmr (UNIT *uptr, int32 tmr, int32 interval); t_stat sim_clock_coschedule_tmr (UNIT *uptr, int32 tmr, int32 interval);
double sim_timer_inst_per_sec (void); 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 t_bool sim_idle_enab; /* idle enabled flag */
extern volatile t_bool sim_idle_wait; /* idle waiting flag */ extern volatile t_bool sim_idle_wait; /* idle waiting flag */