diff -urp Mesa-6.4-old/src/mesa/x86/glapi_x86.S Mesa-6.4/src/mesa/x86/glapi_x86.S --- Mesa-6.4-old/src/mesa/x86/glapi_x86.S 2005-10-21 00:52:17.000000000 +0200 +++ Mesa-6.4/src/mesa/x86/glapi_x86.S 2005-11-30 11:22:31.000000000 +0100 @@ -67,6 +67,18 @@ # define THREADS #endif +GL_PREFIX(get_dispatchbase, get_dispatchbase): + /* store eip then the dispatch table base in eax */ + MOV_L(CONST(_GLOBAL_OFFSET_TABLE_), EDX) + MOV_L(REGIND(ESP), EAX) + ADD_L(REGOFF(-4, EAX), EAX) +#if defined(PTHREADS) || defined(THREADS) + MOV_L(REGBID(EAX, EDX, GLNAME(_glapi_DispatchTSD)@GOTOFF), EAX) +#else + MOV_L(REGBID(EAX, EDX, GLNAME(_glapi_Dispatch)@GOTOFF), EAX) +#endif + RET + #ifdef GLX_USE_TLS # define GL_STUB(fn,off,fn_alt) \ @@ -82,7 +94,7 @@ GL_PREFIX(fn, fn_alt): \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \ + CALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ;\ TEST_L(EAX, EAX) ; \ JE(1f) ; \ JMP(GL_OFFSET(off)) ; \ @@ -93,7 +105,7 @@ GL_PREFIX(fn, fn_alt): \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \ + CALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ;\ TEST_L(EAX, EAX) ; \ JE(1f) ; \ JMP(GL_OFFSET(off)) ; \ @@ -104,7 +116,7 @@ GL_PREFIX(fn, fn_alt): \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ; \ + CALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ;\ JMP(GL_OFFSET(off)) #endif diff -urp Mesa-6.4-old/src/mesa/x86/mmx_blend.S Mesa-6.4/src/mesa/x86/mmx_blend.S --- Mesa-6.4-old/src/mesa/x86/mmx_blend.S 2004-04-26 12:10:25.000000000 +0200 +++ Mesa-6.4/src/mesa/x86/mmx_blend.S 2005-11-30 11:17:29.000000000 +0100 @@ -303,7 +303,7 @@ TWO(MOVQ ( MM1, REGIND(rgba) )) #define LLTAG(x) LLBL2(x,_min) #define INIT \ - MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ + MOVQ ( CONTENT(REGOFF(const_80@GOTOFF, EDX)), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ #define MAIN( rgba, dest ) \ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ @@ -327,7 +327,7 @@ TWO(MOVQ ( MM1, REGIND(rgba) )) #define LLTAG(x) LLBL2(x,_max) #define INIT \ - MOVQ ( CONTENT(const_80), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ + MOVQ ( CONTENT(REGOFF(const_80@GOTOFF, EDX)), MM7 ) /* 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80| 0x80*/ #define MAIN( rgba, dest ) \ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ @@ -352,7 +352,7 @@ TWO(MOVQ ( MM1, REGIND(rgba) )) #define INIT \ PXOR ( MM0, MM0 ) /* 0x0000 | 0x0000 | 0x0000 | 0x0000 */ ;\ - MOVQ ( CONTENT(const_0080), MM7 ) /* 0x0080 | 0x0080 | 0x0080 | 0x0080 */ + MOVQ ( CONTENT(REGOFF(const_0080@GOTOFF, EDX)), MM7 ) /* 0x0080 | 0x0080 | 0x0080 | 0x0080 */ #define MAIN( rgba, dest ) \ GMB_LOAD( rgba, dest, MM1, MM2 ) ;\ diff -urp Mesa-6.4-old/src/mesa/x86/mmx_blendtmp.h Mesa-6.4/src/mesa/x86/mmx_blendtmp.h --- Mesa-6.4-old/src/mesa/x86/mmx_blendtmp.h 2005-01-04 15:33:47.000000000 +0100 +++ Mesa-6.4/src/mesa/x86/mmx_blendtmp.h 2005-11-30 11:13:27.000000000 +0100 @@ -12,6 +12,12 @@ * */ ALIGNTEXT16 + +LLBL( TAG(mesa_mmx_blend_get_eip) ): + /* store eip in edx */ + MOV_L ( REGIND(ESP), EDX ) + RET + GLOBL GLNAME( TAG(_mesa_mmx_blend) ) HIDDEN( TAG(_mesa_mmx_blend) ) GLNAME( TAG(_mesa_mmx_blend) ): @@ -30,6 +36,9 @@ GLNAME( TAG(_mesa_mmx_blend) ): MOV_L ( REGOFF(20, EBP), EDI ) /* rgba */ MOV_L ( REGOFF(24, EBP), ESI ) /* dest */ + CALL ( LLBL( TAG(mesa_mmx_blend_get_eip) ) ) + ADD_L ( CONST(_GLOBAL_OFFSET_TABLE_), EDX ) + INIT TEST_L ( CONST(4), EDI ) /* align rgba on an 8-byte boundary */