Re: v4l & compat_ioctl

Jiri Slaby
2008-03-28T12:23:18Z

On 03/28/2008 12:38 PM, Andi Kleen wrote:
> BTW i haven't audited them, but if there is u64 or similar in there anywhere
> be careful about alignment.

Well, not good, some ioctls have different numbers on 32 and 64 bit:
struct v4l2_ext_controls {
__u32 ctrl_class;
__u32 count;
__u32 error_idx;
__u32 reserved[2];
struct v4l2_ext_control *controls;
};
#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
as an example.

And alignment is a problem here (v4l2_std_id is u64):
struct v4l2_standard {
__u32 index;
v4l2_std_id id;
__u8 name[24];
struct v4l2_fract frameperiod; /* Frames, not fields */
__u32 framelines;
__u32 reserved[4];
};
which results in different ioctl numbers too.