xref: /aosp_15_r20/external/coreboot/src/lib/hw-time-timer.adb (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
1-- SPDX-License-Identifier: GPL-2.0-only
2
3with Interfaces.C;
4
5package body HW.Time.Timer
6   with Refined_State => (Timer_State => null,
7                          Abstract_Time => null)
8is
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
35end HW.Time.Timer;
36