Skip to contentSkip to conversation

m68k: merge the mmu and non-mmu versions of ptrace.c

PATCH In review [email protected] 2 participants 3 messages Feb 22, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 m68k: merge the mmu and non-mmu versions of ptrace.c

From: Greg Ungerer <[email protected]>

Most of the code in the non-mmu ptrace_no.c file is the same as the mmu version ptrace_mm.c. So merge them back into a single file.

---
 arch/m68k/kernel/{ptrace_mm.c => ptrace.c} |   10 +
 arch/m68k/kernel/ptrace_no.c               |  255 ----------------------------
 2 files changed, 10 insertions(+), 255 deletions(-)
 rename arch/m68k/kernel/{ptrace_mm.c => ptrace.c} (96%)
 delete mode 100644 arch/m68k/kernel/ptrace_no.c
arch/m68k/kernel/ptrace.c renamed from arch/m68k/kernel/ptrace_mm.c +10 -0
similarity index 96%
rename from arch/m68k/kernel/ptrace_mm.c
rename to arch/m68k/kernel/ptrace.c
index 7bc999b..149a05f 100644
@@ -146,11 +146,13 @@ void user_enable_single_step(struct task_struct *child)
 	set_tsk_thread_flag(child, TIF_DELAYED_TRACE);
 }
 
+#ifdef CONFIG_MMU
 void user_enable_block_step(struct task_struct *child)
 {
 	unsigned long tmp = get_reg(child, PT_SR) & ~TRACE_BITS;
 	put_reg(child, PT_SR, tmp | T0_BIT);
 }
+#endif
 
 void user_disable_single_step(struct task_struct *child)
 {
@@ -181,6 +183,14 @@ long arch_ptrace(struct task_struct *child, long request,
 			if (FPU_IS_EMU && (regno < 45) && !(regno % 3))
 				tmp = ((tmp & 0xffff0000) << 15) |
 				      ((tmp & 0x0000ffff) << 16);
+#ifndef CONFIG_MMU
+		} else if (regno == 49) {
+			tmp = child->mm->start_code;
+		} else if (regno == 50) {
+			tmp = child->mm->start_data;
+		} else if (regno == 51) {
+			tmp = child->mm->end_code;
+#endif
 		} else
 			goto out_eio;
 		ret = put_user(tmp, datap);
arch/m68k/kernel/ptrace_no.c deleted +0 -255

255 lines not on this page · raw message

Signature · 1 line
1.7.0.4
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 4 lines · On Wed, Feb 22, 2012 at 04:13, <[email protected]> wrote:

Most of the code in the non-mmu ptrace_no.c file is the same as the mmu version ptrace_mm.c. So merge them back into a single file.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds

#2 lore raw

Hi Geert,

Quoted 7 lines · Geert Uytterhoeven
Quoted 4 lines · On Wed, Feb 22, 2012 at 04:13,<[email protected]> wrote:

Most of the code in the non-mmu ptrace_no.c file is the same as the mmu version ptrace_mm.c. So merge them back into a single file.

Thanks!

Regards
Greg

------------------------------------------------------------------------

Greg Ungerer  --  Principal Engineer        EMAIL:     [email protected]
SnapGear Group, McAfee                      PHONE:       +61 7 3435 2888
8 Gardner Close,                            FAX:         +61 7 3891 3630
Milton, QLD, 4064, Australia                WEB: http://www.SnapGear.com