diff options
author | Mike Frysinger <vapier@gentoo.org> | 2013-05-01 23:35:30 -0400 |
---|---|---|
committer | Dmitry V. Levin <ldv@altlinux.org> | 2013-05-02 22:50:55 +0000 |
commit | d648f29cc3aeabf0a0430f8ab12ce35fa6c4e48e (patch) | |
tree | 90a7806baf9c549dab76c1b67e066acecbf247d9 /defs.h | |
parent | 48d3159d67e5786c94c3e51ce9d2a45cb4470e1a (diff) | |
download | strace-d648f29cc3aeabf0a0430f8ab12ce35fa6c4e48e.tar.gz strace-d648f29cc3aeabf0a0430f8ab12ce35fa6c4e48e.tar.bz2 strace-d648f29cc3aeabf0a0430f8ab12ce35fa6c4e48e.tar.xz |
Decode mtd/ubi ioctls
Been playing with UBI of late and it'd help if I could see what it was
doing. Not entirely sure about the decoding of UBI_IOCVOLUP -- it takes
a pointer to a 64bit value, not a strict.
* util.c (MAX, MIN): Move to ...
* defs.h (MAX, MIN): ... here.
(CLAMP): Define.
(ubi_ioctl): New prototype.
* ioctl.c (ioctl_decode): Call ubi_ioctl when code is 'o' or 'O'.
* mtd.c: Include ubi user API header.
(ubi_volume_types): New enum decode.
(ubi_volume_props): Likewise.
(ubi_ioctl): Define.
* linux/ubi-user.h: Import from linux 3.8.
Diffstat (limited to 'defs.h')
-rw-r--r-- | defs.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -86,6 +86,15 @@ extern char *stpcpy(char *dst, const char *src); #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0])) +/* macros */ +#ifndef MAX +# define MAX(a, b) (((a) > (b)) ? (a) : (b)) +#endif +#ifndef MIN +# define MIN(a, b) (((a) < (b)) ? (a) : (b)) +#endif +#define CLAMP(val, min, max) MIN(MAX(min, val), max) + /* Glibc has an efficient macro for sigemptyset * (it just does one or two assignments of 0 to internal vector of longs). */ @@ -684,6 +693,7 @@ extern int rtc_ioctl(struct tcb *, long, long); extern int scsi_ioctl(struct tcb *, long, long); extern int block_ioctl(struct tcb *, long, long); extern int mtd_ioctl(struct tcb *, long, long); +extern int ubi_ioctl(struct tcb *, long, long); extern int loop_ioctl(struct tcb *, long, long); extern int tv_nz(struct timeval *); |