Esempio n. 1
0
 internal void SetKeepAliveInterrupt()
 {
     ClockLogger.AddEntry(0, rps, this);
     PitWrite(PitMaxWrite);
     ClockLogger.AddEntry(1, rps, this);
     this.interruptPending = true;
 }
Esempio n. 2
0
        public override void ClearInterrupt()
        {
#if RTC_NO_GO
            DebugStub.Print("Unwanted RTC interrupt! (b = {0})\n",
                            __arglist(ReadRtc(DS1287_B)));
            return;
#endif // RTC_NO_GO

            byte status = ReadRtc(DS1287_C);
            if ((status & 0x40) != 0x40)
            {
                // We may get Update-Ended interrupts even though we've
                // not requested them.
                pic.AckIrq(irq);
                return;
            }

            ClockLogger.AddEntry(4, rps, timer);
            rps.pitLastClock = timer.Timer2Read();
            rps.upTime      += InterruptGapTicks;

            ClockLogger.AddEntry(5, rps, timer);
            irqCount++;

            if (timer.InterruptPending == false)
            {
                // This is to keep time progressing if the user has
                // not set an interrupt
                timer.SetKeepAliveInterrupt();
            }
            pic.AckIrq(irq);

            // Invalidate TSC snapshot to force clock synchronization
            this.tscSnapshotValid = false;
        }
Esempio n. 3
0
        private long GetKernelTicksFromHW()
        {
            bool iflag = Processor.DisableInterrupts();

            try {
                ClockLogger.AddEntry(100, rps, timer);
                long r = rps.GetKernelTicks(timer.Timer2Read());
                return(r);
            }
            finally {
                Processor.RestoreInterrupts(iflag);
            }
        }
Esempio n. 4
0
        public override void SetNextInterrupt(TimeSpan delta)
        {
            DebugStub.Assert(Processor.InterruptsDisabled());
            DebugStub.Assert(delta >= minInterruptInterval);
            DebugStub.Assert(delta <= maxInterruptInterval);

#if TIMER_NO_GO
            return;
#endif
            ClockLogger.AddEntry(2, rps, this, delta.Ticks);

            PitWrite(TimeSpanTicksToPitTicks((int)delta.Ticks));
            this.interruptPending = true;

            ClockLogger.AddEntry(3, rps, this, delta.Ticks);
        }
Esempio n. 5
0
        public override void ClearInterrupt()
        {
#if VERBOSE
            Tracing.Log(Tracing.Debug, "Timer.ClearInterrupt()");
#endif
#if TIMER_NO_GO
            Tracing.Log(Tracing.Notice, "Unwanted timer interrupt!");
#endif // TIMER_NO_GO

            ClockLogger.AddEntry(10, rps, this);

            long currentTime = rps.GetKernelTicks(Timer2Read());

            this.interruptPending = false;

            irqCount++;
            ClockLogger.AddEntry(11, rps, this);
            pic.AckIrq(irq);
        }