diff --git a/scp.c b/scp.c index 4d502a1..ded0171 100644 --- a/scp.c +++ b/scp.c @@ -1127,12 +1127,12 @@ static const char simh_help1[] = "++RUNLIMIT n {%C|MICROSECONDS|SECONDS|MINUTES|HOURS}\n" "++NORUNLIMIT\n\n" " Equivalently:\n\n" - "++SET RUNLIMIT n {CYCLES|MICROSECONDS|SECONDS|MINUTES|HOURS}\n" + "++SET RUNLIMIT n {%C|MICROSECONDS|SECONDS|MINUTES|HOURS}\n" "++SET NORUNLIMIT\n\n" " The run limit state can be examined with:\n\n" "++SHOW RUNLIMIT\n\n" " If the units of the run limit are not specified, the default units are\n" - " %C. Once an execution run limit has beenn reached, any subsequent\n" + " %C. Once an execution run limit has been reached, any subsequent\n" " GO, RUN, CONTINUE, STEP or BOOT commands will cause the simulator to\n" " exit. A previously defined RUNLIMIT can be cleared with the NORUNLIMIT\n" " command or the establishment of a new run limit.\n" @@ -4405,7 +4405,7 @@ int i; size_t outstr_off = 0; sim_exp_argv = do_arg; -clock_gettime(CLOCK_REALTIME, &cmd_time); +sim_rtcn_get_time (&cmd_time, 0); tmpbuf = (char *)malloc(instr_size); op = tmpbuf; oend = tmpbuf + instr_size - 2; @@ -13287,7 +13287,7 @@ char pc_s[64] = ""; struct timespec time_now; if (sim_deb_switches & (SWMASK ('T') | SWMASK ('R') | SWMASK ('A'))) { - clock_gettime(CLOCK_REALTIME, &time_now); + sim_rtcn_get_time(&time_now, 0); if (sim_deb_switches & SWMASK ('R')) sim_timespec_diff (&time_now, &time_now, &sim_deb_basetime); if (sim_deb_switches & SWMASK ('T')) { diff --git a/sim_console.c b/sim_console.c index bf4df38..6316298 100644 --- a/sim_console.c +++ b/sim_console.c @@ -2315,7 +2315,7 @@ if (sim_deb_switches & SWMASK ('R')) { struct tm loc_tm, gmt_tm; time_t time_t_now; - clock_gettime(CLOCK_REALTIME, &sim_deb_basetime); + sim_rtcn_get_time(&sim_deb_basetime, 0); time_t_now = (time_t)sim_deb_basetime.tv_sec; /* Adjust the relative timebase to reflect the localtime GMT offset */ loc_tm = *localtime (&time_t_now); diff --git a/sim_timer.c b/sim_timer.c index 7754d3f..990cac9 100644 --- a/sim_timer.c +++ b/sim_timer.c @@ -2188,6 +2188,17 @@ sim_debug (DBG_GET, &sim_timer_dev, "sim_rtcn_get_time(tmr=%d)\n", tmr); clock_gettime (CLOCK_REALTIME, now); } +time_t sim_get_time (time_t *now) +{ +struct timespec ts_now; + +sim_debug (DBG_GET, &sim_timer_dev, "sim_get_time()\n"); +sim_rtcn_get_time (&ts_now, 0); +if (now) + *now = ts_now.tv_sec; +return ts_now.tv_sec; +} + /* * If the host system has a relatively large clock tick (as compared to * the desired simulated hz) ticks will naturally be scheduled late and diff --git a/sim_timer.h b/sim_timer.h index cf53771..6f811fc 100644 --- a/sim_timer.h +++ b/sim_timer.h @@ -110,6 +110,7 @@ int32 sim_rtcn_init (int32 time, int32 tmr); int32 sim_rtcn_init_unit (UNIT *uptr, int32 time, int32 tmr); int32 sim_rtcn_init_unit_ticks (UNIT *uptr, int32 time, int32 tmr, int32 ticksper); void sim_rtcn_get_time (struct timespec *now, int tmr); +time_t sim_get_time (time_t *now); t_stat sim_rtcn_tick_ack (uint32 time, int32 tmr); void sim_rtcn_init_all (void); int32 sim_rtcn_calb (uint32 ticksper, int32 tmr);