diff --git a/NEWS b/NEWS index 7440afd3..31028e78 100644 --- a/NEWS +++ b/NEWS @@ -12,7 +12,7 @@ Noteworthy changes in release 4.12 (????-??-??) * Implemented dumping of preadv, preadv2, pwritev, pwritev2, and vmsplice syscalls. * Implemented decoding of BTRFS_* and UFFDIO_* ioctl commands. - * Enhanced decoding of BLK*, RTC_*, and VIDIOC_* ioctl commands. + * Enhanced decoding of BLK*, EVIOC*, RTC_*, and VIDIOC_* ioctl commands. * Enhanced decoding of fstatfs, fstatfs64, get_mempolicy, getdents, getdents64, getgroups, getpriority, kill, mbind, migrate_pages, mknod, mknodat, personality, poll, ppoll, quotactl, rt_sigpending, diff --git a/defs.h b/defs.h index 0416b815..b2a7f4d8 100644 --- a/defs.h +++ b/defs.h @@ -372,6 +372,7 @@ typedef uint8_t qualbits_t; extern const struct xlat addrfams[]; extern const struct xlat at_flags[]; extern const struct xlat dirent_types[]; +extern const struct xlat evdev_abs[]; extern const struct xlat open_access_modes[]; extern const struct xlat open_mode_flags[]; extern const struct xlat resource_flags[]; @@ -659,7 +660,6 @@ struct strace_statfs; extern void print_struct_statfs(struct tcb *tcp, long); extern void print_struct_statfs64(struct tcb *tcp, long, unsigned long); -extern int evdev_ioctl(struct tcb *, const unsigned int, long); extern int file_ioctl(struct tcb *, const unsigned int, long); extern int fs_x_ioctl(struct tcb *, const unsigned int, long); extern int hdio_ioctl(struct tcb *, const unsigned int, long); diff --git a/evdev.c b/evdev.c index 9a6c631b..2e436d6e 100644 --- a/evdev.c +++ b/evdev.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2015 Etienne Gemsa - * Copyright (c) 2015 Dmitry V. Levin + * Copyright (c) 2015-2016 Dmitry V. Levin * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -30,9 +30,19 @@ #ifdef HAVE_LINUX_INPUT_H +#include DEF_MPERS_TYPE(struct_ff_effect) + # include # include -# include "xlat/evdev_abs.h" + +typedef struct ff_effect struct_ff_effect; + +#endif /* HAVE_LINUX_BTRFS_H */ + +#include MPERS_DEFS + +#ifdef HAVE_LINUX_INPUT_H + # include "xlat/evdev_autorepeat.h" # include "xlat/evdev_ff_status.h" # include "xlat/evdev_ff_types.h" @@ -51,8 +61,10 @@ # endif static void -decode_envelope(const struct ff_envelope *envelope) +decode_envelope(void *const data) { + const struct ff_envelope *const envelope = data; + tprintf(", envelope={attack_length=%" PRIu16 ", attack_level=%" PRIu16 ", fade_length=%" PRIu16 @@ -68,7 +80,7 @@ ff_effect_ioctl(struct tcb *tcp, long arg) { tprints(", "); - struct ff_effect ffe; + struct_ff_effect ffe; if (umove_or_printaddr(tcp, arg, &ffe)) return 1; @@ -497,8 +509,8 @@ evdev_write_ioctl(struct tcb *tcp, const unsigned int code, const long arg) return 0; } -int -evdev_ioctl(struct tcb *tcp, const unsigned int code, long arg) +MPERS_PRINTER_DECL(int, evdev_ioctl, struct tcb *tcp, + const unsigned int code, const long arg) { switch(_IOC_DIR(code)) { case _IOC_READ: