From 8e77da1cd7d63af5e7ffcf7ea220cdaf1bdc8162 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 29 Jun 2004 19:08:20 +0000 Subject: First phase of TLS work. At this point SPARC assembly dispatch is broken, but it will be fixed "shortly." This is pretty much the same as the patch I sent to the dri-devel list on 22-Jun-2004. --- src/mesa/glapi/glthread.h | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) (limited to 'src/mesa/glapi/glthread.h') diff --git a/src/mesa/glapi/glthread.h b/src/mesa/glapi/glthread.h index 4391ed4f9a..283d549df0 100644 --- a/src/mesa/glapi/glthread.h +++ b/src/mesa/glapi/glthread.h @@ -109,6 +109,20 @@ typedef pthread_mutex_t _glthread_Mutex; #define _glthread_UNLOCK_MUTEX(name) \ (void) pthread_mutex_unlock(&(name)) +/* This is temporarilly removed because driver binaries cannot count on + * the existance of _gl_DispatchTSD in libGL. It only exists in "new" + * libGL. We may be able to ressurect this optimization at some point + * for DRI driver or for software Mesa. + */ +#if 0 +extern struct _glapi_table * _glapi_DispatchTSD; +extern _glthread_TSD _gl_DispatchTSD; + +#define GL_CALL(name) \ + (((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \ + ? _glapi_DispatchTSD : (struct _glapi_table *) pthread_getspecific(_gl_DispatchTSD.key))-> name) +#endif + #endif /* PTHREADS */ @@ -291,8 +305,15 @@ extern void _glthread_SetTSD(_glthread_TSD *, void *); #ifndef GL_CALL -# define GL_CALL(name) (*(_glapi_Dispatch-> name)) -#endif +# if defined(THREADS) +extern struct _glapi_table * _glapi_DispatchTSD; +# define GL_CALL(name) \ + (((__builtin_expect( _glapi_DispatchTSD != NULL, 1 )) \ + ? _glapi_DispatchTSD : _glapi_get_dispatch())-> name) +# else +# define GL_CALL(name) (*(_glapi_Dispatch-> name)) +# endif /* defined(THREADS) */ +#endif /* ndef GL_CALL */ #endif /* THREADS_H */ -- cgit v1.2.3