diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2006-01-12 04:05:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-12 12:08:54 -0500 |
commit | c7584fb6b46a71a1aba5e06dc3cc54ce10f0129e (patch) | |
tree | 20c405cf083c77418d2f252b64e9d735cb0012f0 /arch/s390/kernel | |
parent | 579b3ea5916d60ade1e04d2a49637e5cbba67eac (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')
-rw-r--r-- | arch/s390/kernel/binfmt_elf32.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/process.c | 3 | ||||
-rw-r--r-- | arch/s390/kernel/ptrace.c | 26 | ||||
-rw-r--r-- | arch/s390/kernel/time.c | 2 | ||||
-rw-r--r-- | arch/s390/kernel/traps.c | 2 |
5 files changed, 17 insertions, 18 deletions
diff --git a/arch/s390/kernel/binfmt_elf32.c b/arch/s390/kernel/binfmt_elf32.c index 03ba5893f17b..1f451c2cb071 100644 --- a/arch/s390/kernel/binfmt_elf32.c +++ b/arch/s390/kernel/binfmt_elf32.c | |||
@@ -112,7 +112,7 @@ static inline int dump_regs32(struct pt_regs *ptregs, elf_gregset_t *regs) | |||
112 | 112 | ||
113 | static inline int dump_task_regs32(struct task_struct *tsk, elf_gregset_t *regs) | 113 | static inline int dump_task_regs32(struct task_struct *tsk, elf_gregset_t *regs) |
114 | { | 114 | { |
115 | struct pt_regs *ptregs = __KSTK_PTREGS(tsk); | 115 | struct pt_regs *ptregs = task_pt_regs(tsk); |
116 | int i; | 116 | int i; |
117 | 117 | ||
118 | memcpy(®s->psw.mask, &ptregs->psw.mask, 4); | 118 | memcpy(®s->psw.mask, &ptregs->psw.mask, 4); |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 7dd58f8ac6b5..9f643309ed3d 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -217,8 +217,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long new_stackp, | |||
217 | struct pt_regs childregs; | 217 | struct pt_regs childregs; |
218 | } *frame; | 218 | } *frame; |
219 | 219 | ||
220 | frame = ((struct fake_frame *) | 220 | frame = container_of(task_pt_regs(p), struct fake_frame, childregs); |
221 | (THREAD_SIZE + (unsigned long) p->thread_info)) - 1; | ||
222 | p->thread.ksp = (unsigned long) frame; | 221 | p->thread.ksp = (unsigned long) frame; |
223 | /* Store access registers to kernel stack of new process. */ | 222 | /* Store access registers to kernel stack of new process. */ |
224 | frame->childregs = *regs; | 223 | frame->childregs = *regs; |
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 | /* |
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c index c36353e8c140..b0d8ca8e5eeb 100644 --- a/arch/s390/kernel/time.c +++ b/arch/s390/kernel/time.c | |||
@@ -282,7 +282,7 @@ static inline void start_hz_timer(void) | |||
282 | { | 282 | { |
283 | if (!cpu_isset(smp_processor_id(), nohz_cpu_mask)) | 283 | if (!cpu_isset(smp_processor_id(), nohz_cpu_mask)) |
284 | return; | 284 | return; |
285 | account_ticks(__KSTK_PTREGS(current)); | 285 | account_ticks(task_pt_regs(current)); |
286 | cpu_clear(smp_processor_id(), nohz_cpu_mask); | 286 | cpu_clear(smp_processor_id(), nohz_cpu_mask); |
287 | } | 287 | } |
288 | 288 | ||
diff --git a/arch/s390/kernel/traps.c b/arch/s390/kernel/traps.c index 95d109968619..012135b8b32e 100644 --- a/arch/s390/kernel/traps.c +++ b/arch/s390/kernel/traps.c | |||
@@ -240,7 +240,7 @@ char *task_show_regs(struct task_struct *task, char *buffer) | |||
240 | { | 240 | { |
241 | struct pt_regs *regs; | 241 | struct pt_regs *regs; |
242 | 242 | ||
243 | regs = __KSTK_PTREGS(task); | 243 | regs = task_pt_regs(task); |
244 | buffer += sprintf(buffer, "task: %p, ksp: %p\n", | 244 | buffer += sprintf(buffer, "task: %p, ksp: %p\n", |
245 | task, (void *)task->thread.ksp); | 245 | task, (void *)task->thread.ksp); |
246 | buffer += sprintf(buffer, "User PSW : %p %p\n", | 246 | buffer += sprintf(buffer, "User PSW : %p %p\n", |