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  ****************************************************************************
     11  ****************************************************************************/
     12 #ifndef _LINUX_ANDROID_ALARM_H
     13 #define _LINUX_ANDROID_ALARM_H
     14 
     15 #include <asm/ioctl.h>
     16 #include <linux/time.h>
     17 
     18 typedef enum {
     19 
     20  ANDROID_ALARM_RTC_WAKEUP,
     21  ANDROID_ALARM_RTC,
     22  ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
     23  ANDROID_ALARM_ELAPSED_REALTIME,
     24  ANDROID_ALARM_SYSTEMTIME,
     25 
     26  ANDROID_ALARM_TYPE_COUNT,
     27 
     28 } android_alarm_type_t;
     29 
     30 typedef enum {
     31  ANDROID_ALARM_RTC_WAKEUP_MASK = 1U << ANDROID_ALARM_RTC_WAKEUP,
     32  ANDROID_ALARM_RTC_MASK = 1U << ANDROID_ALARM_RTC,
     33  ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME_WAKEUP,
     34  ANDROID_ALARM_ELAPSED_REALTIME_MASK = 1U << ANDROID_ALARM_ELAPSED_REALTIME,
     35  ANDROID_ALARM_SYSTEMTIME_MASK = 1U << ANDROID_ALARM_SYSTEMTIME,
     36  ANDROID_ALARM_TIME_CHANGE_MASK = 1U << 16
     37 } android_alarm_return_flags_t;
     38 
     39 #define ANDROID_ALARM_CLEAR(type) _IO('a', 0 | ((type) << 4))
     40 #define ANDROID_ALARM_WAIT _IO('a', 1)
     41 #define ANDROID_ALARM_SET(type) _IOW('a', 2 | ((type) << 4), struct timespec)
     42 #define ANDROID_ALARM_SET_AND_WAIT(type) _IOW('a', 3 | ((type) << 4), struct timespec)
     43 #define ANDROID_ALARM_GET_TIME(type) _IOW('a', 4 | ((type) << 4), struct timespec)
     44 #define ANDROID_ALARM_SET_RTC _IOW('a', 5, struct timespec)
     45 #define ANDROID_ALARM_SET_TIMEZONE _IOW('a', 6, struct timezone)
     46 
     47 #define ANDROID_ALARM_BASE_CMD(cmd) (cmd & ~(_IOC(0, 0, 0xf0, 0)))
     48 #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd) (_IOC_NR(cmd) >> 4)
     49 
     50 #endif
     51