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