singrdk/base/Kernel/Singularity/Hal/HalClock.cs

58 lines
1.7 KiB
C#
Raw Permalink Normal View History

2008-03-05 09:52:00 -05:00
///////////////////////////////////////////////////////////////////////////////
//
// Microsoft Research Singularity
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
2008-11-17 18:29:00 -05:00
// File: HalClock.cs
2008-03-05 09:52:00 -05:00
//
// Note:
//
using System;
using System.Collections;
using System.Runtime.InteropServices;
using System.Runtime.CompilerServices;
using Microsoft.Singularity;
namespace Microsoft.Singularity.Hal
{
2008-11-17 18:29:00 -05:00
public abstract class HalClock
2008-03-05 09:52:00 -05:00
{
/// <summary>
/// Notification that system has received and processed clock
/// interrupt.
/// </summary>
[NoHeapAllocation]
2008-11-17 18:29:00 -05:00
public abstract void ClearInterrupt();
2008-03-05 09:52:00 -05:00
/// <summary>Get the time elapsed since booting.
/// <returns>Ticks of 100ns of uptime. </returns>
/// </summary>
[NoHeapAllocation]
2008-11-17 18:29:00 -05:00
public abstract long GetKernelTicks();
2008-03-05 09:52:00 -05:00
/// <summary>
/// Notification that processor is resuming from halted state.
/// Provides clock to re-sync if it uses the CPU timestamp counter.
/// </summary>
[NoHeapAllocation]
2008-11-17 18:29:00 -05:00
public abstract void CpuResumeFromHaltEvent();
2008-03-05 09:52:00 -05:00
/// <summary>Get time from Real-Time Clock.</summary>
/// <returns>The number of 100-nanosecond intervals that
/// have elapsed since 12:00 A.M., January 1, 0001.
/// </returns>
[NoHeapAllocation]
2008-11-17 18:29:00 -05:00
public abstract long GetRtcTime();
2008-03-05 09:52:00 -05:00
/// <summary>Set time of Real-Time Clock.</summary>
2008-11-17 18:29:00 -05:00
/// <param name="rtcTicks">The number of 100-nanosecond intervals
2008-03-05 09:52:00 -05:00
/// that have elapsed since 12:00 A.M., January 1, 0001.
/// </param>
2008-11-17 18:29:00 -05:00
public abstract void SetRtcTime(long rtcTicks);
2008-03-05 09:52:00 -05:00
}
}