*** functionality.
***/
-#if !defined( USE_X86_ASM ) && !defined( XFree86Server ) && !defined ( XGLServer )
-#define NEED_FUNCTION_POINTER
+#if defined(USE_X64_64_ASM) && defined(GLX_USE_TLS)
+# define DISPATCH_FUNCTION_SIZE 16
+#elif defined(USE_X86_ASM)
+# if defined(THREADS) && !defined(GLX_USE_TLS)
+# define DISPATCH_FUNCTION_SIZE 32
+# else
+# define DISPATCH_FUNCTION_SIZE 16
+# endif
+#endif
+
+#if !defined(DISPATCH_FUNCTION_SIZE) && !defined(XFree86Server) && !defined(XGLServer)
+# define NEED_FUNCTION_POINTER
#endif
/* The code in this file is auto-generated with Python */
extern const GLubyte gl_dispatch_functions_start[];
#endif
-# if defined(THREADS) && !defined(GLX_USE_TLS)
-# define X86_DISPATCH_FUNCTION_SIZE 32
-# else
-# define X86_DISPATCH_FUNCTION_SIZE 16
-# endif
-
#endif /* USE_X86_ASM */
{
const glprocs_table_t * const f = find_entry( funcName );
if (f) {
-#ifdef USE_X86_ASM
+#ifdef DISPATCH_FUNCTION_SIZE
return (_glapi_proc) (gl_dispatch_functions_start
- + (X86_DISPATCH_FUNCTION_SIZE * f->Offset));
+ + (DISPATCH_FUNCTION_SIZE * f->Offset));
#else
return f->Address;
#endif
* "jmp OFFSET*4(%eax)" can't be encoded in a single byte.
*/
const GLubyte * const template_func = gl_dispatch_functions_start
- + (X86_DISPATCH_FUNCTION_SIZE * 32);
- GLubyte * const code = (GLubyte *) malloc( X86_DISPATCH_FUNCTION_SIZE );
+ + (DISPATCH_FUNCTION_SIZE * 32);
+ GLubyte * const code = (GLubyte *) malloc(DISPATCH_FUNCTION_SIZE);
if ( code != NULL ) {
- (void) memcpy( code, template_func, X86_DISPATCH_FUNCTION_SIZE );
+ (void) memcpy(code, template_func, DISPATCH_FUNCTION_SIZE);
fill_in_entrypoint_offset( (_glapi_proc) code, functionOffset );
}
#if defined(USE_X86_ASM)
GLubyte * const code = (GLubyte *) entrypoint;
-#if X86_DISPATCH_FUNCTION_SIZE == 32
+#if DISPATCH_FUNCTION_SIZE == 32
*((unsigned int *)(code + 11)) = 4 * offset;
*((unsigned int *)(code + 22)) = 4 * offset;
-#elif X86_DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS )
+#elif DISPATCH_FUNCTION_SIZE == 16 && defined( GLX_USE_TLS )
*((unsigned int *)(code + 8)) = 4 * offset;
-#elif X86_DISPATCH_FUNCTION_SIZE == 16
+#elif DISPATCH_FUNCTION_SIZE == 16
*((unsigned int *)(code + 7)) = 4 * offset;
#else
-# error Invalid X86_DISPATCH_FUNCTION_SIZE!
+# error Invalid DISPATCH_FUNCTION_SIZE!
#endif
#elif defined(USE_SPARC_ASM)
while ( curr_func != (GLubyte *) gl_dispatch_functions_end ) {
(void) memcpy( curr_func, get_disp, 6 );
- curr_func += X86_DISPATCH_FUNCTION_SIZE;
+ curr_func += DISPATCH_FUNCTION_SIZE;
}
#endif /* defined( USE_X86_ASM ) && defined( GLX_USE_TLS ) */
}