diff options
author | Glauber de Oliveira Costa <gcosta@redhat.com> | 2008-01-30 12:31:27 (GMT) |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 12:31:27 (GMT) |
commit | 0ccb8acc51693a2aef0f38024943808046d81251 (patch) | |
tree | ba3dd7f108803ba3f9ed71304c8ff1ea676cbb30 /include/asm-x86/processor.h | |
parent | 683e0253dbd12554b2ee969b15e68105252bff57 (diff) | |
download | linux-fsl-qoriq-0ccb8acc51693a2aef0f38024943808046d81251.tar.xz |
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 <gcosta@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include/asm-x86/processor.h')
-rw-r--r-- | include/asm-x86/processor.h | 11 |
1 files changed, 11 insertions, 0 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) { |