aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/asm-x86/processor.h11
-rw-r--r--include/asm-x86/processor_32.h6
-rw-r--r--include/asm-x86/processor_64.h6
3 files changed, 11 insertions, 12 deletions
diff --git a/include/asm-x86/processor.h b/include/asm-x86/processor.h
index 52e3637ef59e..3deb5ba55f55 100644
--- a/include/asm-x86/processor.h
+++ b/include/asm-x86/processor.h
@@ -10,6 +10,17 @@ struct mm_struct;
10#include <asm/page.h> 10#include <asm/page.h>
11#include <asm/system.h> 11#include <asm/system.h>
12 12
13/*
14 * Default implementation of macro that returns current
15 * instruction pointer ("program counter").
16 */
17static inline void *current_text_addr(void)
18{
19 void *pc;
20 asm volatile("mov $1f,%0\n1:":"=r" (pc));
21 return pc;
22}
23
13static inline void native_cpuid(unsigned int *eax, unsigned int *ebx, 24static inline void native_cpuid(unsigned int *eax, unsigned int *ebx,
14 unsigned int *ecx, unsigned int *edx) 25 unsigned int *ecx, unsigned int *edx)
15{ 26{
diff --git a/include/asm-x86/processor_32.h b/include/asm-x86/processor_32.h
index 9e119d3789b4..6cd2149dcbad 100644
--- a/include/asm-x86/processor_32.h
+++ b/include/asm-x86/processor_32.h
@@ -22,12 +22,6 @@
22#include <asm/desc_defs.h> 22#include <asm/desc_defs.h>
23 23
24/* 24/*
25 * Default implementation of macro that returns current
26 * instruction pointer ("program counter").
27 */
28#define current_text_addr() ({ void *pc; __asm__("movl $1f,%0\n1:":"=g" (pc)); pc; })
29
30/*
31 * CPU type and hardware bug flags. Kept separately for each CPU. 25 * CPU type and hardware bug flags. Kept separately for each CPU.
32 * Members of this structure are referenced in head.S, so think twice 26 * Members of this structure are referenced in head.S, so think twice
33 * before touching them. [mj] 27 * before touching them. [mj]
diff --git a/include/asm-x86/processor_64.h b/include/asm-x86/processor_64.h
index 5f5c7fc63797..1984a4a38b74 100644
--- a/include/asm-x86/processor_64.h
+++ b/include/asm-x86/processor_64.h
@@ -21,12 +21,6 @@
21#include <asm/desc_defs.h> 21#include <asm/desc_defs.h>
22 22
23/* 23/*
24 * Default implementation of macro that returns current
25 * instruction pointer ("program counter").
26 */
27#define current_text_addr() ({ void *pc; asm volatile("leaq 1f(%%rip),%0\n1:":"=r"(pc)); pc; })
28
29/*
30 * CPU type and hardware bug flags. Kept separately for each CPU. 24 * CPU type and hardware bug flags. Kept separately for each CPU.
31 */ 25 */
32 26