]> Pileus Git - ~andy/linux/blobdiff - drivers/staging/android/android_alarm.h
staging: alarm-dev: Implement compat_ioctl support
[~andy/linux] / drivers / staging / android / android_alarm.h
index d0cafd6371996c75e3ee094b2be3168ad14d38b7..4fd32f337f9cbb878419794e966fe8b47851a75a 100644 (file)
@@ -18,6 +18,7 @@
 
 #include <linux/ioctl.h>
 #include <linux/time.h>
+#include <linux/compat.h>
 
 enum android_alarm_type {
        /* return code bit numbers or set alarm arg */
@@ -59,4 +60,22 @@ enum android_alarm_return_flags {
 #define ANDROID_ALARM_BASE_CMD(cmd)         (cmd & ~(_IOC(0, 0, 0xf0, 0)))
 #define ANDROID_ALARM_IOCTL_TO_TYPE(cmd)    (_IOC_NR(cmd) >> 4)
 
+
+#ifdef CONFIG_COMPAT
+#define ANDROID_ALARM_SET_COMPAT(type)         ALARM_IOW(2, type, \
+                                                       struct compat_timespec)
+#define ANDROID_ALARM_SET_AND_WAIT_COMPAT(type)        ALARM_IOW(3, type, \
+                                                       struct compat_timespec)
+#define ANDROID_ALARM_GET_TIME_COMPAT(type)    ALARM_IOW(4, type, \
+                                                       struct compat_timespec)
+#define ANDROID_ALARM_SET_RTC_COMPAT           _IOW('a', 5, \
+                                                       struct compat_timespec)
+#define ANDROID_ALARM_IOCTL_NR(cmd)            (_IOC_NR(cmd) & ((1<<4)-1))
+#define ANDROID_ALARM_COMPAT_TO_NORM(cmd)  \
+                               ALARM_IOW(ANDROID_ALARM_IOCTL_NR(cmd), \
+                                       ANDROID_ALARM_IOCTL_TO_TYPE(cmd), \
+                                       struct timespec)
+
+#endif
+
 #endif