aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kernel/ptrace.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2006-01-12 04:05:49 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2006-01-12 12:08:54 -0500
commitc7584fb6b46a71a1aba5e06dc3cc54ce10f0129e (patch)
tree20c405cf083c77418d2f252b64e9d735cb0012f0 /arch/s390/kernel/ptrace.c
parent579b3ea5916d60ade1e04d2a49637e5cbba67eac (diff)
[PATCH] s390: task_pt_regs()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/s390/kernel/ptrace.c')
-rw-r--r--arch/s390/kernel/ptrace.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/arch/s390/kernel/ptrace.c b/arch/s390/kernel/ptrace.c
index cc02232aa96e..37dfe33dab73 100644
--- a/arch/s390/kernel/ptrace.c
+++ b/arch/s390/kernel/ptrace.c
@@ -52,7 +52,7 @@ FixPerRegisters(struct task_struct *task)
52 struct pt_regs *regs; 52 struct pt_regs *regs;
53 per_struct *per_info; 53 per_struct *per_info;
54 54
55 regs = __KSTK_PTREGS(task); 55 regs = task_pt_regs(task);
56 per_info = (per_struct *) &task->thread.per_info; 56 per_info = (per_struct *) &task->thread.per_info;
57 per_info->control_regs.bits.em_instruction_fetch = 57 per_info->control_regs.bits.em_instruction_fetch =
58 per_info->single_step | per_info->instruction_fetch; 58 per_info->single_step | per_info->instruction_fetch;
@@ -150,7 +150,7 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
150 /* 150 /*
151 * psw and gprs are stored on the stack 151 * psw and gprs are stored on the stack
152 */ 152 */
153 tmp = *(addr_t *)((addr_t) &__KSTK_PTREGS(child)->psw + addr); 153 tmp = *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr);
154 if (addr == (addr_t) &dummy->regs.psw.mask) 154 if (addr == (addr_t) &dummy->regs.psw.mask)
155 /* Remove per bit from user psw. */ 155 /* Remove per bit from user psw. */
156 tmp &= ~PSW_MASK_PER; 156 tmp &= ~PSW_MASK_PER;
@@ -176,7 +176,7 @@ peek_user(struct task_struct *child, addr_t addr, addr_t data)
176 /* 176 /*
177 * orig_gpr2 is stored on the kernel stack 177 * orig_gpr2 is stored on the kernel stack
178 */ 178 */
179 tmp = (addr_t) __KSTK_PTREGS(child)->orig_gpr2; 179 tmp = (addr_t) task_pt_regs(child)->orig_gpr2;
180 180
181 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { 181 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) {
182 /* 182 /*
@@ -243,7 +243,7 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
243 high order bit but older gdb's rely on it */ 243 high order bit but older gdb's rely on it */
244 data |= PSW_ADDR_AMODE; 244 data |= PSW_ADDR_AMODE;
245#endif 245#endif
246 *(addr_t *)((addr_t) &__KSTK_PTREGS(child)->psw + addr) = data; 246 *(addr_t *)((addr_t) &task_pt_regs(child)->psw + addr) = data;
247 247
248 } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) { 248 } else if (addr < (addr_t) (&dummy->regs.orig_gpr2)) {
249 /* 249 /*
@@ -267,7 +267,7 @@ poke_user(struct task_struct *child, addr_t addr, addr_t data)
267 /* 267 /*
268 * orig_gpr2 is stored on the kernel stack 268 * orig_gpr2 is stored on the kernel stack
269 */ 269 */
270 __KSTK_PTREGS(child)->orig_gpr2 = data; 270 task_pt_regs(child)->orig_gpr2 = data;
271 271
272 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) { 272 } else if (addr < (addr_t) (&dummy->regs.fp_regs + 1)) {
273 /* 273 /*
@@ -393,15 +393,15 @@ peek_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
393 */ 393 */
394 if (addr == (addr_t) &dummy32->regs.psw.mask) { 394 if (addr == (addr_t) &dummy32->regs.psw.mask) {
395 /* Fake a 31 bit psw mask. */ 395 /* Fake a 31 bit psw mask. */
396 tmp = (__u32)(__KSTK_PTREGS(child)->psw.mask >> 32); 396 tmp = (__u32)(task_pt_regs(child)->psw.mask >> 32);
397 tmp = PSW32_MASK_MERGE(PSW32_USER_BITS, tmp); 397 tmp = PSW32_MASK_MERGE(PSW32_USER_BITS, tmp);
398 } else if (addr == (addr_t) &dummy32->regs.psw.addr) { 398 } else if (addr == (addr_t) &dummy32->regs.psw.addr) {
399 /* Fake a 31 bit psw address. */ 399 /* Fake a 31 bit psw address. */
400 tmp = (__u32) __KSTK_PTREGS(child)->psw.addr | 400 tmp = (__u32) task_pt_regs(child)->psw.addr |
401 PSW32_ADDR_AMODE31; 401 PSW32_ADDR_AMODE31;
402 } else { 402 } else {
403 /* gpr 0-15 */ 403 /* gpr 0-15 */
404 tmp = *(__u32 *)((addr_t) &__KSTK_PTREGS(child)->psw + 404 tmp = *(__u32 *)((addr_t) &task_pt_regs(child)->psw +
405 addr*2 + 4); 405 addr*2 + 4);
406 } 406 }
407 } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { 407 } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) {
@@ -415,7 +415,7 @@ peek_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
415 /* 415 /*
416 * orig_gpr2 is stored on the kernel stack 416 * orig_gpr2 is stored on the kernel stack
417 */ 417 */
418 tmp = *(__u32*)((addr_t) &__KSTK_PTREGS(child)->orig_gpr2 + 4); 418 tmp = *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4);
419 419
420 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { 420 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) {
421 /* 421 /*
@@ -472,15 +472,15 @@ poke_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
472 if (tmp != PSW32_MASK_MERGE(PSW32_USER_BITS, tmp)) 472 if (tmp != PSW32_MASK_MERGE(PSW32_USER_BITS, tmp))
473 /* Invalid psw mask. */ 473 /* Invalid psw mask. */
474 return -EINVAL; 474 return -EINVAL;
475 __KSTK_PTREGS(child)->psw.mask = 475 task_pt_regs(child)->psw.mask =
476 PSW_MASK_MERGE(PSW_USER32_BITS, (__u64) tmp << 32); 476 PSW_MASK_MERGE(PSW_USER32_BITS, (__u64) tmp << 32);
477 } else if (addr == (addr_t) &dummy32->regs.psw.addr) { 477 } else if (addr == (addr_t) &dummy32->regs.psw.addr) {
478 /* Build a 64 bit psw address from 31 bit address. */ 478 /* Build a 64 bit psw address from 31 bit address. */
479 __KSTK_PTREGS(child)->psw.addr = 479 task_pt_regs(child)->psw.addr =
480 (__u64) tmp & PSW32_ADDR_INSN; 480 (__u64) tmp & PSW32_ADDR_INSN;
481 } else { 481 } else {
482 /* gpr 0-15 */ 482 /* gpr 0-15 */
483 *(__u32*)((addr_t) &__KSTK_PTREGS(child)->psw 483 *(__u32*)((addr_t) &task_pt_regs(child)->psw
484 + addr*2 + 4) = tmp; 484 + addr*2 + 4) = tmp;
485 } 485 }
486 } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) { 486 } else if (addr < (addr_t) (&dummy32->regs.orig_gpr2)) {
@@ -494,7 +494,7 @@ poke_user_emu31(struct task_struct *child, addr_t addr, addr_t data)
494 /* 494 /*
495 * orig_gpr2 is stored on the kernel stack 495 * orig_gpr2 is stored on the kernel stack
496 */ 496 */
497 *(__u32*)((addr_t) &__KSTK_PTREGS(child)->orig_gpr2 + 4) = tmp; 497 *(__u32*)((addr_t) &task_pt_regs(child)->orig_gpr2 + 4) = tmp;
498 498
499 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) { 499 } else if (addr < (addr_t) (&dummy32->regs.fp_regs + 1)) {
500 /* 500 /*