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: [PATCH] PPC64 eanble --with-tls M2


On Tue, Feb 25, 2003 at 08:52:55AM -0600, Steven Munroe wrote:
> +/* Install new dtv for current thread.  */
> +#  define INSTALL_NEW_DTV(DTV) \
> +  ({  \
> +      asm ( \
> +        "  std %0,-(0x7000+%1)(13)\n"  \
> +        :  \
> +        :  "b" (DTV), "I" (TLS_TCB_SIZE) \
> +        :  "memory" );  \
> +  })

Why cannot this be written in just C, through __thread_self too?

> +# define TLS_INIT_TP(TCBP, SECONDCALL) \
> +  ({  \
> +      asm ( \
> +        "  addi 13,%0,(0x7000+%1)\n"  \
> +        : : "b" (TCBP), "I" (TLS_TCB_SIZE) );  \
> +	    NULL;  \
> +  })

Likewise.

> +/* Return the address of the dtv for the current thread.  */
> +#  define THREAD_DTV() \
> +  ({  dtv_t * __dvtp;  \
> +      asm ( \
> +        "  ld  %0,-(0x7000+%1)(13)\n"  \
> +        :  "=b" (__dvtp)  \
> +        :  "I" (TLS_TCB_SIZE) );  \
> +      (__dvtp); \
> +  })
> +

Likewise.

> +#  define INIT_THREAD_SELF(DESCR, NR) \
> +  ({  \
> +      asm ( \
> +        "  addi 13,%0,(0x7000+%1+%2)\n"  \
> +        :  \
> +        :  "b" (DESCR), "I" (TLS_TCB_SIZE), "I" (TLS_PRE_TCB_SIZE) ); \
> +  })

Likewise.

	Jakub


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