diff options
author | Zou Nan hai <nanhai.zou@intel.com> | 2007-07-04 10:52:35 +0800 |
---|---|---|
committer | Zou Nan hai <nanhai.zou@intel.com> | 2007-07-04 10:52:35 +0800 |
commit | fb9ee9b323bff93973a39560b2bc007aace4bddd (patch) | |
tree | 05e1e72e8f4d321cde2c48b8518e6d9736c680dd /src/mesa/glapi/glapi.c | |
parent | 285b326c606e9b2f90e4fe177b15b3fa23239b86 (diff) | |
parent | 7ff4359a3be1278b26950f96ab23014a667af838 (diff) |
Merge branch 'master' of git+ssh://znh@git.freedesktop.org/git/mesa/mesa into 965-glsl
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r-- | src/mesa/glapi/glapi.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c index 5815dbff84..47c5782273 100644 --- a/src/mesa/glapi/glapi.c +++ b/src/mesa/glapi/glapi.c @@ -1028,22 +1028,24 @@ _glapi_check_table(const struct _glapi_table *table) #if defined(PTHREADS) || defined(GLX_USE_TLS) /** * Perform platform-specific GL API entry-point fixups. - * - * */ static void init_glapi_relocs( void ) { -#if defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) - extern void * _x86_get_dispatch(void); - const GLubyte * const get_disp = (const GLubyte *) _x86_get_dispatch; +#if defined(USE_X86_ASM) && defined(GLX_USE_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 */ + }; + GLuint *offset = (GLuint *) &run_time_patch[2]; /* 32-bits for x86/32 */ + const GLubyte * const get_disp = (const GLubyte *) run_time_patch; GLubyte * curr_func = (GLubyte *) gl_dispatch_functions_start; - + *offset = _x86_get_dispatch(); while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) { - (void) memcpy( curr_func, get_disp, 6 ); + (void) memcpy( curr_func, get_disp, sizeof(run_time_patch)); curr_func += DISPATCH_FUNCTION_SIZE; } -#endif /* defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) */ -} #endif +} +#endif /* defined(PTHREADS) || defined(GLX_USE_TLS) */ |