Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0ccb8acc51693a2aef0f38024943808046d81251
Commit:     0ccb8acc51693a2aef0f38024943808046d81251
Parent:     683e0253dbd12554b2ee969b15e68105252bff57
Author:     Glauber de Oliveira Costa <[EMAIL PROTECTED]>
AuthorDate: Wed Jan 30 13:31:27 2008 +0100
Committer:  Ingo Molnar <[EMAIL PROTECTED]>
CommitDate: Wed Jan 30 13:31:27 2008 +0100

    x86: unify current_text_addr
    
    current_text_addr() has a different implementation in x86_64 and
    i386, but it is not fundamentally different. I stick to the i386
    implementation, that seem to be a common base, and move it to processor.h
    
    Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]>
    Signed-off-by: Ingo Molnar <[EMAIL PROTECTED]>
    Signed-off-by: Thomas Gleixner <[EMAIL PROTECTED]>
---
 include/asm-x86/processor.h    |   11 +++++++++++
 include/asm-x86/processor_32.h |    6 ------
 include/asm-x86/processor_64.h |    6 ------
 3 files changed, 11 insertions(+), 12 deletions(-)

diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 52e3637..3deb5ba 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -10,6 +10,17 @@ struct mm_struct;
 #include <asm/page.h>
 #include <asm/system.h>
 
+/*
+ * Default implementation of macro that returns current
+ * instruction pointer ("program counter").
+ */
+static inline void *current_text_addr(void)
+{
+       void *pc;
+       asm volatile("mov $1f,%0\n1:":"=r" (pc));
+       return pc;
+}
+
 static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
                                         unsigned int *ecx, unsigned int *edx)
 {
diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h
index 9e119d3..6cd2149 100644
--- a/include/asm-x86/processor_32.h
+++ b/include/asm-x86/processor_32.h
@@ -22,12 +22,6 @@
 #include <asm/desc_defs.h>
 
 /*
- * Default implementation of macro that returns current
- * instruction pointer ("program counter").
- */
-#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); 
pc; })
-
-/*
  *  CPU type and hardware bug flags. Kept separately for each CPU.
  *  Members of this structure are referenced in head.S, so think twice
  *  before touching them. [mj]
diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h
index 5f5c7fc..1984a4a 100644
--- a/include/asm-x86/processor_64.h
+++ b/include/asm-x86/processor_64.h
@@ -21,12 +21,6 @@
 #include <asm/desc_defs.h>
 
 /*
- * Default implementation of macro that returns current
- * instruction pointer ("program counter").
- */
-#define current_text_addr() ({ void *pc; asm volatile("leaq 
1f(%%rip),%0\n1:":"=r"(pc)); pc; })
-
-/*
  *  CPU type and hardware bug flags. Kept separately for each CPU.
  */
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to