lkml.org 
[lkml]   [2009]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: is avoiding compat ioctls possible?
On Wed, 28 Oct 2009, Andi Kleen wrote:

> > I'm just amazed that compat_ioctl should be required for all new code.
> >
> > DrNick on irc suggested just doing:
> > if (is_compat_task()) ptr &= 0x00000000FFFFFFFF;
>
> Such hacks often have problems on BE.

And then some platforms (i.e. MIPS) require sign-extension rather than
zero-extension, that is:

if (is_compat_task()) ptr = ((ptr & 0xffffffff) ^ 0x80000000) - 0x80000000;

if doing this explicitly (with compat stuff hardware will do the right
thing automagically).

Maciej


\
 
 \ /
  Last update: 2009-10-28 22:07    [W:0.283 / U:1.484 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site