1/**
2 * \file
3 * \brief System time
4 */
5
6/*
7 * Copyright (c) 2016, ETH Zurich.
8 * All rights reserved.
9 *
10 * This file is distributed under the terms in the attached LICENSE file.
11 * If you do not find this file, copies can be found by writing to:
12 * ETH Zurich D-INFK, Haldeneggsteig 4, CH-8092 Zurich. Attn: Systems Group.
13 */
14
15#ifndef __SYSTIME_H
16#define __SYSTIME_H
17
18#include <barrelfish_kpi/types.h> /* systime_t */
19
20/// Frequency of the system time ticks (systime)
21extern systime_t systime_frequency;
22
23/**
24 * Get the current system time from a hardware clock
25 */
26systime_t systime_now(void);
27
28/**
29 * Convert nanoseconds to a system time ticks
30 */
31systime_t ns_to_systime(uint64_t nanoseconds);
32
33/**
34 * Convert a system time ticks to nanoseconds
35 */
36uint64_t systime_to_ns(systime_t time);
37
38/**
39 * Set a point at which a timer interrupt should occur
40 * if it's in a past, trigger immediately
41 */
42void systime_set_timeout(systime_t timeout);
43
44#endif // __SYSTIME_H
45