summaryrefslogtreecommitdiffstats
path: root/src/mesa/glapi/glapi.c
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2005-07-28 00:11:10 +0000
committerIan Romanick <[email protected]>2005-07-28 00:11:10 +0000
commit9f23a3a1bff6c8af93e651273c9887bbf119f555 (patch)
tree0bdc6e08b24ee9f855aa7132944d5a26e1edf37c /src/mesa/glapi/glapi.c
parent3e36986e5a59c734b7bd198a16fb9af3314860de (diff)
Fix SPARC assembly for 64-bit
- The test for whether or not we're building for 64-bit is '#ifdef __arch64__'. This appears to be correct on both Linux and Solaris. - The test for Solaris is now '#if defined(SVR4) || defined(__SVR4) || defined(__svr4__)'. GCC 3.4.0 has all three defined on Solaris 9. - Enables assembly language clip routines. - Fixes to make GLSL code build on Solaris. - Update gl_SPARC_asm.py.
Diffstat (limited to 'src/mesa/glapi/glapi.c')
-rw-r--r--src/mesa/glapi/glapi.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index ff0199b833f..5132bebaef5 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -711,7 +711,7 @@ generate_entrypoint(GLuint functionOffset)
return (_glapi_proc) code;
#elif defined(USE_SPARC_ASM)
-#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))
+#ifdef __arch64__
static const unsigned int insn_template[] = {
0x05000000, /* sethi %uhi(_glapi_Dispatch), %g2 */
0x03000000, /* sethi %hi(_glapi_Dispatch), %g1 */
@@ -739,7 +739,7 @@ generate_entrypoint(GLuint functionOffset)
if (code) {
memcpy(code, insn_template, sizeof(insn_template));
-#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))
+#ifdef __arch64__
code[0] |= (glapi_addr >> (32 + 10));
code[1] |= ((glapi_addr & 0xffffffff) >> 10);
__glapi_sparc_icache_flush(&code[0]);
@@ -791,17 +791,17 @@ fill_in_entrypoint_offset(_glapi_proc entrypoint, GLuint offset)
/* XXX this hasn't been tested! */
unsigned int *code = (unsigned int *) entrypoint;
-#if (defined(__sparc_v9__) && (!defined(__linux__) || defined(__linux_sparc_64__)))
+#ifdef __arch64__
code[6] = 0x05000000; /* sethi %hi(8 * glapioffset), %g2 */
code[7] = 0x8410a000; /* or %g2, %lo(8 * glapioffset), %g2 */
code[6] |= ((offset * 8) >> 10);
code[7] |= ((offset * 8) & ((1 << 10) - 1));
__glapi_sparc_icache_flush(&code[6]);
-#else /* __sparc_v9__ && !linux */
+#else /* __arch64__ */
code[2] = 0xc6006000; /* ld [%g1 + %lo(4*glapioffset)], %g3 */
code[2] |= (offset * 4);
__glapi_sparc_icache_flush(&code[2]);
-#endif /* __sparc_v9__ && !linux */
+#endif /* __arch64__ */
#else