Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 163727
b: refs/heads/master
c: ef45128
h: refs/heads/master
i:
  163725: a74aede
  163723: b64321a
  163719: 0ceb103
  163711: cd5a55b
v: v3
  • Loading branch information
Thomas Gleixner committed Aug 31, 2009
1 parent a794f8b commit a2d7d57
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08047c4f1740c7cee75d58e2919d48c09f951649
refs/heads/master: ef4512882dbe9978e7a18ccbcb4cb45705ce5560
13 changes: 6 additions & 7 deletions trunk/arch/x86/kernel/time_32.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,23 +34,22 @@ unsigned long profile_pc(struct pt_regs *regs)
{
unsigned long pc = instruction_pointer(regs);

#ifdef CONFIG_SMP
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. */
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)
return sp[1];
#endif
}
#endif
return pc;
}
EXPORT_SYMBOL(profile_pc);
Expand Down
8 changes: 5 additions & 3 deletions trunk/arch/x86/kernel/time_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a2d7d57

Please sign in to comment.