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

From: george anzinger (george@mvista.com)
Date: Fri Dec 06 2002 - 18:08:53 EST


Jim Houston wrote:
>
> Linus Torvalds wrote:
> >
> > On Fri, 6 Dec 2002, george anzinger wrote:
> > >
> > > I have not looked at your code yet, but I am concerned that
> > > the restart may not be able to get to the original
> > > parameters.
> >
> > The way the new system call restarting is done, it never looks at the old
> > parameters. They don't even _exist_ for the restarted call (well, they do,
> > but the restart function can't actually get at them). So it is up to the
> > original interrupted call to save off anything it needs saving off (and it
> > get sthe "restart_block" structure to do that saving in. Right now that's
> > just three words, but we can expand it if necessary).
> >
>
> Hi Linus,
>
> I know it would be a few extra lines of assembly code but it would be
> nice if the restart routine had the original arguments. Would it be too
> ugly to do something like:
>
> sys_restart_syscall:
> GET_THREAD_INFO(%eax)
> jmp TI_RESTART_BLOCK(%eax)
>
> I'm having second thoughts about even sending this. Its just that I hate
> casts more than I hate assembly code and using the restart_block to save
> the arguments implys casts.
>
I too, think the original parameters are very useful. I
keep wondering if we could simplify all this by just
restarting the SAME system call. Keep the restart block to
save stuff in AND let deliver_signal clear a word in it if
it is not restarting the call. This way the system call
knows it is being restarted, but it has all the parameters
it need PLUS the restart arguments. The only hole I see
here is making sure the restart block is cleared after use.
This could be done by bumping it each system call so exactly
1 means this is a restart. OR, we could trust the users to
always clear it after using (better I think, no code on the
fast path).

Oh, on thinking on this, we can get this behavior with what
we have if we just change the -ERESTARTNOHAND to clear the
first word or the restart block on the handler call. This
way you can have your cake and eat it too :)

-- 
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:28 EST