aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/android/android_alarm.h
diff options
context:
space:
mode:
authorJohn Stultz <john.stultz@linaro.org>2013-01-11 15:46:24 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-01-18 12:37:11 -0800
commit532572b94815e1ede5d9c5434ddb94835df4429e (patch)
tree0475f48d2f44ba5a08865632c7c81cb18a63160f /drivers/staging/android/android_alarm.h
parentcec8bb73a2c603034b04b5d56e16878d0b0ef2dd (diff)
staging: alarm-dev: Implement compat_ioctl support
Implement compat_ioctl support for the alarm-dev ioctl. Cc: Serban Constantinescu <serban.constantinescu@arm.com> Cc: Arve Hjønnevåg <arve@android.com> Cc: Colin Cross <ccross@google.com> Cc: Android Kernel Team <kernel-team@android.com> Signed-off-by: John Stultz <john.stultz@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/android/android_alarm.h')
-rw-r--r--drivers/staging/android/android_alarm.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/staging/android/android_alarm.h b/drivers/staging/android/android_alarm.h
index d0cafd63719..4fd32f337f9 100644
--- a/drivers/staging/android/android_alarm.h
+++ b/drivers/staging/android/android_alarm.h
@@ -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