mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Zwane Mwaikambo <zwane@fsmlabs.com>
To: Linux Kernel <linux-kernel@vger.kernel.org>
Cc: Andrew Morton <akpm@osdl.org>, Linus Torvalds <torvalds@osdl.org>,
	William Lee Irwin III <wli@holomorphy.com>,
	Matt Mackall <mpm@selenic.com>,
	Russell King <rmk@arm.linux.org.uk>
Subject: [PATCH][6/8] Arch agnostic completely out of line locks / arm
Date: Thu, 2 Sep 2004 20:02:55 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0409021237000.4481@montezuma.fsmlabs.com> (raw)

 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@fsmlabs.com>

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 *);

             reply	other threads:[~2004-09-03  0:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-03  0:02 Zwane Mwaikambo [this message]
2004-09-03  9:04 ` Russell King
2004-09-03 12:09   ` Zwane Mwaikambo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.58.0409021237000.4481@montezuma.fsmlabs.com \
    --to=zwane@fsmlabs.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mpm@selenic.com \
    --cc=rmk@arm.linux.org.uk \
    --cc=torvalds@osdl.org \
    --cc=wli@holomorphy.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®