[Re: [structure field names] ]

Eric ebrower at usa.net
Fri Jul 20 13:34:22 EDT 2001


David Woodhouse <dwmw2 at infradead.org> wrote:
> 
> > ebrower at usa.net said:
> > > There is a patch for SPARC/Linux in the patches directory
> > > that performs 32- to 64-bit ioctl conversions.  If you
> > > touch any struct member names that are used as ioctl args
> > > this patch will need to be rev'ed as well.
> 
> I thought we'd changed the types so that conversions weren't necessary?

We changed the types so that (amongst other reasons) the ioctl
conversions were easier-- without explicitly-sized types the
conversion routines would need to redefine all structs used as
ioctl arguments to be explicitly sized, and then it would have 
to copy each struct element individually to and from userspace.

Though we are now using proper types, we still need to inform the
sparc64 kernel that the MTD ioctls are understood and require no
explicit conversions.  In the case of the MEMREADOOB and MEMWRITEOOB
ioctls, we still must do conversions so that the u8* is understood
by the kernel to be a 32-bit userspace pointer and not a 64-bit
kernelspace pointer.  This involves a bit of handwaving that will
require a conversion routine.  Strictly speaking, the sparc64 
platform does not use NAND flash so these OOB ioctls are not 
necessary (so I did not include them in the initial patch), but
DaveM would like the conversions there for completeness so I have
submitted that patch to him; if accepted, I'll submit it to the
MTD CVS for safekeeping.

To make a long story short (too late!), when running the sparc64
kernel with a 32-bit userland, ALL ioctls must have an entry in 
the ioctl32 conversion table, and some will require custom 
conversion routines.

I only brought this up because if the structure member names are
modified, they must be modified in the sparc64 patch as well.  This
is, unfortunately, a required headache.

E




More information about the linux-mtd mailing list