/ src / lib / hw-time-timer.adb
hw-time-timer.adb
 1  -- SPDX-License-Identifier: GPL-2.0-only
 2  
 3  with Interfaces.C;
 4  
 5  package body HW.Time.Timer
 6     with Refined_State => (Timer_State => null,
 7                            Abstract_Time => null)
 8  is
 9  
10     procedure Timer_Monotonic_Get (MT : out Interfaces.C.long);
11     pragma Import (C, Timer_Monotonic_Get, "timer_monotonic_get");
12  
13     function Raw_Value_Min return T
14     with
15        SPARK_Mode => Off
16     is
17        Microseconds : Interfaces.C.long;
18     begin
19        Timer_Monotonic_Get (Microseconds);
20        return T (Microseconds);
21     end Raw_Value_Min;
22  
23     function Raw_Value_Max return T
24     is
25     begin
26        return Raw_Value_Min + 1;
27     end Raw_Value_Max;
28  
29     function Hz return T
30     is
31     begin
32        return 1_000_000;
33     end Hz;
34  
35  end HW.Time.Timer;