diff options
| author | Zwane Mwaikambo <zwane@linuxpower.ca> | 2004-09-04 02:18:59 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-09-04 02:18:59 -0700 |
| commit | 4c9ed1710d1835a05bbf13c54f8ea955688d0802 (patch) | |
| tree | de61f30ec4b5082b4d380688f010a5eb1f9bf526 | |
| parent | b3a9ee9e608306de8130f33374b447ea32edc430 (diff) | |
[PATCH] out-of-line locks / x86_64
Signed-off-by: Zwane Mwaikambo <zwane@fsmlabs.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | arch/x86_64/kernel/time.c | 13 | ||||
| -rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 1 | ||||
| -rw-r--r-- | include/asm-x86_64/ptrace.h | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c index 1411b1949445..6cdc12377f5c 100644 --- a/arch/x86_64/kernel/time.c +++ b/arch/x86_64/kernel/time.c @@ -179,6 +179,19 @@ int do_settimeofday(struct timespec *tv) EXPORT_SYMBOL(do_settimeofday); +#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) +unsigned long profile_pc(struct pt_regs *regs) +{ + unsigned long pc = instruction_pointer(regs); + + if (pc >= (unsigned long)&__lock_text_start && + pc <= (unsigned long)&__lock_text_end) + return *(unsigned long *)regs->rbp; + return pc; +} +EXPORT_SYMBOL(profile_pc); +#endif + /* * In order to set the CMOS clock precisely, set_rtc_mmss has to be called 500 * ms after the second nowtime has started, because when nowtime is written diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index e502b7e386ac..f656f197b833 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S @@ -16,6 +16,7 @@ SECTIONS .text : { *(.text) SCHED_TEXT + LOCK_TEXT *(.fixup) *(.gnu.warning) } = 0x9090 diff --git a/include/asm-x86_64/ptrace.h b/include/asm-x86_64/ptrace.h index 22ecea2759c8..86489292359e 100644 --- a/include/asm-x86_64/ptrace.h +++ b/include/asm-x86_64/ptrace.h @@ -83,7 +83,11 @@ struct pt_regs { #if defined(__KERNEL__) && !defined(__ASSEMBLY__) #define user_mode(regs) (!!((regs)->cs & 3)) #define instruction_pointer(regs) ((regs)->rip) +#if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) +extern unsigned long profile_pc(struct pt_regs *regs); +#else #define profile_pc(regs) instruction_pointer(regs) +#endif void signal_fault(struct pt_regs *regs, void __user *frame, char *where); enum { |
