Home | History | Annotate | Download | only in linux
      1 /****************************************************************************
      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  ***
     10  ***   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  ***
     17  ****************************************************************************
     18  ****************************************************************************/
     19 #ifndef _LINUX_KTIME_H
     20 #define _LINUX_KTIME_H
     21 #include <linux/time.h>
     22 #include <linux/jiffies.h>
     23 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     24 typedef union {
     25  s64 tv64;
     26 #if BITS_PER_LONG != (64 && !defined(CONFIG_KTIME_SCALAR))
     27  struct {
     28 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     29 #ifdef __BIG_ENDIAN
     30  s32 sec, nsec;
     31 #else
     32  s32 nsec, sec;
     33 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     34 #endif
     35  } tv;
     36 #endif
     37 } ktime_t;
     38 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     39 #define KTIME_MAX ((s64)~((u64)1 << 63))
     40 #define KTIME_SEC_MAX (KTIME_MAX / NSEC_PER_SEC)
     41 #if BITS_PER_LONG == 64
     42 #if BITS_PER_LONG == 64
     43 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     44 #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) }; })
     48 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     49 #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
     53 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     54 #endif
     55 #define KTIME_REALTIME_RES (ktime_t){ .tv64 = TICK_NSEC }
     56 #define KTIME_MONOTONIC_RES (ktime_t){ .tv64 = TICK_NSEC }
     57 #define ktime_get_real_ts(ts) getnstimeofday(ts)
     58 /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
     59 #endif
     60