[PATCH][6/8] Arch agnostic completely out of line locks / arm

From: Zwane Mwaikambo
Date: Thu Sep 02 2004 - 19:12:45 EST


arch/arm/kernel/time.c | 12 ++++++++++++
arch/arm/kernel/vmlinux.lds.S | 1 +
arch/arm/oprofile/op_model_xscale.c | 4 ++--
include/asm-arm/ptrace.h | 5 +++++
4 files changed, 20 insertions(+), 2 deletions(-)

Signed-off-by: Zwane Mwaikambo <zwane@xxxxxxxxxxx>

Index: linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/arch/arm/kernel/time.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 time.c
--- linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c 26 Aug 2004 13:13:04 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/time.c 2 Sep 2004 15:51:37 -0000
@@ -52,6 +52,18 @@ EXPORT_SYMBOL(rtc_lock);
/* change this if you have some constant time drift */
#define USECS_PER_JIFFY (1000000/HZ)

+#ifdef CONFIG_SMP
+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 regs->ARM_lr;
+ return pc;
+}
+EXPORT_SYMBOL(profile_pc);
+#endif

/*
* hook for setting the RTC's idea of the current time.
Index: linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/vmlinux.lds.S
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/arch/arm/kernel/vmlinux.lds.S,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 vmlinux.lds.S
--- linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/vmlinux.lds.S 26 Aug 2004 13:13:04 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm1-stage/arch/arm/kernel/vmlinux.lds.S 2 Sep 2004 13:08:12 -0000
@@ -71,6 +71,7 @@ SECTIONS
_text = .; /* Text and read-only data */
*(.text)
SCHED_TEXT
+ LOCK_TEXT
*(.fixup)
*(.gnu.warning)
*(.rodata)
Index: linux-2.6.9-rc1-mm1-stage/arch/arm/oprofile/op_model_xscale.c
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/arch/arm/oprofile/op_model_xscale.c,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 op_model_xscale.c
--- linux-2.6.9-rc1-mm1-stage/arch/arm/oprofile/op_model_xscale.c 26 Aug 2004 13:13:05 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm1-stage/arch/arm/oprofile/op_model_xscale.c 2 Sep 2004 15:52:39 -0000
@@ -343,7 +343,7 @@ static void inline __xsc2_check_ctrs(voi

static irqreturn_t xscale_pmu_interrupt(int irq, void *arg, struct pt_regs *regs)
{
- unsigned long eip = instruction_pointer(regs);
+ unsigned long pc = profile_pc(regs);
int i, is_kernel = !user_mode(regs);
u32 pmnc;

@@ -357,7 +357,7 @@ static irqreturn_t xscale_pmu_interrupt(
continue;

write_counter(i, -(u32)results[i].reset_counter);
- oprofile_add_sample(eip, is_kernel, i, smp_processor_id());
+ oprofile_add_sample(pc, is_kernel, i, smp_processor_id());
results[i].ovf--;
}

Index: linux-2.6.9-rc1-mm1-stage/include/asm-arm/ptrace.h
===================================================================
RCS file: /home/cvsroot/linux-2.6.9-rc1-mm1/include/asm-arm/ptrace.h,v
retrieving revision 1.1.1.1
diff -u -p -B -r1.1.1.1 ptrace.h
--- linux-2.6.9-rc1-mm1-stage/include/asm-arm/ptrace.h 26 Aug 2004 13:13:12 -0000 1.1.1.1
+++ linux-2.6.9-rc1-mm1-stage/include/asm-arm/ptrace.h 2 Sep 2004 13:08:15 -0000
@@ -130,7 +130,12 @@ static inline int valid_user_regs(struct

#define instruction_pointer(regs) \
(pc_pointer((regs)->ARM_pc))
+
+#ifdef CONFIG_SMP
+extern unsigned long profile_pc(struct pt_regs *regs);
+#else
#define profile_pc(regs) instruction_pointer(regs)
+#endif

#ifdef __KERNEL__
extern void show_regs(struct pt_regs *);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/