[xtensa-cvscommit] linux/arch/xtensa/kernel ptrace.c,1.3,1.4
Brought to you by:
zankel
|
From: <sfo...@us...> - 2002-10-04 06:30:58
|
Update of /cvsroot/xtensa/linux/arch/xtensa/kernel
In directory usw-pr-cvs1:/tmp/cvs-serv19701
Modified Files:
ptrace.c
Log Message:
Update algorithm to write AR registers via ptrace.
Do not return an error when reading/writing an AR register via ptrace that was not saved because it was not part of an active pane. Return a value of 0 when reading.
Allow PC to be written via ptrace.
Index: ptrace.c
===================================================================
RCS file: /cvsroot/xtensa/linux/arch/xtensa/kernel/ptrace.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** ptrace.c 23 Sep 2002 19:20:20 -0000 1.3
--- ptrace.c 4 Oct 2002 06:30:55 -0000 1.4
***************
*** 162,167 ****
}
else {
! tmp = -1;
! res = -EIO;
}
break;
--- 162,171 ----
}
else {
! /* If we are here, we are writing to an AR register
! * that was not saved, because it was not part of
! * an active window. gdb sometimes save/restores
! * all registers, so we behave as if it worked --
! * return a value of 0 with no error. */
! tmp = 0;
}
break;
***************
*** 220,223 ****
--- 224,228 ----
case PTRACE_POKEUSR: {
struct pt_regs *regs;
+ unsigned long tmp;
res = 0;
regs = (struct pt_regs *)
***************
*** 239,250 ****
}
else if(a_reg >= first_pane*4) {
! if(first_pane < 0)
! res = -EIO;
! else
! child->thread.regfile[a_reg - first_pane*4] = data;
}
else {
! res = -EIO;
}
break;
case SYSCALL_NR:
--- 244,265 ----
}
else if(a_reg >= first_pane*4) {
! if(first_pane < 0)
! res = -EIO;
! else {
! tmp = XCHAL_NUM_AREGS / 4 - first_pane -
! (a_reg / 4 - first_pane) - 1;
! child->thread.regfile[tmp*4 + a_reg % 4] = data;
! }
}
else {
! /* If we are here, we are writing to an AR register
! * that was not saved, because it was not part of
! * an active window. gdb sometimes save/restores
! * all registers, so we behave as if it worked --
! * return 0, but don't set any values. */
}
+ break;
+ case REG_PC:
+ regs->pc = data;
break;
case SYSCALL_NR:
|