From 9f37c9903b87f86a533bfaffa72f0ecb285b02b2 Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Sat, 3 Aug 2019 18:44:44 +0200 Subject: mesa: Rename GLX_USE_TLS to USE_ELF_TLS. These days it is not GLX only and it does not work with all TLS implementations. Reviewed-by: Eric Engestrom --- src/mapi/glapi/gen/gl_SPARC_asm.py | 2 +- src/mapi/glapi/gen/gl_x86-64_asm.py | 6 +++--- src/mapi/glapi/gen/gl_x86_asm.py | 8 ++++---- src/mapi/glapi/glapi.c | 4 ++-- src/mapi/glapi/glapi.h | 4 ++-- src/mapi/glapi/glapi_entrypoint.c | 20 ++++++++++---------- src/mapi/glapi/glapi_priv.h | 4 ++-- 7 files changed, 24 insertions(+), 24 deletions(-) (limited to 'src/mapi/glapi') diff --git a/src/mapi/glapi/gen/gl_SPARC_asm.py b/src/mapi/glapi/gen/gl_SPARC_asm.py index 0152958a8b9..34e83adaeca 100644 --- a/src/mapi/glapi/gen/gl_SPARC_asm.py +++ b/src/mapi/glapi/gen/gl_SPARC_asm.py @@ -77,7 +77,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print('\t add\t%o7, %g2, %g2') print('\t.size\t__glapi_sparc_get_pc, .-__glapi_sparc_get_pc') print('') - print('#ifdef GLX_USE_TLS') + print('#ifdef USE_ELF_TLS') print('') print('\tGLOBL_FN(__glapi_sparc_get_dispatch)') print('\tHIDDEN(__glapi_sparc_get_dispatch)') diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py index 36d3ecdde92..f51f513c5ed 100644 --- a/src/mapi/glapi/gen/gl_x86-64_asm.py +++ b/src/mapi/glapi/gen/gl_x86-64_asm.py @@ -143,7 +143,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print('') print('\t.text') print('') - print('#ifdef GLX_USE_TLS') + print('#ifdef USE_ELF_TLS') print('') print('_x86_64_get_dispatch:') print('\tmovq\t_glapi_tls_Dispatch@GOTTPOFF(%rip), %rax') @@ -227,7 +227,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): if not f.is_static_entry_point(f.name): print('\tHIDDEN(GL_PREFIX(%s))' % (name)) print('GL_PREFIX(%s):' % (name)) - print('#if defined(GLX_USE_TLS)') + print('#if defined(USE_ELF_TLS)') print('\tcall\t_x86_64_get_dispatch@PLT') print('\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)) print('\tjmp\t*%r11') @@ -258,7 +258,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print('\tmovq\t%u(%%rax), %%r11' % (f.offset * 8)) print('\tjmp\t*%r11') - print('#endif /* defined(GLX_USE_TLS) */') + print('#endif /* defined(USE_ELF_TLS) */') print('\t.size\tGL_PREFIX(%s), .-GL_PREFIX(%s)' % (name, name)) print('') diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py index ada849f35e9..f373d15db4a 100644 --- a/src/mapi/glapi/gen/gl_x86_asm.py +++ b/src/mapi/glapi/gen/gl_x86_asm.py @@ -81,7 +81,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print('#endif') print('') print('') - print('#ifdef GLX_USE_TLS') + print('#ifdef USE_ELF_TLS') print('') print('#ifdef GLX_X86_READONLY_TEXT') print('# define CTX_INSNS MOV_L(GS:(EAX), EAX)') @@ -132,7 +132,7 @@ class PrintGenericStubs(gl_XML.gl_print_base): print('') print('SEG_TEXT') print('') - print('#ifdef GLX_USE_TLS') + print('#ifdef USE_ELF_TLS') print('') print('\tGLOBL\tGLNAME(_x86_get_dispatch)') print('\tHIDDEN(GLNAME(_x86_get_dispatch))') @@ -161,9 +161,9 @@ class PrintGenericStubs(gl_XML.gl_print_base): print('#endif') print('') - print('#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )') + print('#if defined( USE_ELF_TLS ) && !defined( GLX_X86_READONLY_TEXT )') print('\t\t.section\twtext, "awx", @progbits') - print('#endif /* defined( GLX_USE_TLS ) */') + print('#endif /* defined( USE_ELF_TLS ) */') print('') print('\t\tALIGNTEXT16') diff --git a/src/mapi/glapi/glapi.c b/src/mapi/glapi/glapi.c index 55258a476c7..53cfd7f087a 100644 --- a/src/mapi/glapi/glapi.c +++ b/src/mapi/glapi/glapi.c @@ -33,11 +33,11 @@ * u_current.c. */ -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS /* not used, but defined for compatibility */ const struct _glapi_table *_glapi_Dispatch; const void *_glapi_Context; -#endif /* GLX_USE_TLS */ +#endif /* USE_ELF_TLS */ void _glapi_destroy_multithread(void) diff --git a/src/mapi/glapi/glapi.h b/src/mapi/glapi/glapi.h index d5d4e0a03a6..3e852a935bc 100644 --- a/src/mapi/glapi/glapi.h +++ b/src/mapi/glapi/glapi.h @@ -86,7 +86,7 @@ typedef void (*_glapi_nop_handler_proc)(const char *name); struct _glapi_table; -#if defined (GLX_USE_TLS) +#if defined (USE_ELF_TLS) _GLAPI_EXPORT extern __thread struct _glapi_table * _glapi_tls_Dispatch __attribute__((tls_model("initial-exec"))); @@ -111,7 +111,7 @@ _GLAPI_EXPORT extern void *_glapi_Context; #define GET_CURRENT_CONTEXT(C) struct gl_context *C = (struct gl_context *) \ (likely(_glapi_Context) ? _glapi_Context : _glapi_get_context()) -#endif /* defined (GLX_USE_TLS) */ +#endif /* defined (USE_ELF_TLS) */ void diff --git a/src/mapi/glapi/glapi_entrypoint.c b/src/mapi/glapi/glapi_entrypoint.c index f1f7f5e5955..ff20bac4810 100644 --- a/src/mapi/glapi/glapi_entrypoint.c +++ b/src/mapi/glapi/glapi_entrypoint.c @@ -38,7 +38,7 @@ #ifdef USE_X86_ASM -#if defined( GLX_USE_TLS ) +#if defined( USE_ELF_TLS ) extern GLubyte gl_dispatch_functions_start[]; extern GLubyte gl_dispatch_functions_end[]; #else @@ -68,7 +68,7 @@ get_entrypoint_address(unsigned int functionOffset) static void init_glapi_relocs( void ) { -#if defined(GLX_USE_TLS) && !defined(GLX_X86_READONLY_TEXT) +#if defined(USE_ELF_TLS) && !defined(GLX_X86_READONLY_TEXT) extern unsigned long _x86_get_dispatch(void); char run_time_patch[] = { 0x65, 0xa1, 0, 0, 0, 0 /* movl %gs:0,%eax */ @@ -121,7 +121,7 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, unsigned int offset) { GLubyte * const code = (GLubyte *) entrypoint; -#if defined(GLX_USE_TLS) +#if defined(USE_ELF_TLS) *((unsigned int *)(code + 8)) = 4 * offset; #else *((unsigned int *)(code + 11)) = 4 * offset; @@ -137,9 +137,9 @@ extern void __glapi_sparc_icache_flush(unsigned int *); static void init_glapi_relocs( void ) { -#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS) +#if defined(HAVE_PTHREAD) || defined(USE_ELF_TLS) static const unsigned int template[] = { -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS 0x05000000, /* sethi %hi(_glapi_tls_Dispatch), %g2 */ 0x8730e00a, /* srl %g3, 10, %g3 */ 0x8410a000, /* or %g2, %lo(_glapi_tls_Dispatch), %g2 */ @@ -190,7 +190,7 @@ init_glapi_relocs( void ) 0x81e80000, /* --> restore */ #endif }; -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS extern unsigned int __glapi_sparc_tls_stub; extern unsigned long __glapi_sparc_get_dispatch(void); unsigned int *code = &__glapi_sparc_tls_stub; @@ -203,7 +203,7 @@ init_glapi_relocs( void ) int idx; #endif -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS code[0] = template[0] | (dispatch >> 10); code[1] = template[1]; __glapi_sparc_icache_flush(&code[0]); @@ -267,14 +267,14 @@ init_glapi_relocs( void ) _glapi_proc generate_entrypoint(GLuint functionOffset) { -#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS) +#if defined(HAVE_PTHREAD) || defined(USE_ELF_TLS) static const unsigned int template[] = { 0x07000000, /* sethi %hi(0), %g3 */ 0x8210000f, /* mov %o7, %g1 */ 0x40000000, /* call */ 0x9e100001, /* mov %g1, %o7 */ }; -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS extern unsigned int __glapi_sparc_tls_stub; unsigned long call_dest = (unsigned long ) &__glapi_sparc_tls_stub; #else @@ -338,7 +338,7 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset) void init_glapi_relocs_once( void ) { -#if defined(HAVE_PTHREAD) || defined(GLX_USE_TLS) +#if defined(HAVE_PTHREAD) || defined(USE_ELF_TLS) static once_flag flag = ONCE_FLAG_INIT; call_once(&flag, init_glapi_relocs); #endif diff --git a/src/mapi/glapi/glapi_priv.h b/src/mapi/glapi/glapi_priv.h index ddfc594a979..ad37c8bfdf3 100644 --- a/src/mapi/glapi/glapi_priv.h +++ b/src/mapi/glapi/glapi_priv.h @@ -62,7 +62,7 @@ get_entrypoint_address(unsigned int functionOffset); * Size (in bytes) of dispatch function (entrypoint). */ #if defined(USE_X86_ASM) -# if defined(GLX_USE_TLS) +# if defined(USE_ELF_TLS) # define DISPATCH_FUNCTION_SIZE 16 # else # define DISPATCH_FUNCTION_SIZE 32 @@ -70,7 +70,7 @@ get_entrypoint_address(unsigned int functionOffset); #endif #if defined(USE_X64_64_ASM) -# if defined(GLX_USE_TLS) +# if defined(USE_ELF_TLS) # define DISPATCH_FUNCTION_SIZE 16 # endif #endif -- cgit v1.2.3