Commit 32fc5983 authored by Yoshinori Sato's avatar Yoshinori Sato Committed by Linus Torvalds

[PATCH] H8/300: ptrace fix

- Kconfig typo fix
- PTRACE_PEEKUSER read process info support
- exr restore fix
- ptrace register offset fix
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent afbeb90f
......@@ -223,7 +223,7 @@ config GDB_DEBUG
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
......
......@@ -116,18 +116,36 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
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 ;
}
......
......@@ -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 @@ SYMBOL_NAME_LABEL(system_call)
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)
......
......@@ -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 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment