From b31dc88d0dd57f9e744781e83c846984f47f740f Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Thu, 14 Mar 2013 11:37:31 -0700 Subject: [PATCH] Added indication of idle/throttling capabilities and the OS clock tick size to the SHOW VERSION output --- scp.c | 5 +++++ sim_timer.c | 9 +++++++++ sim_timer.h | 1 + 3 files changed, 15 insertions(+) diff --git a/scp.c b/scp.c index 4d45c467..135ea65e 100644 --- a/scp.c +++ b/scp.c @@ -2745,10 +2745,14 @@ if (vdelt) fprintf (st, " %s", SIM_VERSION_MODE); #endif if (flag) { + uint32 idle_capable, 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", sim_snet); + idle_capable = sim_timer_idle_capable (&os_tick_size); + fprintf (st, "\n\t\tIdle/Throttling support is %savailable", ((idle_capable == 0) ? "NOT " : "")); fprintf (st, "\n\t\t%s", sim_taddr_64 ? "Large File (>2GB) support" : "No Large File support"); if (sim_disk_vhd_support()) fprintf (st, "\n\t\tVirtual Hard Disk (VHD) support"); @@ -2775,6 +2779,7 @@ if (flag) { fflush (st); system ("uname -a"); #endif + fprintf (st, "\n\t\tOS clock tick size: %dms", os_tick_size); } #if defined(SIM_GIT_COMMIT_ID) #define S_xstr(a) S_str(a) diff --git a/sim_timer.c b/sim_timer.c index c2429225..e43cb3dc 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -699,6 +699,15 @@ sim_idle_rate_ms = sim_os_ms_sleep_init (); /* get OS timer rate */ 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 *hoat_tick_ms) +{ +if (hoat_tick_ms) + *hoat_tick_ms = sim_os_sleep_min_ms; +return sim_idle_rate_ms; +} + /* sim_show_timers - show running timer information */ t_stat sim_show_timers (FILE* st, DEVICE *dptr, UNIT* uptr, int32 val, char* desc) diff --git a/sim_timer.h b/sim_timer.h index f12c935f..d5f7981c 100644 --- a/sim_timer.h +++ b/sim_timer.h @@ -115,6 +115,7 @@ t_stat sim_timer_activate_after (UNIT *uptr, int32 usec_delay); t_stat sim_register_clock_unit (UNIT *uptr); t_stat sim_clock_coschedule (UNIT *uptr, int32 interval); double sim_timer_inst_per_sec (void); +uint32 sim_timer_idle_capable (uint32 *hoat_tick_ms); extern t_bool sim_idle_enab; /* idle enabled flag */ extern volatile t_bool sim_idle_wait; /* idle waiting flag */