| 1 |
diff -ur -X /home/ysato/.exclude-diff arch/h8300/kernel/ptrace.c /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/kernel/ptrace.c |
| 2 |
--- arch/h8300/kernel/ptrace.c 2004-03-30 12:46:16.000000000 +0900 |
| 3 |
+++ /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/kernel/ptrace.c 2004-05-30 23:06:45.000000000 +0900 |
| 4 |
@@ -104,9 +104,9 @@ |
| 5 |
case PTRACE_PEEKDATA: { |
| 6 |
unsigned long tmp; |
| 7 |
|
| 8 |
- ret = read_long(child, addr, &tmp); |
| 9 |
- if (ret < 0) |
| 10 |
- break ; |
| 11 |
+ ret = -EIO; |
| 12 |
+ if (access_process_vm(child, addr, &tmp, sizeof(tmp), 0) != sizeof(tmp)) |
| 13 |
+ break; |
| 14 |
ret = verify_area(VERIFY_WRITE, (void *) data, sizeof(long)); |
| 15 |
if (!ret) |
| 16 |
put_user(tmp, (unsigned long *) data); |
| 17 |
@@ -129,11 +129,25 @@ |
| 18 |
if (addr < H8300_REGS_NO) |
| 19 |
tmp = h8300_get_reg(child, addr); |
| 20 |
else { |
| 21 |
- ret = -EIO; |
| 22 |
- break ; |
| 23 |
+ switch(addr) { |
| 24 |
+ case 49: |
| 25 |
+ tmp = child->mm->start_code; |
| 26 |
+ break ; |
| 27 |
+ case 50: |
| 28 |
+ tmp = child->mm->start_data; |
| 29 |
+ break ; |
| 30 |
+ case 51: |
| 31 |
+ tmp = child->mm->end_code; |
| 32 |
+ break ; |
| 33 |
+ case 52: |
| 34 |
+ tmp = child->mm->end_data; |
| 35 |
+ break ; |
| 36 |
+ default: |
| 37 |
+ ret = -EIO; |
| 38 |
+ } |
| 39 |
} |
| 40 |
- put_user(tmp,(unsigned long *) data); |
| 41 |
- ret = 0; |
| 42 |
+ if (!ret) |
| 43 |
+ put_user(tmp,(unsigned long *) data); |
| 44 |
break ; |
| 45 |
} |
| 46 |
|
| 47 |
diff -ur -X /home/ysato/.exclude-diff arch/h8300/platform/h8s/entry.S /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/platform/h8s/entry.S |
| 48 |
--- arch/h8300/platform/h8s/entry.S 2004-05-13 09:29:08.000000000 +0900 |
| 49 |
+++ /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/platform/h8s/entry.S 2004-06-02 22:58:24.000000000 +0900 |
| 50 |
@@ -114,6 +114,7 @@ |
| 51 |
mov.l @(LER0:16,sp),er1 /* restore ER0 */ |
| 52 |
mov.l er1,@er0 |
| 53 |
mov.w @(LEXR:16,sp),r1 /* restore EXR */ |
| 54 |
+ mov.b r1l,r1h |
| 55 |
mov.w r1,@(8:16,er0) |
| 56 |
mov.w @(LCCR:16,sp),r1 /* restore the RET addr */ |
| 57 |
mov.b r1l,r1h |
| 58 |
diff -ur -X /home/ysato/.exclude-diff arch/h8300/platform/h8s/generic/crt0_rom.S /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/platform/h8s/generic/crt0_rom.S |
| 59 |
--- arch/h8300/platform/h8s/generic/crt0_rom.S 2004-05-13 09:29:08.000000000 +0900 |
| 60 |
+++ /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/platform/h8s/generic/crt0_rom.S 2004-07-08 22:24:33.000000000 +0900 |
| 61 |
@@ -138,7 +138,7 @@ |
| 62 |
.long __start |
| 63 |
.long __start |
| 64 |
vector = 2 |
| 65 |
- .rept 126-1 |
| 66 |
+ .rept 128-2 |
| 67 |
.long _interrupt_redirect_table+vector*4 |
| 68 |
vector = vector + 1 |
| 69 |
.endr |
| 70 |
diff -ur -X /home/ysato/.exclude-diff arch/h8300/platform/h8s/ptrace_h8s.c /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/platform/h8s/ptrace_h8s.c |
| 71 |
--- arch/h8300/platform/h8s/ptrace_h8s.c 2004-03-30 12:46:17.000000000 +0900 |
| 72 |
+++ /home/ysato/uCdev/uClinux-2.4.x/arch/h8300/platform/h8s/ptrace_h8s.c 2004-05-30 02:08:15.000000000 +0900 |
| 73 |
@@ -22,7 +22,7 @@ |
| 74 |
static const int h8300_register_offset[] = { |
| 75 |
PT_REG(er1), PT_REG(er2), PT_REG(er3), PT_REG(er4), |
| 76 |
PT_REG(er5), SW_REG(er6), PT_REG(er0), PT_REG(orig_er0), |
| 77 |
- PT_REG(ccr), PT_REG(pc), PT_REG(exr) |
| 78 |
+ PT_REG(ccr), PT_REG(pc), 0, PT_REG(exr) |
| 79 |
}; |
| 80 |
|
| 81 |
/* read register */ |
| 82 |
@@ -33,9 +33,10 @@ |
| 83 |
return task->thread.usp + sizeof(long)*2 + 2; |
| 84 |
case PT_CCR: |
| 85 |
case PT_EXR: |
| 86 |
- return *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]); |
| 87 |
+ return *(unsigned short *)(task->thread.esp0 + h8300_register_offset[regno]); |
| 88 |
default: |
| 89 |
- return *(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno]); |
| 90 |
+ printk("get_reg %d=%08x\n",regno,*(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno])); |
| 91 |
+ return *(unsigned long *)(task->thread.esp0 + h8300_register_offset[regno]); |
| 92 |
} |
| 93 |
} |
| 94 |
|