new syscall stub support for ia64 libc

David Mosberger davidm@napali.hpl.hp.com
Fri Oct 31 16:43:00 GMT 2003


>>>>> On Fri, 31 Oct 2003 00:42:49 -0800, Richard Henderson <rth@twiddle.net> said:

  Richard> On Thu, Oct 30, 2003 at 12:04:22AM -0800, David Mosberger wrote:
  >> +    __asm __volatile ("adds r2 = -8, r13;;\n"
  >> +		      "ld8 r2 = [r2];;\n"
  >> +		      "mov b7=r2;\n"
  >> +		      "br.call.sptk.many b6=b7;;\n"
  >> +                      : "=r" (_r8), "=r" (_r10),
  >> +			   "=r" (_r15) ASM_OUTARGS_##nr
  >> +                      : "2" (_r15) ASM_ARGS_##nr
  >> +		      : "memory", "ar.pfs" ASM_CLOBBERS_##nr);

  Richard> Any particular reason why you're managing the memory load
  Richard> from assembly?  Seems to me you could do

  Richard> __asm __volatile ("br.call.sptk.many b6=%0"
  Richard> : ...
  Richard> : "b" (__thread_self->whatever)
  Richard> : ...);

That's probably worth trying.

  Richard> Anyway, the magic -8 there certainly looks dangerous.

Not really.  The offset must be architected (effectively, it's part of
the ia64 linux abi), because otherwise you can't use the new syscall
stubs outside of the C library.  But I agree it would be cleaner to
use the offset macro in this particular case (for consistency); I just
didn't want to sort out the include file dependency mess that made
this difficult at the time.

Regardless, we should probably add an assertion somewhere that
SYSINFO_OFFSET == -8.

	--david



More information about the Libc-hacker mailing list