summaryrefslogtreecommitdiff
path: root/src/mesa/x86/glapi_x86.S
diff options
context:
space:
mode:
authormichal <michal@michal-laptop.(none)>2007-07-06 17:53:44 +0200
committermichal <michal@michal-laptop.(none)>2007-07-06 17:53:44 +0200
commit3b8bc1f46758d4da9155419fcf558a493e729501 (patch)
tree0dbfb4ae1ed6b49caaed3e662b27db30fe2e8801 /src/mesa/x86/glapi_x86.S
parentffe58739da9eee2e99682747cc8f26e412c87430 (diff)
parentffa2659204121f703208782ff225a22e0c21b173 (diff)
Merge branch 'master' of git+ssh://michal@git.freedesktop.org/git/mesa/mesa into softpipe_0_1_branch
Diffstat (limited to 'src/mesa/x86/glapi_x86.S')
-rw-r--r--src/mesa/x86/glapi_x86.S33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/mesa/x86/glapi_x86.S b/src/mesa/x86/glapi_x86.S
index 1106eeede8..1d04779d14 100644
--- a/src/mesa/x86/glapi_x86.S
+++ b/src/mesa/x86/glapi_x86.S
@@ -58,12 +58,18 @@
#ifdef GLX_USE_TLS
+#ifdef GLX_X86_READONLY_TEXT
+# define CTX_INSNS MOV_L(GS:(EAX), EAX)
+#else
+# define CTX_INSNS NOP /* Pad for init_glapi_relocs() */
+#endif
+
# define GL_STUB(fn,off,fn_alt) \
ALIGNTEXT16; \
GLOBL_FN(GL_PREFIX(fn, fn_alt)); \
GL_PREFIX(fn, fn_alt): \
CALL(_x86_get_dispatch) ; \
- NOP ; \
+ CTX_INSNS ; \
JMP(GL_OFFSET(off))
#elif defined(PTHREADS)
@@ -114,7 +120,10 @@ SEG_TEXT
HIDDEN(GLNAME(_x86_get_dispatch))
ALIGNTEXT16
GLNAME(_x86_get_dispatch):
- movl %gs:_glapi_tls_Dispatch@NTPOFF, %eax
+ call 1f
+1: popl %eax
+ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax
+ movl _glapi_tls_Dispatch@GOTNTPOFF(%eax), %eax
ret
#elif defined(PTHREADS)
@@ -133,7 +142,7 @@ GLNAME(_x86_get_dispatch):
EXTERN GLNAME(_glapi_get_dispatch)
#endif
-#if defined( GLX_USE_TLS )
+#if defined( GLX_USE_TLS ) && !defined( GLX_X86_READONLY_TEXT )
.section wtext, "awx", @progbits
#endif /* defined( GLX_USE_TLS ) */
@@ -938,14 +947,15 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB(RenderbufferStorageEXT, _gloffset_RenderbufferStorageEXT, RenderbufferStorageEXT@16)
GL_STUB(_dispatch_stub_767, _gloffset_BlitFramebufferEXT, _dispatch_stub_767@40)
HIDDEN(GL_PREFIX(_dispatch_stub_767, _dispatch_stub_767@40))
- GL_STUB(_dispatch_stub_768, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_768@16)
- HIDDEN(GL_PREFIX(_dispatch_stub_768, _dispatch_stub_768@16))
- GL_STUB(_dispatch_stub_769, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_769@16)
+ GL_STUB(FramebufferTextureLayerEXT, _gloffset_FramebufferTextureLayerEXT, FramebufferTextureLayerEXT@20)
+ GL_STUB(_dispatch_stub_769, _gloffset_ProgramEnvParameters4fvEXT, _dispatch_stub_769@16)
HIDDEN(GL_PREFIX(_dispatch_stub_769, _dispatch_stub_769@16))
- GL_STUB(_dispatch_stub_770, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_770@12)
- HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@12))
- GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_771@12)
+ GL_STUB(_dispatch_stub_770, _gloffset_ProgramLocalParameters4fvEXT, _dispatch_stub_770@16)
+ HIDDEN(GL_PREFIX(_dispatch_stub_770, _dispatch_stub_770@16))
+ GL_STUB(_dispatch_stub_771, _gloffset_GetQueryObjecti64vEXT, _dispatch_stub_771@12)
HIDDEN(GL_PREFIX(_dispatch_stub_771, _dispatch_stub_771@12))
+ GL_STUB(_dispatch_stub_772, _gloffset_GetQueryObjectui64vEXT, _dispatch_stub_772@12)
+ HIDDEN(GL_PREFIX(_dispatch_stub_772, _dispatch_stub_772@12))
GL_STUB_ALIAS(ArrayElementEXT, _gloffset_ArrayElement, ArrayElementEXT@4, ArrayElement, ArrayElement@4)
GL_STUB_ALIAS(BindTextureEXT, _gloffset_BindTexture, BindTextureEXT@8, BindTexture, BindTexture@8)
GL_STUB_ALIAS(DrawArraysEXT, _gloffset_DrawArrays, DrawArraysEXT@12, DrawArrays, DrawArrays@12)
@@ -1119,12 +1129,17 @@ GLNAME(gl_dispatch_functions_start):
GL_STUB_ALIAS(VertexAttrib4Nubv, _gloffset_VertexAttrib4NubvARB, VertexAttrib4Nubv@8, VertexAttrib4NubvARB, VertexAttrib4NubvARB@8)
GL_STUB_ALIAS(VertexAttrib4Nuiv, _gloffset_VertexAttrib4NuivARB, VertexAttrib4Nuiv@8, VertexAttrib4NuivARB, VertexAttrib4NuivARB@8)
GL_STUB_ALIAS(VertexAttrib4Nusv, _gloffset_VertexAttrib4NusvARB, VertexAttrib4Nusv@8, VertexAttrib4NusvARB, VertexAttrib4NusvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4bv, _gloffset_VertexAttrib4bvARB, VertexAttrib4bv@8, VertexAttrib4bvARB, VertexAttrib4bvARB@8)
GL_STUB_ALIAS(VertexAttrib4d, _gloffset_VertexAttrib4dARB, VertexAttrib4d@36, VertexAttrib4dARB, VertexAttrib4dARB@36)
GL_STUB_ALIAS(VertexAttrib4dv, _gloffset_VertexAttrib4dvARB, VertexAttrib4dv@8, VertexAttrib4dvARB, VertexAttrib4dvARB@8)
GL_STUB_ALIAS(VertexAttrib4f, _gloffset_VertexAttrib4fARB, VertexAttrib4f@20, VertexAttrib4fARB, VertexAttrib4fARB@20)
GL_STUB_ALIAS(VertexAttrib4fv, _gloffset_VertexAttrib4fvARB, VertexAttrib4fv@8, VertexAttrib4fvARB, VertexAttrib4fvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4iv, _gloffset_VertexAttrib4ivARB, VertexAttrib4iv@8, VertexAttrib4ivARB, VertexAttrib4ivARB@8)
GL_STUB_ALIAS(VertexAttrib4s, _gloffset_VertexAttrib4sARB, VertexAttrib4s@20, VertexAttrib4sARB, VertexAttrib4sARB@20)
GL_STUB_ALIAS(VertexAttrib4sv, _gloffset_VertexAttrib4svARB, VertexAttrib4sv@8, VertexAttrib4svARB, VertexAttrib4svARB@8)
+ GL_STUB_ALIAS(VertexAttrib4ubv, _gloffset_VertexAttrib4ubvARB, VertexAttrib4ubv@8, VertexAttrib4ubvARB, VertexAttrib4ubvARB@8)
+ GL_STUB_ALIAS(VertexAttrib4uiv, _gloffset_VertexAttrib4uivARB, VertexAttrib4uiv@8, VertexAttrib4uivARB, VertexAttrib4uivARB@8)
+ GL_STUB_ALIAS(VertexAttrib4usv, _gloffset_VertexAttrib4usvARB, VertexAttrib4usv@8, VertexAttrib4usvARB, VertexAttrib4usvARB@8)
GL_STUB_ALIAS(VertexAttribPointer, _gloffset_VertexAttribPointerARB, VertexAttribPointer@24, VertexAttribPointerARB, VertexAttribPointerARB@24)
GL_STUB_ALIAS(BindBuffer, _gloffset_BindBufferARB, BindBuffer@8, BindBufferARB, BindBufferARB@8)
GL_STUB_ALIAS(BufferData, _gloffset_BufferDataARB, BufferData@16, BufferDataARB, BufferDataARB@16)