From eadfeffdf368b00a5a6e575165c42bfc431bf7a9 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 1 Jul 2019 19:24:25 -0700 Subject: [PATCH] PDP10: Recompute tmxr delay factor regularly This will not change much, but it may be useful for sane idling depending on the way the running OS actually uses the interval timer for clock ticks. Some discussion about this in #713 --- PDP10/pdp10_tim.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PDP10/pdp10_tim.c b/PDP10/pdp10_tim.c index 5e6b7e58..5d1a8959 100644 --- a/PDP10/pdp10_tim.c +++ b/PDP10/pdp10_tim.c @@ -391,7 +391,11 @@ else { sim_activate_after (uptr, tick_in_usecs); /* reactivate unit */ tmr_poll = sim_activate_time (uptr) - 1; } -tmxr_poll = (int32)(sim_timer_inst_per_sec () / clk_tps);/* set mux poll */ + +/* tmxr is polled every tim_mult clks. Compute the divisor matching the target. */ +tim_mult = (clk_tps <= TIM_TMXR_FREQ) ? 1 : (clk_tps / TIM_TMXR_FREQ) ; + +tmxr_poll = tim_mult * (int32)(sim_timer_inst_per_sec () / clk_tps);/* set mux poll */ tim_incr_base (tim_base, tim_period); /* incr time base based on period of expired interval */ tim_period = tim_new_period; /* If interval has changed, update period */ apr_flg = apr_flg | APRF_TIM; /* request interrupt */