diff options
Diffstat (limited to 'src/mesa/x86')
-rw-r--r-- | src/mesa/x86/common_x86.c | 9 | ||||
-rw-r--r-- | src/mesa/x86/glapi_x86.S | 14 |
2 files changed, 13 insertions, 10 deletions
diff --git a/src/mesa/x86/common_x86.c b/src/mesa/x86/common_x86.c index 889b40a89f..0b2af0a370 100644 --- a/src/mesa/x86/common_x86.c +++ b/src/mesa/x86/common_x86.c @@ -104,12 +104,7 @@ static LONG WINAPI ExceptionFilter(LPEXCEPTION_POINTERS exp) static void check_os_sse_support( void ) { -#if defined(__linux__) -#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,0) - _mesa_debug(NULL, "Cannot safely enable SSE on pre-2.4 kernels.\n"); - _mesa_x86_cpu_features &= ~(X86_FEATURE_XMM); -#endif -#elif defined(__FreeBSD__) +#if defined(__FreeBSD__) { int ret, enabled; unsigned int len; @@ -160,7 +155,7 @@ static void check_os_sse_support( void ) /* Do nothing on other platforms for now. */ _mesa_debug(NULL, "Not testing OS support for SSE, leaving enabled.\n"); -#endif /* __linux__ */ +#endif /* __FreeBSD__ */ } #endif /* USE_SSE_ASM */ diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S index bdf42ac088..74e93721bc 100644 --- a/src/mesa/x86/glapi_x86.S +++ b/src/mesa/x86/glapi_x86.S @@ -58,12 +58,17 @@ #ifdef GLX_USE_TLS +#ifdef GLX_X86_READONLY_TEXT +# define CTX_INSNS MOV_L(GS:(EAX), EAX) +#else +# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */ +#endif # define GL_STUB(fn,off,fn_alt) \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ CALL(_x86_get_dispatch) ; \ - NOP ; \ + CTX_INSNS ; \ JMP(GL_OFFSET(off)) #elif defined(PTHREADS) @@ -114,7 +119,10 @@ SEG_TEXT HIDDEN(GLNAME(_x86_get_dispatch)) ALIGNTEXT16 GLNAME(_x86_get_dispatch): - movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax + call 1f +1: popl %eax + addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax + movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax ret #elif defined(PTHREADS) @@ -133,7 +141,7 @@ GLNAME(_x86_get_dispatch): EXTERN GLNAME(_glapi_get_dispatch) #endif -#if defined( GLX_USE_TLS ) +#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT ) .section wtext, "awx", @progbits #endif /* defined( GLX_USE_TLS ) */ |