--- xc.old/extras/Mesa/src/mesa/glapi/gl_x86_asm.py 2004-12-15 01:51:02.000000000 +0000 +++ xc/extras/Mesa/src/mesa/glapi/gl_x86_asm.py 2005-06-28 03:22:42.000000000 +0100 @@ -87,12 +87,24 @@ class PrintGenericStubs(gl_XML.FilterGLA print '# define THREADS' print '#endif' print '' + print 'GL_PREFIX(get_dispatchbase, get_dispatchbase):' + print '\t/* store eip then the dispatch table base in eax */' + print '\tMOV_L(CONST(_GLOBAL_OFFSET_TABLE_), EDX)' + print '\tMOV_L(REGIND(ESP), EAX)' + print '\tADD_L(REGOFF(-4, EAX), EAX)' + print '#if defined(PTHREADS) || defined(THREADS)' + print '\tMOV_L(REGBID(EAX, EDX, GLNAME(_glapi_DispatchTSD)@GOTOFF), EAX)' + print '#else' + print '\tMOV_L(REGBID(EAX, EDX, GLNAME(_glapi_Dispatch)@GOTOFF), EAX)' + print '#endif' + print '\tRET' + print '' print '#if defined(PTHREADS)' print '# define GL_STUB(fn,off,fn_alt)\t\t\t\\' print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_DispatchTSD)), EAX) ;\t\\' + print '\tCALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ;\t\\' print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' print '\tJE(1f) ;\t\t\t\t\t\\' print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' @@ -103,7 +115,7 @@ class PrintGenericStubs(gl_XML.FilterGLA print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_DispatchTSD)), EAX) ;\t\\' + print '\tCALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ;\t\\' print '\tTEST_L(EAX, EAX) ;\t\t\t\t\\' print '\tJE(1f) ;\t\t\t\t\t\\' print '\tJMP(GL_OFFSET(off)) ;\t\t\t\t\\' @@ -114,7 +126,7 @@ class PrintGenericStubs(gl_XML.FilterGLA print 'ALIGNTEXT16;\t\t\t\t\t\t\\' print 'GLOBL_FN(GL_PREFIX(fn, fn_alt));\t\t\t\\' print 'GL_PREFIX(fn, fn_alt):\t\t\t\t\t\\' - print '\tMOV_L(CONTENT(GLNAME(_glapi_Dispatch)), EAX) ;\t\\' + print '\tCALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ;\t\\' print '\tJMP(GL_OFFSET(off))' print '#endif' print '' --- xc.old/extras/Mesa/src/mesa/x86/glapi_x86.S 2004-12-15 01:51:06.000000000 +0000 +++ xc/extras/Mesa/src/mesa/x86/glapi_x86.S 2005-06-28 03:16:22.000000000 +0100 @@ -57,12 +57,24 @@ # 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 + #if defined(PTHREADS) # define GL_STUB(fn,off,fn_alt) \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_DispatchTSD)), EAX) ; \ + CALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ; \ TEST_L(EAX, EAX) ; \ JE(1f) ; \ JMP(GL_OFFSET(off)) ; \ @@ -73,7 +85,7 @@ GL_PREFIX(fn, fn_alt): \ ALIGNTEXT16; \ GLOBL_FN(GL_PREFIX(fn, fn_alt)); \ GL_PREFIX(fn, fn_alt): \ - MOV_L(CONTENT(GLNAME(_glapi_DispatchTSD)), EAX) ; \ + CALL(GL_PREFIX(get_dispatchbase, get_dispatchbase)) ; \ TEST_L(EAX, EAX) ; \ JE(1f) ; \ JMP(GL_OFFSET(off)) ; \ @@ -84,7 +96,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 --- xc.old/extras/Mesa/src/mesa/x86/mmx_blend.S 2004-06-16 10:19:36.000000000 +0100 +++ xc/extras/Mesa/src/mesa/x86/mmx_blend.S 2005-06-27 21:42:13.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 ) ;\ --- xc.old/extras/Mesa/src/mesa/x86/mmx_blendtmp.h 2004-06-16 10:19:36.000000000 +0100 +++ xc/extras/Mesa/src/mesa/x86/mmx_blendtmp.h 2005-06-27 18:05:21.000000000 +0100 @@ -14,6 +14,11 @@ ALIGNTEXT16 GLOBL GLNAME( TAG(_mesa_mmx_blend) ) +LLBL( TAG(mesa_mmx_blend_get_eip) ): + /* store eip in edx */ + MOV_L ( REGIND(ESP), EDX ) + RET + GLNAME( TAG(_mesa_mmx_blend) ): PUSH_L ( EBP ) @@ -30,6 +35,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 */