public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Yoshinori Sato <ysato@users.sourceforge.jp>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: linux kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: [PATCH] H8/300 update (1/3) ptrace fix
Date: Thu, 17 Jun 2004 21:28:46 +0900	[thread overview]
Message-ID: <m2k6y6wept.wl%ysato@users.sourceforge.jp> (raw)

- Kconfig typo fix
- PTRACE_PEEKUSER read process info support
- exr restore fix
- ptrace register offset fix

-- 
Yoshinori Sato
<ysato@users.sourceforge.jp>

diff -ru -X .exclude-diff linux-2.6.7/arch/h8300/Kconfig linux-2.6.7-h8300/arch/h8300/Kconfig
--- linux-2.6.7/arch/h8300/Kconfig	2004-06-16 14:19:44.000000000 +0900
+++ linux-2.6.7-h8300/arch/h8300/Kconfig	2004-06-07 00:50:45.000000000 +0900
@@ -223,7 +223,7 @@
 
 config CONFIG_SH_STANDARD_BIOS
 	bool "Use gdb protocol serial console"
-	depends on (!H8300H_SIM && H8S_SIM)
+	depends on (!H8300H_SIM && !H8S_SIM)
 	help
 	  serial console output using GDB protocol.
 	  Require eCos/RedBoot
diff -ru -X .exclude-diff linux-2.6.7/arch/h8300/kernel/ptrace.c linux-2.6.7-h8300/arch/h8300/kernel/ptrace.c
--- linux-2.6.7/arch/h8300/kernel/ptrace.c	2004-06-16 14:19:09.000000000 +0900
+++ linux-2.6.7-h8300/arch/h8300/kernel/ptrace.c	2004-06-17 20:28:05.000000000 +0900
@@ -116,18 +116,36 @@
 		case PTRACE_PEEKUSR: {
 			unsigned long tmp;
 			
-			if ((addr & 3) || addr < 0 || addr >= sizeof(struct user))
+			if ((addr & 3) || addr < 0 || addr >= sizeof(struct user)) {
 				ret = -EIO;
+				break ; 
+			}
 			
-			tmp = 0;  /* Default return condition */
+		        ret = 0;  /* Default return condition */
 			addr = addr >> 2; /* temporary hack. */
+
 			if (addr < H8300_REGS_NO)
 				tmp = h8300_get_reg(child, addr);
 			else {
-				ret = -EIO;
-				break ;
+				switch(addr) {
+				case 49:
+					tmp = child->mm->start_code;
+					break ;
+				case 50:
+					tmp = child->mm->start_data;
+					break ;
+				case 51:
+					tmp = child->mm->end_code;
+					break ;
+				case 52:
+					tmp = child->mm->end_data;
+					break ;
+				default:
+					ret = -EIO;
+				}
 			}
-			ret = put_user(tmp,(unsigned long *) data);
+			if (!ret)
+				ret = put_user(tmp,(unsigned long *) data);
 			break ;
 		}
 
diff -ru -X .exclude-diff linux-2.6.7/arch/h8300/platform/h8s/entry.S linux-2.6.7-h8300/arch/h8300/platform/h8s/entry.S
--- linux-2.6.7/arch/h8300/platform/h8s/entry.S	2004-06-16 14:19:52.000000000 +0900
+++ linux-2.6.7-h8300/arch/h8300/platform/h8s/entry.S	2004-06-17 00:29:35.000000000 +0900
@@ -83,6 +83,7 @@
 	mov.l	@(LER0-LER1:16,sp),er1		/* restore ER0 */
 	mov.l	er1,@er0
 	mov.w	@(LEXR-LER1:16,sp),r1		/* restore EXR */
+	mov.b	r1l,r1h
 	mov.w	r1,@(8:16,er0)
 	mov.w	@(LCCR-LER1:16,sp),r1		/* restore the RET addr */
 	mov.b	r1l,r1h
@@ -214,7 +215,6 @@
 	jsr	@SYMBOL_NAME(syscall_trace)
 	bra	SYMBOL_NAME(ret_from_exception):8
 
-
 SYMBOL_NAME_LABEL(ret_from_fork)
 	mov.l	er2,er0
 	jsr	@SYMBOL_NAME(schedule_tail)
diff -ru -X .exclude-diff linux-2.6.7/arch/h8300/platform/h8s/ptrace_h8s.c linux-2.6.7-h8300/arch/h8300/platform/h8s/ptrace_h8s.c
--- linux-2.6.7/arch/h8300/platform/h8s/ptrace_h8s.c	2004-06-16 14:19:01.000000000 +0900
+++ linux-2.6.7-h8300/arch/h8300/platform/h8s/ptrace_h8s.c	2004-06-02 23:33:03.000000000 +0900
@@ -23,7 +23,7 @@
 static const int h8300_register_offset[] = {
 	PT_REG(er1), PT_REG(er2), PT_REG(er3), PT_REG(er4),
 	PT_REG(er5), PT_REG(er6), PT_REG(er0), PT_REG(orig_er0),
-	PT_REG(ccr), PT_REG(pc), PT_REG(exr)
+	PT_REG(ccr), PT_REG(pc),  0,           PT_REG(exr)
 };
 
 /* read register */

                 reply	other threads:[~2004-06-17 12:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=m2k6y6wept.wl%ysato@users.sourceforge.jp \
    --to=ysato@users.sourceforge.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.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