X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmapi%2Fu_current.h;h=9a79f0bf93acec2cd985fac262cfe7a24f5c0471;hb=a2065917cc8f95f76c2926d8d7cb4bf3c9ff7de1;hp=252e696c571e49fb83fc4b01fe542ce1adc24f7c;hpb=41c87cc5666de7ec5cfdea2c035c671048c06ca5;p=mesa.git diff --git a/src/mapi/u_current.h b/src/mapi/u_current.h index 252e696c571..9a79f0bf93a 100644 --- a/src/mapi/u_current.h +++ b/src/mapi/u_current.h @@ -1,15 +1,16 @@ #ifndef _U_CURRENT_H_ #define _U_CURRENT_H_ +#include "c99_compat.h" +#include "util/macros.h" + + #if defined(MAPI_MODE_UTIL) || defined(MAPI_MODE_GLAPI) || \ defined(MAPI_MODE_BRIDGE) #include "glapi/glapi.h" -/* ugly renames to match glapi.h */ -#define mapi_table _glapi_table - -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS #define u_current_table _glapi_tls_Dispatch #define u_current_context _glapi_tls_Context #else @@ -24,24 +25,22 @@ #else /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */ -#include "u_compiler.h" - -struct mapi_table; +struct _glapi_table; -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS -extern __thread struct mapi_table *u_current_table +extern __thread struct _glapi_table *u_current_table __attribute__((tls_model("initial-exec"))); extern __thread void *u_current_context __attribute__((tls_model("initial-exec"))); -#else /* GLX_USE_TLS */ +#else /* USE_ELF_TLS */ -extern struct mapi_table *u_current_table; +extern struct _glapi_table *u_current_table; extern void *u_current_context; -#endif /* GLX_USE_TLS */ +#endif /* USE_ELF_TLS */ #endif /* MAPI_MODE_UTIL || MAPI_MODE_GLAPI || MAPI_MODE_BRIDGE */ @@ -52,9 +51,9 @@ void u_current_destroy(void); void -u_current_set_table(const struct mapi_table *tbl); +u_current_set_table(const struct _glapi_table *tbl); -struct mapi_table * +struct _glapi_table * u_current_get_table_internal(void); void @@ -63,10 +62,10 @@ u_current_set_context(const void *ptr); void * u_current_get_context_internal(void); -static inline const struct mapi_table * +static inline const struct _glapi_table * u_current_get_table(void) { -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS return u_current_table; #else return (likely(u_current_table) ? @@ -77,7 +76,7 @@ u_current_get_table(void) static inline const void * u_current_get_context(void) { -#ifdef GLX_USE_TLS +#ifdef USE_ELF_TLS return u_current_context; #else return likely(u_current_context) ? u_current_context : u_current_get_context_internal();