summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/time_64.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-08-21 13:24:08 +0200
committerThomas Gleixner <tglx@linutronix.de>2009-08-31 09:35:46 +0200
commitef4512882dbe9978e7a18ccbcb4cb45705ce5560 (patch)
tree7a9f85a9a9ddb4be1a0073730bf04ca25bc1eb4f /arch/x86/kernel/time_64.c
parentx86: Move calibrate_cpu to tsc.c (diff)
downloadlinux-ef4512882dbe9978e7a18ccbcb4cb45705ce5560.tar.xz
linux-ef4512882dbe9978e7a18ccbcb4cb45705ce5560.zip
x86: time_32/64.c unify profile_pc
The code is identical except for the formatting and a useless #ifdef. Make it the same. Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/time_64.c')
-rw-r--r--arch/x86/kernel/time_64.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c
index e59a40ebff14..fda0c34da757 100644
--- a/arch/x86/kernel/time_64.c
+++ b/arch/x86/kernel/time_64.c
@@ -34,14 +34,16 @@ unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);
- /* Assume the lock function has either no stack frame or a copy
- of flags from PUSHF
- Eflags always has bits 22 and up cleared unlike kernel addresses. */
if (!user_mode_vm(regs) && in_lock_functions(pc)) {
#ifdef CONFIG_FRAME_POINTER
return *(unsigned long *)(regs->bp + sizeof(long));
#else
unsigned long *sp = (unsigned long *)regs->sp;
+ /*
+ * Return address is either directly at stack pointer
+ * or above a saved flags. Eflags has bits 22-31 zero,
+ * kernel addresses don't.
+ */
if (sp[0] >> 22)
return sp[0];
if (sp[1] >> 22)