This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: IA64 INLINE_SYSCALL Support


On Thu, Dec 12, 2002 at 04:16:01PM +1100, Ian Wienand wrote:
> > I found this patch
> > http://sources.redhat.com/ml/libc-hacker/2001-03/msg00061.html which I
> > have modified.
> > 
> > The most obvious problem with that patch is that on IA64 the returned
> > errno is not negative.  on a syscall return, r10 is set to -1 to
> > flag an error, and r8 then contains the return value or the positive
> > errno (this is not the case for internal kernel errors though, where
> > the errno convention follows the single value return for error and
> > errno, it's just de-multiplexed for return to userspace).

This part is ok.

> > The less obvious problem is that using register variables (_r8 and
> > _r10 in the original) doesn't really work.  It seems to work some of
> > the time, but other times r8 manages to get it's self corrupted
> > somewhere between returning and going back to the calling function.

While this one is certainly wrong.
E.g. you don't list r8, r10 and r15 in the list of clobbers, so compiler
might very well keep something in one of these registers accross the break
insn. Also, forcing __NR_##name into a register and then moving it to r15
is a bad idea. And last using int for syscall return values on 64-bit
platform is bad, should be long.

Can you please give some details on what exactly doesn't work with Jes'
original patch with the obvious -_r8 -> _r8 change (ie. how to reproduce
it, if possible what function gets miscompiled, etc.)?
I'm ATM regression testing Jes' patch + -_r8 -> _r8 plus a separate
long retval; with retval = _r8; immediately after the volatile asm
and haven't seen any (unexpected) failure during make check.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]