Mesa (master): mapi: declare x86_entry_start/end static

Chia-I Wu olv at kemper.freedesktop.org
Mon Jun 13 04:20:26 UTC 2011


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

Author: Chia-I Wu <olv at lunarg.com>
Date:   Mon Jun 13 11:41:41 2011 +0800

mapi: declare x86_entry_start/end static

x86_entry_start and x86_entry_end are defined by the inline assembly.
Declaring them static saves one instruction in entry_get_public.

---

 src/mapi/mapi/entry_x86_tls.h |    6 +++---
 src/mapi/mapi/entry_x86_tsd.h |    5 +++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/src/mapi/mapi/entry_x86_tls.h b/src/mapi/mapi/entry_x86_tls.h
index 5169069..de91812 100644
--- a/src/mapi/mapi/entry_x86_tls.h
+++ b/src/mapi/mapi/entry_x86_tls.h
@@ -86,12 +86,13 @@ __asm__(".text");
 extern unsigned long
 x86_current_tls();
 
+static char x86_entry_start[];
+static char x86_entry_end[];
+
 void
 entry_patch_public(void)
 {
 #ifndef GLX_X86_READONLY_TEXT
-   extern char x86_entry_start[];
-   extern char x86_entry_end[];
    char patch[8] = {
       0x65, 0xa1, 0x00, 0x00, 0x00, 0x00, /* movl %gs:0x0, %eax */
       0x90, 0x90                          /* nop's */
@@ -108,7 +109,6 @@ entry_patch_public(void)
 mapi_func
 entry_get_public(int slot)
 {
-   extern char x86_entry_start[];
    return (mapi_func) (x86_entry_start + slot * 16);
 }
 
diff --git a/src/mapi/mapi/entry_x86_tsd.h b/src/mapi/mapi/entry_x86_tsd.h
index 1491478..c479c19 100644
--- a/src/mapi/mapi/entry_x86_tsd.h
+++ b/src/mapi/mapi/entry_x86_tsd.h
@@ -60,6 +60,9 @@ __asm__(".balign 32\n"
 #include <string.h>
 #include "u_execmem.h"
 
+static const char x86_entry_start[];
+static const char x86_entry_end[];
+
 void
 entry_patch_public(void)
 {
@@ -68,7 +71,6 @@ entry_patch_public(void)
 mapi_func
 entry_get_public(int slot)
 {
-   extern const char x86_entry_start[];
    return (mapi_func) (x86_entry_start + slot * X86_ENTRY_SIZE);
 }
 
@@ -84,7 +86,6 @@ entry_patch(mapi_func entry, int slot)
 mapi_func
 entry_generate(int slot)
 {
-   extern const char x86_entry_end[];
    const char *code_templ = x86_entry_end - X86_ENTRY_SIZE;
    void *code;
    mapi_func entry;




More information about the mesa-commit mailing list