diff options
-rw-r--r-- | arch/parisc/kernel/time.c | 18 | ||||
-rw-r--r-- | include/asm-parisc/ptrace.h | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/arch/parisc/kernel/time.c b/arch/parisc/kernel/time.c index 7ff67f8e9f8c..163cdf39be20 100644 --- a/arch/parisc/kernel/time.c +++ b/arch/parisc/kernel/time.c | |||
@@ -104,6 +104,24 @@ irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
104 | return IRQ_HANDLED; | 104 | return IRQ_HANDLED; |
105 | } | 105 | } |
106 | 106 | ||
107 | |||
108 | unsigned long profile_pc(struct pt_regs *regs) | ||
109 | { | ||
110 | unsigned long pc = instruction_pointer(regs); | ||
111 | |||
112 | if (regs->gr[0] & PSW_N) | ||
113 | pc -= 4; | ||
114 | |||
115 | #ifdef CONFIG_SMP | ||
116 | if (in_lock_functions(pc)) | ||
117 | pc = regs->gr[2]; | ||
118 | #endif | ||
119 | |||
120 | return pc; | ||
121 | } | ||
122 | EXPORT_SYMBOL(profile_pc); | ||
123 | |||
124 | |||
107 | /*** converted from ia64 ***/ | 125 | /*** converted from ia64 ***/ |
108 | /* | 126 | /* |
109 | * Return the number of micro-seconds that elapsed since the last | 127 | * Return the number of micro-seconds that elapsed since the last |
diff --git a/include/asm-parisc/ptrace.h b/include/asm-parisc/ptrace.h index 3f428aa371a4..93f990e418f1 100644 --- a/include/asm-parisc/ptrace.h +++ b/include/asm-parisc/ptrace.h | |||
@@ -49,7 +49,7 @@ struct pt_regs { | |||
49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) | 49 | #define user_mode(regs) (((regs)->iaoq[0] & 3) ? 1 : 0) |
50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) | 50 | #define user_space(regs) (((regs)->iasq[1] != 0) ? 1 : 0) |
51 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) | 51 | #define instruction_pointer(regs) ((regs)->iaoq[0] & ~3) |
52 | #define profile_pc(regs) instruction_pointer(regs) | 52 | unsigned long profile_pc(struct pt_regs *); |
53 | extern void show_regs(struct pt_regs *); | 53 | extern void show_regs(struct pt_regs *); |
54 | #endif | 54 | #endif |
55 | 55 | ||