]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
x86: unify current_text_addr
authorGlauber de Oliveira Costa <gcosta@redhat.com>
Wed, 30 Jan 2008 12:31:27 +0000 (13:31 +0100)
committerIngo Molnar <mingo@elte.hu>
Wed, 30 Jan 2008 12:31:27 +0000 (13:31 +0100)
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 <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
include/asm-x86/processor.h
include/asm-x86/processor_32.h
include/asm-x86/processor_64.h

index 52e3637ef59e84f5a27d52092a0f96c6cbad72c8..3deb5ba55f550469b3e21f036bba26e4b7e041b6 100644 (file)
@@ -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)
 {
index 9e119d3789b41f889c38da7250240f6190585352..6cd2149dcbad9023a7c806c305aa24b8dbe373ed 100644 (file)
 #include <linux/init.h>
 #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
index 5f5c7fc63797ade25a167dff1d49746b1bcbc716..1984a4a38b748d4df9d7f5e6c34d33b6901a830f 100644 (file)
 #include <linux/cpumask.h>
 #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.
  */