VAX, VAX780: Properly handle maximum interval value
This commit is contained in:
parent
2efc3a17ec
commit
a6d2e5dd4f
2 changed files with 3 additions and 5 deletions
|
@ -726,13 +726,13 @@ return SCPE_OK;
|
||||||
|
|
||||||
void tmr_sched (uint32 nicr)
|
void tmr_sched (uint32 nicr)
|
||||||
{
|
{
|
||||||
uint32 usecs = (nicr) ? (~nicr + 1) : 0xFFFFFFFF;
|
double usecs = (nicr) ? (double)(~nicr + 1) : (double)0x100000000LL;
|
||||||
|
|
||||||
clk_tps = (int32)((1000000.0 / usecs) + 0.5);
|
clk_tps = (int32)((1000000.0 / usecs) + 0.5);
|
||||||
|
|
||||||
sim_debug (TMR_DB_SCHED, &tmr_dev, "tmr_sched(nicr=0x%08X-usecs=0x%08X) - tps=%d\n", nicr, usecs, clk_tps);
|
sim_debug (TMR_DB_SCHED, &tmr_dev, "tmr_sched(nicr=0x%08X-usecs=%.0f) - tps=%d\n", nicr, usecs, clk_tps);
|
||||||
tmr_poll = sim_rtcn_calb (clk_tps, TMR_CLK);
|
tmr_poll = sim_rtcn_calb (clk_tps, TMR_CLK);
|
||||||
sim_activate_after (&tmr_unit, usecs);
|
sim_activate_after_d (&tmr_unit, usecs);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 100Hz TODR reset */
|
/* 100Hz TODR reset */
|
||||||
|
|
|
@ -1615,8 +1615,6 @@ uint32 usecs_sched = tmr_tir[tmr] ? (~tmr_tir[tmr] + 1) : 0xFFFFFFFF;
|
||||||
double usecs_sched_d = tmr_tir[tmr] ? (double)(~tmr_tir[tmr] + 1) : (1.0 + (double)0xFFFFFFFFu);
|
double usecs_sched_d = tmr_tir[tmr] ? (double)(~tmr_tir[tmr] + 1) : (1.0 + (double)0xFFFFFFFFu);
|
||||||
|
|
||||||
sim_cancel (&sysd_unit[tmr]); /* Make sure not active */
|
sim_cancel (&sysd_unit[tmr]); /* Make sure not active */
|
||||||
if (sysd_unit[tmr].usecs_remaining != 0.0)
|
|
||||||
sim_debug (DBG_SCHD, &sysd_dev, "tmr_sched(tmr=%d) - BUG - usecs remaining = %.0f usecs\n", tmr, sysd_unit[tmr].usecs_remaining);
|
|
||||||
if ((ADDR_IS_ROM(fault_PC)) && /* running from ROM and */
|
if ((ADDR_IS_ROM(fault_PC)) && /* running from ROM and */
|
||||||
(usecs_sched < TMR_INC)) { /* short delay? */
|
(usecs_sched < TMR_INC)) { /* short delay? */
|
||||||
tmr_inst[tmr] = TRUE; /* wait for instructions */
|
tmr_inst[tmr] = TRUE; /* wait for instructions */
|
||||||
|
|
Loading…
Add table
Reference in a new issue