summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavem69 <davem69>2001-06-06 22:55:28 +0000
committerdavem69 <davem69>2001-06-06 22:55:28 +0000
commit4a497e649b33f8b73696bbef0e6da221491460fe (patch)
tree1dfdc9c0e501544fc549ff77f3da6877abe79004
parenta5455bb374571833080fcbd6728edcba13d45b38 (diff)
Remove dependency on MESA sources from gl* files
in SPARC glapi optimizations by moving the icache flush into the glapi_sparc.S file. Brian, how is this?
-rw-r--r--src/mesa/glapi/glapi.c20
-rw-r--r--src/mesa/glapi/glsparcasm.py13
-rw-r--r--src/mesa/sparc/glapi_sparc.S11
-rw-r--r--src/mesa/sparc/sparc.c9
-rw-r--r--src/mesa/sparc/sparc.h3
5 files changed, 38 insertions, 18 deletions
diff --git a/src/mesa/glapi/glapi.c b/src/mesa/glapi/glapi.c
index e9887551f9..de314de25a 100644
--- a/src/mesa/glapi/glapi.c
+++ b/src/mesa/glapi/glapi.c
@@ -1,4 +1,4 @@
-/* $Id: glapi.c,v 1.55 2001/06/05 23:54:00 davem69 Exp $ */
+/* $Id: glapi.c,v 1.56 2001/06/06 22:55:28 davem69 Exp $ */
/*
* Mesa 3-D graphics library
@@ -52,10 +52,6 @@
#include "glapitable.h"
#include "glthread.h"
-#ifdef USE_SPARC_ASM
-#include "SPARC/sparc.h"
-#endif
-
/***** BEGIN NO-OP DISPATCH *****/
static GLboolean WarnFlag = GL_FALSE;
@@ -1709,7 +1705,9 @@ get_static_proc_address(const char *funcName)
static struct name_address_offset ExtEntryTable[MAX_EXTENSION_FUNCS];
static GLuint NumExtEntryPoints = 0;
-
+#ifdef USE_SPARC_ASM
+extern void __glapi_sparc_icache_flush(unsigned int *);
+#endif
/*
* Generate a dispatch function (entrypoint) which jumps through
@@ -1789,19 +1787,19 @@ generate_entrypoint(GLuint functionOffset)
#ifdef __sparc_v9__
code[0] |= (glapi_addr >> (32 + 10));
code[1] |= ((glapi_addr & 0xffffffff) >> 10);
- _mesa_sparc_icache_flush(&code[0]);
+ __glapi_sparc_icache_flush(&code[0]);
code[2] |= ((glapi_addr >> 32) & ((1 << 10) - 1));
code[3] |= (glapi_addr & ((1 << 10) - 1));
- _mesa_sparc_icache_flush(&code[2]);
+ __glapi_sparc_icache_flush(&code[2]);
code[6] |= ((functionOffset * 8) >> 10);
code[7] |= ((functionOffset * 8) & ((1 << 10) - 1));
- _mesa_sparc_icache_flush(&code[6]);
+ __glapi_sparc_icache_flush(&code[6]);
#else
code[0] |= (glapi_addr >> 10);
code[1] |= (glapi_addr & ((1 << 10) - 1));
- _mesa_sparc_icache_flush(&code[0]);
+ __glapi_sparc_icache_flush(&code[0]);
code[2] |= (functionOffset * 4);
- _mesa_sparc_icache_flush(&code[2]);
+ __glapi_sparc_icache_flush(&code[2]);
#endif
}
return code;
diff --git a/src/mesa/glapi/glsparcasm.py b/src/mesa/glapi/glsparcasm.py
index b1cdf9e021..d55d64b552 100644
--- a/src/mesa/glapi/glsparcasm.py
+++ b/src/mesa/glapi/glsparcasm.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# $Id: glsparcasm.py,v 1.2 2001/06/05 23:54:00 davem69 Exp $
+# $Id: glsparcasm.py,v 1.3 2001/06/06 22:55:28 davem69 Exp $
# Mesa 3-D graphics library
# Version: 3.5
@@ -51,10 +51,20 @@ def PrintHead():
print ' * sethi/or instruction sequences below at library init time.'
print ' */'
print ''
+ print ''
+ print '.text'
+ print '.align 32'
+ print '.globl __glapi_sparc_icache_flush'
+ print '__glapi_sparc_icache_flush: /* %o0 = insn_addr */'
+ print '\tflush\t%o0'
+ print '\tretl'
+ print '\t nop'
+ print ''
print '.data'
print '.align 64'
print ''
print '.globl _mesa_sparc_glapi_begin'
+ print '.type _mesa_sparc_glapi_begin,@function'
print '_mesa_sparc_glapi_begin:'
print ''
return
@@ -64,6 +74,7 @@ def PrintTail():
print '\t nop'
print ''
print '.globl _mesa_sparc_glapi_end'
+ print '.type _mesa_sparc_glapi_end,@function'
print '_mesa_sparc_glapi_end:'
print ''
#endif
diff --git a/src/mesa/sparc/glapi_sparc.S b/src/mesa/sparc/glapi_sparc.S
index 19ddfe315e..781127bf27 100644
--- a/src/mesa/sparc/glapi_sparc.S
+++ b/src/mesa/sparc/glapi_sparc.S
@@ -8,10 +8,20 @@
* sethi/or instruction sequences below at library init time.
*/
+
+.text
+.align 32
+.globl __glapi_sparc_icache_flush
+__glapi_sparc_icache_flush: /* %o0 = insn_addr */
+ flush %o0
+ retl
+ nop
+
.data
.align 64
.globl _mesa_sparc_glapi_begin
+.type _mesa_sparc_glapi_begin,@function
_mesa_sparc_glapi_begin:
GLOBL_FN(GL_PREFIX(NewList))
@@ -11758,5 +11768,6 @@ GL_PREFIX(SamplePatternSGIS):
nop
.globl _mesa_sparc_glapi_end
+.type _mesa_sparc_glapi_end,@function
_mesa_sparc_glapi_end:
diff --git a/src/mesa/sparc/sparc.c b/src/mesa/sparc/sparc.c
index 45e2cecac1..69e4463c2a 100644
--- a/src/mesa/sparc/sparc.c
+++ b/src/mesa/sparc/sparc.c
@@ -1,4 +1,4 @@
-/* $Id: sparc.c,v 1.4 2001/06/06 11:46:04 davem69 Exp $ */
+/* $Id: sparc.c,v 1.5 2001/06/06 22:55:28 davem69 Exp $ */
/*
* Mesa 3-D graphics library
@@ -143,6 +143,7 @@ void _mesa_init_all_sparc_transform_asm(void)
extern unsigned int _mesa_sparc_glapi_begin;
extern unsigned int _mesa_sparc_glapi_end;
+extern void __glapi_sparc_icache_flush(unsigned int *);
void _mesa_init_sparc_glapi_relocs(void)
{
@@ -157,15 +158,15 @@ void _mesa_init_sparc_glapi_relocs(void)
#ifdef __sparc_v9__
insn_ptr[0] |= (disp_addr >> (32 + 10));
insn_ptr[1] |= ((disp_addr & 0xffffffff) >> 10);
- _mesa_sparc_icache_flush(&insn_ptr[0]);
+ __glapi_sparc_icache_flush(&insn_ptr[0]);
insn_ptr[2] |= ((disp_addr >> 32) & ((1 << 10) - 1));
insn_ptr[3] |= (disp_addr & ((1 << 10) - 1));
- _mesa_sparc_icache_flush(&insn_ptr[2]);
+ __glapi_sparc_icache_flush(&insn_ptr[2]);
insn_ptr += 10;
#else
insn_ptr[0] |= (disp_addr >> 10);
insn_ptr[1] |= (disp_addr & ((1 << 10) - 1));
- _mesa_sparc_icache_flush(&insn_ptr[0]);
+ __glapi_sparc_icache_flush(&insn_ptr[0]);
insn_ptr += 4;
#endif
}
diff --git a/src/mesa/sparc/sparc.h b/src/mesa/sparc/sparc.h
index 432e6d11ba..55ab12122d 100644
--- a/src/mesa/sparc/sparc.h
+++ b/src/mesa/sparc/sparc.h
@@ -1,4 +1,4 @@
-/* $Id: sparc.h,v 1.2 2001/06/05 23:54:01 davem69 Exp $ */
+/* $Id: sparc.h,v 1.3 2001/06/06 22:55:28 davem69 Exp $ */
/*
* Mesa 3-D graphics library
@@ -34,6 +34,5 @@
extern void _mesa_init_all_sparc_transform_asm(void);
extern void _mesa_init_sparc_glapi_relocs(void);
-extern void _mesa_sparc_icache_flush(unsigned int *);
#endif /* !(SPARC_H) */