1 #ifndef _U_CURRENT_H_ 2 #define _U_CURRENT_H_ 3 4 #include "c99_compat.h" 5 #include "util/macros.h" 6 7 8 #if defined(MAPI_MODE_UTIL) || defined(MAPI_MODE_GLAPI) || \ 9 defined(MAPI_MODE_BRIDGE) 10 11 #include "glapi/glapi.h" 12 13 #ifdef USE_ELF_TLS 14 #define u_current_table _glapi_tls_Dispatch 15 #define u_current_context _glapi_tls_Context 16 #else 17 #define u_current_table _glapi_Dispatch 18 #define u_current_context _glapi_Context 19 #endif 20 21 #define u_current_get_table_internal _glapi_get_dispatch 22 #define u_current_get_context_internal _glapi_get_context 23 24 #define u_current_table_tsd _gl_DispatchTSD 25 26 #else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */ 27 28 struct _glapi_table; 29 30 #ifdef USE_ELF_TLS 31 32 extern __THREAD_INITIAL_EXEC struct _glapi_table *u_current_table; 33 extern __THREAD_INITIAL_EXEC void *u_current_context; 34 35 #else /* USE_ELF_TLS */ 36 37 extern struct _glapi_table *u_current_table; 38 extern void *u_current_context; 39 40 #endif /* USE_ELF_TLS */ 41 42 #endif /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */ 43 44 void 45 u_current_init(void); 46 47 void 48 u_current_destroy(void); 49 50 void 51 u_current_set_table(const struct _glapi_table *tbl); 52 53 _GLAPI_EXPORT struct _glapi_table * 54 u_current_get_table_internal(void); 55 56 void 57 u_current_set_context(const void *ptr); 58 59 _GLAPI_EXPORT void * 60 u_current_get_context_internal(void); 61 62 #endif /* _U_CURRENT_H_ */ 63