Re: [PATCH] compatibility syscall layer (lets try again)

From: george anzinger (george@mvista.com)
Date: Thu Dec 05 2002 - 02:10:31 EST


Linus Torvalds wrote:
>
> On Wed, 4 Dec 2002, george anzinger wrote:
> >
> > Once it changes the system call (eax, right), could the new
> > call code then just get the parms from the restart_block.
>
> Agreed.
>
> > I think it would be best to keep this as generic as
> > possible, i.e. let the new call code fetch its own
> > paramerers from the restart_block.
>
> We could even have one _single_ a generic "restart" system call, and have
> the function pointer for that be in the restart block.

I think what you mean is that, if there is a
restart_function (i.e. the block is set up) and the return
is -ERESTART_RESTARTBLOCK, then change eax (x86 ) to call
sys_restart which would in turn call the function in the
restart_block.

One of the problems with this is the way parameters are
passed to system calls. One way to do this would be to have
sys_restart branch to the restart_function (requires asm).
Another way is to just pass a struct pointer (actually the
reg struct) which the restart function could sort out. For
example for nano_sleep:

int sys_restart(struct void parms)
{
        return (current->restart_block.sys_call) (&parms);

}
Then:
struct nano_sleep_call{
        struct timespec *tp;
        struct timespec *rem;
}
int restart_nano_sleep(struct nano_sleep_call *parm)
>
> > My question is who sets up these values? I think you are
> > saying it should be the system call. Is this right?
>
> Whatever system call that return -ERESTART_RESTARTBLOCK, yes.
>
> So it would never get set up at all in the fast path. Only in the error
> case path of a system call that wants to have restarting capabilities.

And then only when returning -ERESTART_RESTARTBLOCK.
>
> 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/

-- 
George Anzinger   george@mvista.com
High-res-timers: 
http://sourceforge.net/projects/high-res-timers/
Preemption patch:
http://www.kernel.org/pub/linux/kernel/people/rml
-
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/



This archive was generated by hypermail 2b29 : Sat Dec 07 2002 - 22:00:22 EST