Nico Huber | c83239e | 2016-10-05 17:46:49 +0200 | [diff] [blame] | 1 | -- |
| 2 | -- This file is part of the coreboot project. |
| 3 | -- |
Nico Huber | c83239e | 2016-10-05 17:46:49 +0200 | [diff] [blame] | 4 | -- |
| 5 | -- This program is free software; you can redistribute it and/or modify |
| 6 | -- it under the terms of the GNU General Public License as published by |
| 7 | -- the Free Software Foundation; version 2 of the License. |
| 8 | -- |
| 9 | -- This program is distributed in the hope that it will be useful, |
| 10 | -- but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 | -- GNU General Public License for more details. |
| 13 | -- |
| 14 | |
| 15 | with Interfaces.C; |
| 16 | |
| 17 | package body HW.Time.Timer |
| 18 | with Refined_State => (Timer_State => null, |
| 19 | Abstract_Time => null) |
| 20 | is |
| 21 | |
| 22 | procedure Timer_Monotonic_Get (MT : out Interfaces.C.long); |
| 23 | pragma Import (C, Timer_Monotonic_Get, "timer_monotonic_get"); |
| 24 | |
| 25 | function Raw_Value_Min return T |
| 26 | with |
| 27 | SPARK_Mode => Off |
| 28 | is |
| 29 | Microseconds : Interfaces.C.long; |
| 30 | begin |
| 31 | Timer_Monotonic_Get (Microseconds); |
| 32 | return T (Microseconds); |
| 33 | end Raw_Value_Min; |
| 34 | |
| 35 | function Raw_Value_Max return T |
| 36 | is |
| 37 | begin |
| 38 | return Raw_Value_Min + 1; |
| 39 | end Raw_Value_Max; |
| 40 | |
| 41 | function Hz return T |
| 42 | is |
| 43 | begin |
| 44 | return 1_000_000; |
| 45 | end Hz; |
| 46 | |
| 47 | end HW.Time.Timer; |