diff options
author | Richard Weinberger <richard@nod.at> | 2014-07-13 11:37:45 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-04-12 14:58:25 -0400 |
commit | daea906dd31843edc062faba82cd43c8b720305d (patch) | |
tree | 5bbf09b0674af4c16febe881b365e9e98b0c379c /arch/sh | |
parent | 6a32591a4a38948d785a3bb0dac32d5be1f76354 (diff) |
sh: Remove signal translation and exec_domain
As execution domain support is gone we can remove
signal translation from the signal code and remove
exec_domain from thread_info.
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/sh')
-rw-r--r-- | arch/sh/include/asm/thread_info.h | 2 | ||||
-rw-r--r-- | arch/sh/kernel/asm-offsets.c | 1 | ||||
-rw-r--r-- | arch/sh/kernel/irq.c | 2 | ||||
-rw-r--r-- | arch/sh/kernel/signal_32.c | 18 | ||||
-rw-r--r-- | arch/sh/kernel/signal_64.c | 21 |
5 files changed, 6 insertions, 38 deletions
diff --git a/arch/sh/include/asm/thread_info.h b/arch/sh/include/asm/thread_info.h index 657c03919627..2afa321157be 100644 --- a/arch/sh/include/asm/thread_info.h +++ b/arch/sh/include/asm/thread_info.h | |||
@@ -27,7 +27,6 @@ | |||
27 | 27 | ||
28 | struct thread_info { | 28 | struct thread_info { |
29 | struct task_struct *task; /* main task structure */ | 29 | struct task_struct *task; /* main task structure */ |
30 | struct exec_domain *exec_domain; /* execution domain */ | ||
31 | unsigned long flags; /* low level flags */ | 30 | unsigned long flags; /* low level flags */ |
32 | __u32 status; /* thread synchronous flags */ | 31 | __u32 status; /* thread synchronous flags */ |
33 | __u32 cpu; | 32 | __u32 cpu; |
@@ -56,7 +55,6 @@ struct thread_info { | |||
56 | #define INIT_THREAD_INFO(tsk) \ | 55 | #define INIT_THREAD_INFO(tsk) \ |
57 | { \ | 56 | { \ |
58 | .task = &tsk, \ | 57 | .task = &tsk, \ |
59 | .exec_domain = &default_exec_domain, \ | ||
60 | .flags = 0, \ | 58 | .flags = 0, \ |
61 | .status = 0, \ | 59 | .status = 0, \ |
62 | .cpu = 0, \ | 60 | .cpu = 0, \ |
diff --git a/arch/sh/kernel/asm-offsets.c b/arch/sh/kernel/asm-offsets.c index 542225fedb11..4bd44da910f3 100644 --- a/arch/sh/kernel/asm-offsets.c +++ b/arch/sh/kernel/asm-offsets.c | |||
@@ -21,7 +21,6 @@ int main(void) | |||
21 | { | 21 | { |
22 | /* offsets into the thread_info struct */ | 22 | /* offsets into the thread_info struct */ |
23 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); | 23 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); |
24 | DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); | ||
25 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); | 24 | DEFINE(TI_FLAGS, offsetof(struct thread_info, flags)); |
26 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); | 25 | DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); |
27 | DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); | 26 | DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); |
diff --git a/arch/sh/kernel/irq.c b/arch/sh/kernel/irq.c index 65a1ecd77f96..eb10ff84015c 100644 --- a/arch/sh/kernel/irq.c +++ b/arch/sh/kernel/irq.c | |||
@@ -124,7 +124,6 @@ void irq_ctx_init(int cpu) | |||
124 | 124 | ||
125 | irqctx = (union irq_ctx *)&hardirq_stack[cpu * THREAD_SIZE]; | 125 | irqctx = (union irq_ctx *)&hardirq_stack[cpu * THREAD_SIZE]; |
126 | irqctx->tinfo.task = NULL; | 126 | irqctx->tinfo.task = NULL; |
127 | irqctx->tinfo.exec_domain = NULL; | ||
128 | irqctx->tinfo.cpu = cpu; | 127 | irqctx->tinfo.cpu = cpu; |
129 | irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; | 128 | irqctx->tinfo.preempt_count = HARDIRQ_OFFSET; |
130 | irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); | 129 | irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); |
@@ -133,7 +132,6 @@ void irq_ctx_init(int cpu) | |||
133 | 132 | ||
134 | irqctx = (union irq_ctx *)&softirq_stack[cpu * THREAD_SIZE]; | 133 | irqctx = (union irq_ctx *)&softirq_stack[cpu * THREAD_SIZE]; |
135 | irqctx->tinfo.task = NULL; | 134 | irqctx->tinfo.task = NULL; |
136 | irqctx->tinfo.exec_domain = NULL; | ||
137 | irqctx->tinfo.cpu = cpu; | 135 | irqctx->tinfo.cpu = cpu; |
138 | irqctx->tinfo.preempt_count = 0; | 136 | irqctx->tinfo.preempt_count = 0; |
139 | irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); | 137 | irqctx->tinfo.addr_limit = MAKE_MM_SEG(0); |
diff --git a/arch/sh/kernel/signal_32.c b/arch/sh/kernel/signal_32.c index 0b34f2a704fe..ab7b56bc054a 100644 --- a/arch/sh/kernel/signal_32.c +++ b/arch/sh/kernel/signal_32.c | |||
@@ -267,19 +267,12 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, | |||
267 | { | 267 | { |
268 | struct sigframe __user *frame; | 268 | struct sigframe __user *frame; |
269 | int err = 0, sig = ksig->sig; | 269 | int err = 0, sig = ksig->sig; |
270 | int signal; | ||
271 | 270 | ||
272 | frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); | 271 | frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); |
273 | 272 | ||
274 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 273 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
275 | return -EFAULT; | 274 | return -EFAULT; |
276 | 275 | ||
277 | signal = current_thread_info()->exec_domain | ||
278 | && current_thread_info()->exec_domain->signal_invmap | ||
279 | && sig < 32 | ||
280 | ? current_thread_info()->exec_domain->signal_invmap[sig] | ||
281 | : sig; | ||
282 | |||
283 | err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); | 276 | err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); |
284 | 277 | ||
285 | if (_NSIG_WORDS > 1) | 278 | if (_NSIG_WORDS > 1) |
@@ -313,7 +306,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, | |||
313 | 306 | ||
314 | /* Set up registers for signal handler */ | 307 | /* Set up registers for signal handler */ |
315 | regs->regs[15] = (unsigned long) frame; | 308 | regs->regs[15] = (unsigned long) frame; |
316 | regs->regs[4] = signal; /* Arg for signal handler */ | 309 | regs->regs[4] = sig; /* Arg for signal handler */ |
317 | regs->regs[5] = 0; | 310 | regs->regs[5] = 0; |
318 | regs->regs[6] = (unsigned long) &frame->sc; | 311 | regs->regs[6] = (unsigned long) &frame->sc; |
319 | 312 | ||
@@ -342,19 +335,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, | |||
342 | { | 335 | { |
343 | struct rt_sigframe __user *frame; | 336 | struct rt_sigframe __user *frame; |
344 | int err = 0, sig = ksig->sig; | 337 | int err = 0, sig = ksig->sig; |
345 | int signal; | ||
346 | 338 | ||
347 | frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); | 339 | frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame)); |
348 | 340 | ||
349 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 341 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
350 | return -EFAULT; | 342 | return -EFAULT; |
351 | 343 | ||
352 | signal = current_thread_info()->exec_domain | ||
353 | && current_thread_info()->exec_domain->signal_invmap | ||
354 | && sig < 32 | ||
355 | ? current_thread_info()->exec_domain->signal_invmap[sig] | ||
356 | : sig; | ||
357 | |||
358 | err |= copy_siginfo_to_user(&frame->info, &ksig->info); | 344 | err |= copy_siginfo_to_user(&frame->info, &ksig->info); |
359 | 345 | ||
360 | /* Create the ucontext. */ | 346 | /* Create the ucontext. */ |
@@ -392,7 +378,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set, | |||
392 | 378 | ||
393 | /* Set up registers for signal handler */ | 379 | /* Set up registers for signal handler */ |
394 | regs->regs[15] = (unsigned long) frame; | 380 | regs->regs[15] = (unsigned long) frame; |
395 | regs->regs[4] = signal; /* Arg for signal handler */ | 381 | regs->regs[4] = sig; /* Arg for signal handler */ |
396 | regs->regs[5] = (unsigned long) &frame->info; | 382 | regs->regs[5] = (unsigned long) &frame->info; |
397 | regs->regs[6] = (unsigned long) &frame->uc; | 383 | regs->regs[6] = (unsigned long) &frame->uc; |
398 | 384 | ||
diff --git a/arch/sh/kernel/signal_64.c b/arch/sh/kernel/signal_64.c index 71993c6a7d94..76122d6cd95f 100644 --- a/arch/sh/kernel/signal_64.c +++ b/arch/sh/kernel/signal_64.c | |||
@@ -385,12 +385,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs | |||
385 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 385 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
386 | return -EFAULT; | 386 | return -EFAULT; |
387 | 387 | ||
388 | signal = current_thread_info()->exec_domain | ||
389 | && current_thread_info()->exec_domain->signal_invmap | ||
390 | && sig < 32 | ||
391 | ? current_thread_info()->exec_domain->signal_invmap[sig] | ||
392 | : sig; | ||
393 | |||
394 | err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); | 388 | err |= setup_sigcontext(&frame->sc, regs, set->sig[0]); |
395 | 389 | ||
396 | /* Give up earlier as i386, in case */ | 390 | /* Give up earlier as i386, in case */ |
@@ -441,7 +435,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs | |||
441 | * All edited pointers are subject to NEFF. | 435 | * All edited pointers are subject to NEFF. |
442 | */ | 436 | */ |
443 | regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); | 437 | regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); |
444 | regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ | 438 | regs->regs[REG_ARG1] = sig; /* Arg for signal handler */ |
445 | 439 | ||
446 | /* FIXME: | 440 | /* FIXME: |
447 | The glibc profiling support for SH-5 needs to be passed a sigcontext | 441 | The glibc profiling support for SH-5 needs to be passed a sigcontext |
@@ -461,7 +455,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs | |||
461 | 455 | ||
462 | /* Broken %016Lx */ | 456 | /* Broken %016Lx */ |
463 | pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n", | 457 | pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n", |
464 | signal, current->comm, current->pid, frame, | 458 | sig, current->comm, current->pid, frame, |
465 | regs->pc >> 32, regs->pc & 0xffffffff, | 459 | regs->pc >> 32, regs->pc & 0xffffffff, |
466 | DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff); | 460 | DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff); |
467 | 461 | ||
@@ -473,19 +467,12 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set, | |||
473 | { | 467 | { |
474 | struct rt_sigframe __user *frame; | 468 | struct rt_sigframe __user *frame; |
475 | int err = 0, sig = ksig->sig; | 469 | int err = 0, sig = ksig->sig; |
476 | int signal; | ||
477 | 470 | ||
478 | frame = get_sigframe(&ksig->ka, regs->regs[REG_SP], sizeof(*frame)); | 471 | frame = get_sigframe(&ksig->ka, regs->regs[REG_SP], sizeof(*frame)); |
479 | 472 | ||
480 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) | 473 | if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame))) |
481 | return -EFAULT; | 474 | return -EFAULT; |
482 | 475 | ||
483 | signal = current_thread_info()->exec_domain | ||
484 | && current_thread_info()->exec_domain->signal_invmap | ||
485 | && sig < 32 | ||
486 | ? current_thread_info()->exec_domain->signal_invmap[sig] | ||
487 | : sig; | ||
488 | |||
489 | err |= __put_user(&frame->info, &frame->pinfo); | 476 | err |= __put_user(&frame->info, &frame->pinfo); |
490 | err |= __put_user(&frame->uc, &frame->puc); | 477 | err |= __put_user(&frame->uc, &frame->puc); |
491 | err |= copy_siginfo_to_user(&frame->info, &ksig->info); | 478 | err |= copy_siginfo_to_user(&frame->info, &ksig->info); |
@@ -542,7 +529,7 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set, | |||
542 | * All edited pointers are subject to NEFF. | 529 | * All edited pointers are subject to NEFF. |
543 | */ | 530 | */ |
544 | regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); | 531 | regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame); |
545 | regs->regs[REG_ARG1] = signal; /* Arg for signal handler */ | 532 | regs->regs[REG_ARG1] = sig; /* Arg for signal handler */ |
546 | regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info; | 533 | regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info; |
547 | regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext; | 534 | regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext; |
548 | regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler); | 535 | regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler); |
@@ -550,7 +537,7 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set, | |||
550 | set_fs(USER_DS); | 537 | set_fs(USER_DS); |
551 | 538 | ||
552 | pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n", | 539 | pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n", |
553 | signal, current->comm, current->pid, frame, | 540 | sig, current->comm, current->pid, frame, |
554 | regs->pc >> 32, regs->pc & 0xffffffff, | 541 | regs->pc >> 32, regs->pc & 0xffffffff, |
555 | DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff); | 542 | DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff); |
556 | 543 | ||