summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2004-11-22 19:27:40 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2004-11-22 19:27:40 +0000
commitc247c7f66f7d38bb35cedb84b1a2c3655c356ac1 (patch)
tree60cddf59390aee1fea6d0db5cf8184571b9b2d55 /src/mesa/glapi
parent263317d00a4b3c4ee083cd74470c38083038e1ee (diff)
applied SPARC patch (freedesktop bug 1898)
Diffstat (limited to 'src/mesa/glapi')
-rw-r--r--src/mesa/glapi/gl_SPARC_asm.py2
-rw-r--r--src/mesa/glapi/glapi.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/mesa/glapi/gl_SPARC_asm.py b/src/mesa/glapi/gl_SPARC_asm.py
index 4fdb82df640..c4afc4e52a5 100644
--- a/src/mesa/glapi/gl_SPARC_asm.py
+++ b/src/mesa/glapi/gl_SPARC_asm.py
@@ -48,7 +48,7 @@ class PrintGenericStubs(gl_XML.FilterGLAPISpecBase):
print ''
print '#define GLOBL_FN(x) .globl x ; .type x,#function'
print ''
- print '#if defined(__sparc_v9__) && !defined(__linux__)'
+ print '#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))'
print '# define GL_STUB(fn,off)\t\t\t\t\\'
print 'GLOBL_FN(fn) ; fn:\t\t\t\t\t\\'
print '\tsethi\t%hi(0x00000000), %g4 ;\t\t\t\\'
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index 9c488169591..10ec702111c 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -634,7 +634,7 @@ generate_entrypoint(GLuint functionOffset)
return code;
#elif defined(USE_SPARC_ASM)
-#if defined(__sparc_v9__) && !defined(__linux__)
+#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))
static const unsigned int insn_template[] = {
0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */
0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */
@@ -662,7 +662,7 @@ generate_entrypoint(GLuint functionOffset)
if (code) {
memcpy(code, insn_template, sizeof(insn_template));
-#if defined(__sparc_v9__) && !defined(__linux__)
+#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))
code[0] |= (glapi_addr >> (32 + 10));
code[1] |= ((glapi_addr & 0xffffffff) >> 10);
__glapi_sparc_icache_flush(&code[0]);
@@ -705,7 +705,7 @@ fill_in_entrypoint_offset(void *entrypoint, GLuint offset)
/* XXX this hasn't been tested! */
unsigned int *code = (unsigned int *) entrypoint;
-#if defined(__sparc_v9__) && !defined(__linux__)
+#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))
code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */
code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */
code[6] |= ((offset * 8) >> 10);