diff options
-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 | ||||
-rw-r--r-- | include/asm-s390/elf.h | 2 | ||||
-rw-r--r-- | include/asm-s390/processor.h | 8 |
7 files changed, 22 insertions, 23 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", |
diff --git a/include/asm-s390/elf.h b/include/asm-s390/elf.h index 372d51cccd53..710646e64f7d 100644 --- a/include/asm-s390/elf.h +++ b/include/asm-s390/elf.h | |||
@@ -163,7 +163,7 @@ static inline int dump_regs(struct pt_regs *ptregs, elf_gregset_t *regs) | |||
163 | 163 | ||
164 | static inline int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) | 164 | static inline int dump_task_regs(struct task_struct *tsk, elf_gregset_t *regs) |
165 | { | 165 | { |
166 | struct pt_regs *ptregs = __KSTK_PTREGS(tsk); | 166 | struct pt_regs *ptregs = task_pt_regs(tsk); |
167 | memcpy(®s->psw, &ptregs->psw, sizeof(regs->psw)+sizeof(regs->gprs)); | 167 | memcpy(®s->psw, &ptregs->psw, sizeof(regs->psw)+sizeof(regs->gprs)); |
168 | memcpy(regs->acrs, tsk->thread.acrs, sizeof(regs->acrs)); | 168 | memcpy(regs->acrs, tsk->thread.acrs, sizeof(regs->acrs)); |
169 | regs->orig_gpr2 = ptregs->orig_gpr2; | 169 | regs->orig_gpr2 = ptregs->orig_gpr2; |
diff --git a/include/asm-s390/processor.h b/include/asm-s390/processor.h index 4ec652ebb3b1..795bfcb95def 100644 --- a/include/asm-s390/processor.h +++ b/include/asm-s390/processor.h | |||
@@ -191,10 +191,10 @@ extern void show_registers(struct pt_regs *regs); | |||
191 | extern void show_trace(struct task_struct *task, unsigned long *sp); | 191 | extern void show_trace(struct task_struct *task, unsigned long *sp); |
192 | 192 | ||
193 | unsigned long get_wchan(struct task_struct *p); | 193 | unsigned long get_wchan(struct task_struct *p); |
194 | #define __KSTK_PTREGS(tsk) ((struct pt_regs *) \ | 194 | #define task_pt_regs(tsk) ((struct pt_regs *) \ |
195 | ((unsigned long) tsk->thread_info + THREAD_SIZE - sizeof(struct pt_regs))) | 195 | ((void *)(tsk)->thread_info + THREAD_SIZE) - 1) |
196 | #define KSTK_EIP(tsk) (__KSTK_PTREGS(tsk)->psw.addr) | 196 | #define KSTK_EIP(tsk) (task_pt_regs(tsk)->psw.addr) |
197 | #define KSTK_ESP(tsk) (__KSTK_PTREGS(tsk)->gprs[15]) | 197 | #define KSTK_ESP(tsk) (task_pt_regs(tsk)->gprs[15]) |
198 | 198 | ||
199 | /* | 199 | /* |
200 | * Give up the time slice of the virtual PU. | 200 | * Give up the time slice of the virtual PU. |