Re: [PATCH] Start of compat32.h (again)

Linus Torvalds (torvalds@transmeta.com)
Wed, 27 Nov 2002 09:18:06 -0800 (PST)


On Wed, 27 Nov 2002, Stephen Rothwell wrote:
>
> How's this one :-)

Better.

> This patch does:
> introduces CONFIG_COMPAT32
> introduces linux/compat32.h - which contains only struct timespec32
> for now
> creates an architecture independent version of sys32_nanosleep
> in kernel/timer.c

May I just suggest doing a

kernel/compat32.c

and doing most everything there? I think we're better off that way, even
if it means that "do_nanosleep()" etc cannot be static.

> I make the follwing assumptions:
> returning s32 from a 32 bit compatibility system call is the same
> as returning long or int.

You should make system call returns always be of type "long". Some
architectures may well require that (I know that the alpha calling
conventions do require it, even when using the 32-bit user land. I don't
think Linux has ever really supported the 32-bit stuff on alpha, but the
theory is the same).

And it means that the upper bits are well-defined.

In other words, instead of doing

s32 sys_xxx(..)
{
return xxxx
}

you should make them be

long sys_xxx(...)
{
s32 retval;
...
return retval;
}

> Should the new do_nanosleep function be inlined?

Well, since I want it used in another file, it can't be.

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/