[PATCH] H8/300 update (1/3) ptrace fix

From: Yoshinori Sato
Date: Thu Jun 17 2004 - 07:31:07 EST


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

--
Yoshinori Sato
<ysato@xxxxxxxxxxxxxxxxxxxx>

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 */
-
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/