/////////////////////////////////////////////////////////////////////////////// // // 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 ApicTimer apicTimer; public HalTimer(ApicTimer theApicTimer) { this.apicTimer = theApicTimer; } /// /// Clear interrupt associated with timer. /// [NoHeapAllocation] public void ClearInterrupt() { apicTimer.ClearInterrupt(); } /// /// Maximum value accepted by SetNextInterrupt (in units of 100ns). /// public long MaxInterruptInterval { [NoHeapAllocation] get { return apicTimer.MaxInterruptInterval; } } /// /// Minimum value accepted by SetNextInterrupt (in units of 100ns). /// public long MinInterruptInterval { [NoHeapAllocation] get { return apicTimer.MinInterruptInterval; } } /// /// Granularity of interrupt timeout (in units of 100ns). /// public long InterruptIntervalGranularity { [NoHeapAllocation] get { return apicTimer.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 apicTimer.SetNextInterrupt(delta); } public byte Interrupt { [NoHeapAllocation] get { return apicTimer.Interrupt; } } } } // namespace Microsoft.Singularity.Hal