/////////////////////////////////////////////////////////////////////////////// // // Microsoft Research Singularity // // Copyright (c) Microsoft Corporation. All rights reserved. // // File: HalTimer.cs // // Note: // // This file is an implementation of Interfaces/Hal/HalTimer.csi // using System; using System.Runtime.CompilerServices; namespace Microsoft.Singularity.Hal { public class HalTimer { private Timer8254 timer; internal HalTimer(Timer8254 theTimer) { this.timer = theTimer; } /// /// Clear interrupt associated with timer. /// [NoHeapAllocation] public void ClearInterrupt() { timer.ClearInterrupt(); } /// /// Maximum value accepted by SetNextInterrupt (in units of 100ns). /// public long MaxInterruptInterval { [NoHeapAllocation] get { return timer.MaxInterruptInterval; } } /// /// Minimum value accepted by SetNextInterrupt (in units of 100ns). /// public long MinInterruptInterval { [NoHeapAllocation] get { return timer.MinInterruptInterval; } } /// /// Granularity of interrupt timeout (in units of 100ns). /// public long InterruptIntervalGranularity { [NoHeapAllocation] get { return timer.InterruptIntervalGranularity; } } /// /// Set relative time of next interrupt. /// /// Relative time of next interrupt in units /// of 100ns. The time should be with the range between /// from SetNextInterruptMinDelta to /// SetNextInterruptMaxDelta. /// true on success. /// [NoHeapAllocation] public bool SetNextInterrupt(long delta) { return timer.SetNextInterrupt(delta); } } } // namespace Microsoft.Singularity.Hal