[Mesa-dev] [PATCH] glapi: Inline x86_64_current_tls().

Ian Romanick idr at freedesktop.org
Tue Sep 1 10:15:06 PDT 2015


I looked at the change that added this (97185bf2), and there was no
explanation why it was done this way... and the rest of the
MAPI_MODE_BRIDGE stuff seems fairly nuts.  This change, however, seems
reasonable.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

On 08/28/2015 11:47 AM, Matt Turner wrote:
> ---
> Here's another glapi patch that I never got upstream.
> 
>  src/mapi/entry_x86-64_tls.h | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/src/mapi/entry_x86-64_tls.h b/src/mapi/entry_x86-64_tls.h
> index 5c03b04..38faccc 100644
> --- a/src/mapi/entry_x86-64_tls.h
> +++ b/src/mapi/entry_x86-64_tls.h
> @@ -46,13 +46,6 @@ __asm__(".text\n"
>  
>  #ifndef MAPI_MODE_BRIDGE
>  
> -__asm__("x86_64_current_tls:\n\t"
> -	"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t"
> -	"ret");
> -
> -extern unsigned long
> -x86_64_current_tls();
> -
>  #include <string.h>
>  #include "u_execmem.h"
>  
> @@ -90,7 +83,8 @@ entry_generate(int slot)
>     char *code;
>     mapi_func entry;
>  
> -   addr = x86_64_current_tls();
> +   __asm__("movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%%rip), %0"
> +           : "=r" (addr));
>     if ((addr >> 32) != 0xffffffff)
>        return NULL;
>     addr &= 0xffffffff;
> 



More information about the mesa-dev mailing list