mapi: Access _glapi_tls_Dispatch directly without need of macro
Signed-off-by: Yonggang Luo <luoyonggang@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Acked-by: Jose Fonseca <jfonseca@vmware.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17814>
This commit is contained in:
@@ -36,9 +36,6 @@
|
||||
#define _U_STRINGIFY(x) #x
|
||||
#define U_STRINGIFY(x) _U_STRINGIFY(x)
|
||||
|
||||
/* define macros for use by assembly dispatchers */
|
||||
#define ENTRY_CURRENT_TABLE U_STRINGIFY(_glapi_tls_Dispatch)
|
||||
|
||||
/* REALLY_INITIAL_EXEC implies __GLIBC__ */
|
||||
#if defined(USE_X86_ASM) && defined(REALLY_INITIAL_EXEC)
|
||||
#include "entry_x86_tls.h"
|
||||
|
||||
@@ -55,9 +55,9 @@ __asm__(".text\n"
|
||||
" .localentry " func ", .-" func "\n\t"
|
||||
|
||||
#define STUB_ASM_CODE(slot) \
|
||||
" addis 11, 2, " ENTRY_CURRENT_TABLE "@got@tprel@ha\n\t" \
|
||||
" ld 11, " ENTRY_CURRENT_TABLE "@got@tprel@l(11)\n\t" \
|
||||
" add 11, 11," ENTRY_CURRENT_TABLE "@tls\n\t" \
|
||||
" addis 11, 2, _glapi_tls_Dispatch@got@tprel@ha\n\t" \
|
||||
" ld 11, _glapi_tls_Dispatch@got@tprel@l(11)\n\t" \
|
||||
" add 11, 11,_glapi_tls_Dispatch@tls\n\t" \
|
||||
" ld 11, 0(11)\n\t" \
|
||||
" ld 12, " slot "*8(11)\n\t" \
|
||||
" mtctr 12\n\t" \
|
||||
@@ -88,8 +88,8 @@ entry_get_public(int slot)
|
||||
__asm__(".text\n");
|
||||
|
||||
__asm__("ppc64le_dispatch_tls:\n\t"
|
||||
" addis 3, 2, " ENTRY_CURRENT_TABLE "@got@tprel@ha\n\t"
|
||||
" ld 3, " ENTRY_CURRENT_TABLE "@got@tprel@l(3)\n\t"
|
||||
" addis 3, 2, _glapi_tls_Dispatch@got@tprel@ha\n\t"
|
||||
" ld 3, _glapi_tls_Dispatch@got@tprel@l(3)\n\t"
|
||||
" blr\n"
|
||||
);
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ __asm__(".text\n"
|
||||
|
||||
#define STUB_ASM_CODE(slot) \
|
||||
ENDBR \
|
||||
"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
|
||||
"movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax\n\t" \
|
||||
"movq %fs:(%rax), %r11\n\t" \
|
||||
"jmp *(8 * " slot ")(%r11)"
|
||||
|
||||
@@ -59,7 +59,7 @@ __asm__(".text\n"
|
||||
|
||||
#define STUB_ASM_CODE(slot) \
|
||||
ENDBR \
|
||||
"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t" \
|
||||
"movq _glapi_tls_Dispatch@GOTTPOFF(%rip), %rax\n\t" \
|
||||
"movl %fs:(%rax), %r11d\n\t" \
|
||||
"movl 4*" slot "(%r11d), %r11d\n\t" \
|
||||
"jmp *%r11"
|
||||
@@ -121,7 +121,7 @@ entry_generate(int slot)
|
||||
char *code;
|
||||
mapi_func entry;
|
||||
|
||||
__asm__("movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%%rip), %0"
|
||||
__asm__("movq _glapi_tls_Dispatch@GOTTPOFF(%%rip), %0"
|
||||
: "=r" (addr));
|
||||
if ((addr >> 32) != 0xffffffff)
|
||||
return NULL;
|
||||
|
||||
@@ -48,7 +48,7 @@ __asm__("x86_current_tls:\n\t"
|
||||
"1:\n\t"
|
||||
"popl %eax\n\t"
|
||||
"addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t"
|
||||
"movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t"
|
||||
"movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax\n\t"
|
||||
"ret");
|
||||
|
||||
#ifndef GLX_X86_READONLY_TEXT
|
||||
@@ -70,7 +70,7 @@ __asm__(".balign 16\n"
|
||||
"1:\n\t" \
|
||||
"popl %eax\n\t" \
|
||||
"addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t" \
|
||||
"movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t" \
|
||||
"movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax\n\t" \
|
||||
"movl %gs:(%eax), %eax\n\t" \
|
||||
"jmp *(4 * " slot ")(%eax)"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user