On Sunday 06 May 2007 19:14, Petr Vandrovec wrote:> Hello Dan,> > This patch makes raw1394 in current Linux git tree (2.6.21-1570) usable to 32bit> applications running on 64bit kernel (tested on i386 app using x86_64 kernel). I > had to make following changes:> > * read() always failed with -EFAULT. This was happening due to> raw1394_compat_read copying data to wrong location - access_ok always> failed as 'r' is kernel address, not user. Whole function just tried to> copy data from 'r' to 'r', which is not good.> > * write(fd, buf, 52) from 32bit app was returning 56. Most of callers did not> care, but some (arm registration) did, and anyway it looks bad if request for> writing 52 bytes returns 56. And returning sizeof anything in 'int' is not> good as well. So all functions now return '0' instead of> sizeof(struct raw1394_request) on success, and write() itself provides correct> return value (it just returns value it was asked to write on success as raw1394> does not do any partial writes at all).> > * Related to this was problem that write() could have returned 0 when kernel> state would become corrupted and moved to different state than> opened/initialized/connected. Now it returns -EBADFD which seemed appropriate.> > * And add compat_ioctl. Although all structures are more or less same,> raw1394_iso_packets got pointer inside, and raw1394_cycle_timer got unwanted> padding in the middle. I did not add any translation for ioctls passing array> of integers around as integers seem to have same size (32 bits) on all > architectures supported by Linux.> > With this in place I was able to run my test app and grab some mpegs, so I believe> that I got everything necessary done. If you believe I have missed some ioctl, yell> at me.> Thanks,> Petr Vandrovec> > Signed-off-by: Petr Vandrovec <petr@vandrovec.name>

Reviewed and been testing out fine here on i386.Acked-by: Dan Dennedy <dan@dennedy.org>