1
0
mirror of https://github.com/simh/simh.git synced 2026-05-09 08:16:55 +00:00

SCP: Avoid runaway recursion when debugging timer logic

As mentioned in #1107
This commit is contained in:
Mark Pizzolato
2022-07-17 13:14:09 -10:00
parent bc98e1c609
commit 7249d55f11
3 changed files with 7 additions and 1 deletions

2
scp.c
View File

@@ -13905,7 +13905,7 @@ char pc_s[MAX_WIDTH + 33] = "";
struct timespec time_now;
if (sim_deb_switches & (SWMASK ('T') | SWMASK ('R') | SWMASK ('A'))) {
sim_rtcn_get_time(&time_now, 0);
sim_rtcn_debug_time(&time_now);
if (sim_deb_switches & SWMASK ('R'))
sim_timespec_diff (&time_now, &time_now, &sim_deb_basetime);
if (sim_deb_switches & SWMASK ('T')) {

View File

@@ -2200,6 +2200,11 @@ t_stat sim_timer_stop_svc (UNIT *uptr)
return SCPE_STOP;
}
void sim_rtcn_debug_time (struct timespec *now)
{
clock_gettime (CLOCK_REALTIME, now);
}
void sim_rtcn_get_time (struct timespec *now, int tmr)
{
sim_debug (DBG_GET, &sim_timer_dev, "sim_rtcn_get_time(tmr=%d)\n", tmr);

View File

@@ -110,6 +110,7 @@ double sim_timenow_double (void);
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_debug_time (struct timespec *now);
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);