Mesa (master): mapi: u_current_table may be renamed.

Chia-I Wu olv at kemper.freedesktop.org
Thu Jan 20 09:16:39 UTC 2011


Module: Mesa
Branch: master
Commit: 96c52d16c1716b8974b5421342f53f36cb80c10f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=96c52d16c1716b8974b5421342f53f36cb80c10f

Author: Chia-I Wu <olv at lunarg.com>
Date:   Tue Aug 24 15:51:57 2010 +0800

mapi: u_current_table may be renamed.

When MAPI_MODE_GLAPI is defined, u_current_table is renamed to
_glapi_Dispatch or _glapi_tls_Dispatch.  The ASM dispatchers should not
use hardcoded name.

---

 src/mapi/mapi/entry.c            |    6 +++++-
 src/mapi/mapi/entry_x86-64_tls.h |    4 ++--
 src/mapi/mapi/entry_x86_tls.h    |    2 +-
 src/mapi/mapi/entry_x86_tsd.h    |    2 +-
 4 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/src/mapi/mapi/entry.c b/src/mapi/mapi/entry.c
index 69b6134..faeda83 100644
--- a/src/mapi/mapi/entry.c
+++ b/src/mapi/mapi/entry.c
@@ -27,6 +27,11 @@
  */
 
 #include "entry.h"
+#include "u_current.h"
+#include "u_macros.h"
+
+/* define macros for use by assembly dispatchers */
+#define ENTRY_CURRENT_TABLE U_STRINGIFY(u_current_table)
 
 #if defined(USE_X86_ASM) && defined(__GNUC__)
 #   ifdef GLX_USE_TLS
@@ -39,7 +44,6 @@
 #else
 
 #include <stdlib.h>
-#include "u_current.h"
 
 /* C version of the public entries */
 #define MAPI_TMP_DEFINES
diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h
index d14bf1c..21ba434 100644
--- a/src/mapi/mapi/entry_x86-64_tls.h
+++ b/src/mapi/mapi/entry_x86-64_tls.h
@@ -46,7 +46,7 @@ __asm__(".section .note.ABI-tag, \"a\"\n\t"
 __asm__(".text");
 
 __asm__("x86_64_current_tls:\n\t"
-	"movq u_current_table at GOTTPOFF(%rip), %rax\n\t"
+	"movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t"
 	"ret");
 
 __asm__(".balign 32\n"
@@ -59,7 +59,7 @@ __asm__(".balign 32\n"
    func ":"
 
 #define STUB_ASM_CODE(slot)                              \
-   "movq u_current_table at GOTTPOFF(%rip), %rax\n\t"   \
+   "movq " ENTRY_CURRENT_TABLE "@GOTTPOFF(%rip), %rax\n\t"  \
    "movq %fs:(%rax), %r11\n\t"                           \
    "jmp *(8 * " slot ")(%r11)"
 
diff --git a/src/mapi/mapi/entry_x86_tls.h b/src/mapi/mapi/entry_x86_tls.h
index ea63490..43f3489 100644
--- a/src/mapi/mapi/entry_x86_tls.h
+++ b/src/mapi/mapi/entry_x86_tls.h
@@ -50,7 +50,7 @@ __asm__("x86_current_tls:\n\t"
         "1:\n\t"
         "popl %eax\n\t"
 	"addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %eax\n\t"
-	"movl u_current_table at GOTNTPOFF(%eax), %eax\n\t"
+	"movl " ENTRY_CURRENT_TABLE "@GOTNTPOFF(%eax), %eax\n\t"
 	"ret");
 
 #ifndef GLX_X86_READONLY_TEXT
diff --git a/src/mapi/mapi/entry_x86_tsd.h b/src/mapi/mapi/entry_x86_tsd.h
index 0a07ad7..38742e7 100644
--- a/src/mapi/mapi/entry_x86_tsd.h
+++ b/src/mapi/mapi/entry_x86_tsd.h
@@ -43,7 +43,7 @@ __asm__(".text\n"
    func ":"
 
 #define STUB_ASM_CODE(slot)         \
-   "movl u_current_table, %eax\n\t" \
+   "movl " ENTRY_CURRENT_TABLE ", %eax\n\t" \
    "testl %eax, %eax\n\t"           \
    "je 1f\n\t"                      \
    "jmp *(4 * " slot ")(%eax)\n"    \




More information about the mesa-commit mailing list