summaryrefslogtreecommitdiffstats
path: root/sys/dev/pci/drm/include/linux/timekeeping.h
blob: ea19385fad6949b7dd0f5e8455c3a07b2d0408aa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* Public domain. */

#ifndef _LINUX_TIMEKEEPING_H
#define _LINUX_TIMEKEEPING_H

#define ktime_get_boottime()	ktime_get()
#define get_seconds()		gettime()

static inline time_t
ktime_get_real_seconds(void)
{
	return gettime();
}

static inline struct timeval
ktime_get_real(void)
{
	struct timeval tv;
	getmicrotime(&tv);
	return tv;
}

static inline uint64_t
ktime_get_ns(void)
{
	struct timeval tv = ktime_get();
	return timeval_to_ns(&tv);
}

#endif