1 #ifndef _INPUT_COMPAT_H
2 #define _INPUT_COMPAT_H
5 * 32bit compatibility wrappers for the input subsystem.
7 * Very heavily based on evdev.c - Copyright (c) 1999-2002 Vojtech Pavlik
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License version 2 as published by
11 * the Free Software Foundation.
14 #include <linux/compiler.h>
15 #include <linux/compat.h>
16 #include <linux/input.h>
20 #define INPUT_COMPAT_TEST in_compat_syscall()
22 struct input_event_compat
{
23 struct compat_timeval time
;
29 struct ff_periodic_effect_compat
{
36 struct ff_envelope envelope
;
39 compat_uptr_t custom_data
;
42 struct ff_effect_compat
{
46 struct ff_trigger trigger
;
47 struct ff_replay replay
;
50 struct ff_constant_effect constant
;
51 struct ff_ramp_effect ramp
;
52 struct ff_periodic_effect_compat periodic
;
53 struct ff_condition_effect condition
[2]; /* One for each axis */
54 struct ff_rumble_effect rumble
;
58 static inline size_t input_event_size(void)
60 return (INPUT_COMPAT_TEST
&& !COMPAT_USE_64BIT_TIME
) ?
61 sizeof(struct input_event_compat
) : sizeof(struct input_event
);
66 static inline size_t input_event_size(void)
68 return sizeof(struct input_event
);
71 #endif /* CONFIG_COMPAT */
73 int input_event_from_user(const char __user
*buffer
,
74 struct input_event
*event
);
76 int input_event_to_user(char __user
*buffer
,
77 const struct input_event
*event
);
79 int input_ff_effect_from_user(const char __user
*buffer
, size_t size
,
80 struct ff_effect
*effect
);
82 #endif /* _INPUT_COMPAT_H */