blob: d3f167f783d5a0a28871bbded2ba2f5265b0c111 [file] [log] [blame]
The Android Open Source Project1dc9e472009-03-03 19:28:35 -08001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
Ben Cheng654325d2012-03-07 21:13:49 -080010 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080017 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_KTIME_H
20#define _LINUX_KTIME_H
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080021#include <linux/time.h>
22#include <linux/jiffies.h>
Ben Cheng654325d2012-03-07 21:13:49 -080023/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080024typedef union {
25 s64 tv64;
26#if BITS_PER_LONG != (64 && !defined(CONFIG_KTIME_SCALAR))
27 struct {
Ben Cheng654325d2012-03-07 21:13:49 -080028/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080029#ifdef __BIG_ENDIAN
30 s32 sec, nsec;
31#else
32 s32 nsec, sec;
Ben Cheng654325d2012-03-07 21:13:49 -080033/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080034#endif
35 } tv;
36#endif
37} ktime_t;
Ben Cheng654325d2012-03-07 21:13:49 -080038/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080039#define KTIME_MAX ((s64)~((u64)1 << 63))
40#define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080041#if BITS_PER_LONG == 64
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080042#if BITS_PER_LONG == 64
Ben Cheng654325d2012-03-07 21:13:49 -080043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080044#endif
45#define ktime_sub(lhs, rhs) ({ (ktime_t){ .tv64 = (lhs).tv64 - (rhs).tv64 }; })
46#define ktime_add(lhs, rhs) ({ (ktime_t){ .tv64 = (lhs).tv64 + (rhs).tv64 }; })
47#define ktime_add_ns(kt, nsval) ({ (ktime_t){ .tv64 = (kt).tv64 + (nsval) }; })
Ben Cheng654325d2012-03-07 21:13:49 -080048/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080049#define ktime_to_timespec(kt) ns_to_timespec((kt).tv64)
50#define ktime_to_timeval(kt) ns_to_timeval((kt).tv64)
51#define ktime_to_ns(kt) ((kt).tv64)
52#else
Ben Cheng654325d2012-03-07 21:13:49 -080053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080054#endif
55#define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC }
56#define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC }
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080057#define ktime_get_real_ts(ts) getnstimeofday(ts)
Ben Cheng654325d2012-03-07 21:13:49 -080058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
The Android Open Source Project1dc9e472009-03-03 19:28:35 -080059#endif