Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Merge branch 'devel'
[palacios.git] / kitten / include / lwk / time.h
1 #ifndef _LWK_TIME_H
2 #define _LWK_TIME_H
3
4 #include <lwk/types.h>
5 #include <lwk/init.h>
6 #include <arch/time.h>
7
8 #define NSEC_PER_SEC  1000000000L
9 #define NSEC_PER_USEC 1000L
10 #define USEC_PER_NSEC 1000L
11
12 struct timeval {
13         time_t          tv_sec;         /* seconds */
14         suseconds_t     tv_usec;        /* microseconds */
15 };
16
17 struct timezone {
18         int             tz_minuteswest; /* minutes west of Greenwich */
19         int             tz_dsttime;     /* type of dst correction */
20 };
21
22 struct timespec {
23         time_t          tv_sec;         /* seconds */
24         long            tv_nsec;        /* nanoseconds */
25 };
26
27 void __init time_init(void);
28 void init_cycles2ns(uint32_t khz);
29 uint64_t cycles2ns(uint64_t cycles);
30 uint64_t get_time(void);
31 void set_time(uint64_t ns);
32
33 #define timespec_is_valid(ts) \
34 (((ts)->tv_sec >= 0) && (((unsigned long)(ts)->tv_nsec) < NSEC_PER_SEC))
35
36 #endif