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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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: new syscall stub support for ia64 libc


On Fri, Oct 31, 2003 at 12:42:49AM -0800, Richard Henderson wrote:
> 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);
> 
> Any particular reason why you're managing the memory load
> from assembly?  Seems to me you could do
> 
> 	__asm __volatile ("br.call.sptk.many b6=%0"
> 			  : ...
> 			  : "b" (__thread_self->whatever)

Cannot tcbhead_t's private field be reused for the sysinfo pointer
actually on IA-64? That way 32 bytes wouldn't have to be wasted
at end of struct pthread, it would be at the same location in
linuxthreads as well as NPTL build (so that linuxthreads ld.so
can load NPTL libc/libpthread).
It would need some small changes in generic code, particularly
macroizing sysinfo access.
On IA-32 this could be:
#define THREAD_SELF_SYSINFO THREAD_GETMEM (THREAD_SELF, header.sysinfo)
#define THREAD_SYSINFO(pd) ((pd)->header.sysinfo)
and on IA-64:
#define THREAD_SELF_SYSINFO (((tcbhead_t) __thread_self)->private)
#define THREAD_SYSINFO(pd) (((tcbhead_t) ((pd) + 1))->private)

	Jakub


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