aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:53:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-04-15 16:53:55 -0400
commitfa2e5c073a355465a2a8c9a2fbecf404f9857c3a (patch)
tree771be75e5436031ad53649634dffa67f6667b083 /arch/arm/kernel
parente44740c1a94b5d39b093045920f543a7bc135584 (diff)
parent97b2f0dc331474fb80ba4f4e4aee1d8e9ffbf7ce (diff)
Merge branch 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc
Pull exec domain removal from Richard Weinberger: "This series removes execution domain support from Linux. The idea behind exec domains was to support different ABIs. The feature was never complete nor stable. Let's rip it out and make the kernel signal handling code less complicated" * 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc: (27 commits) arm64: Removed unused variable sparc: Fix execution domain removal Remove rest of exec domains. arch: Remove exec_domain from remaining archs arc: Remove signal translation and exec_domain xtensa: Remove signal translation and exec_domain xtensa: Autogenerate offsets in struct thread_info x86: Remove signal translation and exec_domain unicore32: Remove signal translation and exec_domain um: Remove signal translation and exec_domain tile: Remove signal translation and exec_domain sparc: Remove signal translation and exec_domain sh: Remove signal translation and exec_domain s390: Remove signal translation and exec_domain mn10300: Remove signal translation and exec_domain microblaze: Remove signal translation and exec_domain m68k: Remove signal translation and exec_domain m32r: Remove signal translation and exec_domain m32r: Autogenerate offsets in struct thread_info frv: Remove signal translation and exec_domain ...
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r--arch/arm/kernel/Makefile1
-rw-r--r--arch/arm/kernel/arthur.c94
-rw-r--r--arch/arm/kernel/asm-offsets.c1
-rw-r--r--arch/arm/kernel/signal.c13
-rw-r--r--arch/arm/kernel/traps.c6
5 files changed, 3 insertions, 112 deletions
diff --git a/arch/arm/kernel/Makefile b/arch/arm/kernel/Makefile
index ba5f83226011..752725dcbf42 100644
--- a/arch/arm/kernel/Makefile
+++ b/arch/arm/kernel/Makefile
@@ -34,7 +34,6 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
34obj-$(CONFIG_ISA_DMA_API) += dma.o 34obj-$(CONFIG_ISA_DMA_API) += dma.o
35obj-$(CONFIG_FIQ) += fiq.o fiqasm.o 35obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
36obj-$(CONFIG_MODULES) += armksyms.o module.o 36obj-$(CONFIG_MODULES) += armksyms.o module.o
37obj-$(CONFIG_ARTHUR) += arthur.o
38obj-$(CONFIG_ISA_DMA) += dma-isa.o 37obj-$(CONFIG_ISA_DMA) += dma-isa.o
39obj-$(CONFIG_PCI) += bios32.o isa.o 38obj-$(CONFIG_PCI) += bios32.o isa.o
40obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o 39obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
diff --git a/arch/arm/kernel/arthur.c b/arch/arm/kernel/arthur.c
deleted file mode 100644
index 321c5291d05f..000000000000
--- a/arch/arm/kernel/arthur.c
+++ /dev/null
@@ -1,94 +0,0 @@
1/*
2 * linux/arch/arm/kernel/arthur.c
3 *
4 * Copyright (C) 1998, 1999, 2000, 2001 Philip Blundell
5 *
6 * Arthur personality
7 */
8
9/*
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version
13 * 2 of the License, or (at your option) any later version.
14 */
15
16#include <linux/module.h>
17#include <linux/personality.h>
18#include <linux/stddef.h>
19#include <linux/signal.h>
20#include <linux/init.h>
21#include <linux/sched.h>
22
23#include <asm/ptrace.h>
24
25/* Arthur doesn't have many signals, and a lot of those that it does
26 have don't map easily to any Linux equivalent. Never mind. */
27
28#define ARTHUR_SIGABRT 1
29#define ARTHUR_SIGFPE 2
30#define ARTHUR_SIGILL 3
31#define ARTHUR_SIGINT 4
32#define ARTHUR_SIGSEGV 5
33#define ARTHUR_SIGTERM 6
34#define ARTHUR_SIGSTAK 7
35#define ARTHUR_SIGUSR1 8
36#define ARTHUR_SIGUSR2 9
37#define ARTHUR_SIGOSERROR 10
38
39static unsigned long arthur_to_linux_signals[32] = {
40 0, 1, 2, 3, 4, 5, 6, 7,
41 8, 9, 10, 11, 12, 13, 14, 15,
42 16, 17, 18, 19, 20, 21, 22, 23,
43 24, 25, 26, 27, 28, 29, 30, 31
44};
45
46static unsigned long linux_to_arthur_signals[32] = {
47 0, -1, ARTHUR_SIGINT, -1,
48 ARTHUR_SIGILL, 5, ARTHUR_SIGABRT, 7,
49 ARTHUR_SIGFPE, 9, ARTHUR_SIGUSR1, ARTHUR_SIGSEGV,
50 ARTHUR_SIGUSR2, 13, 14, ARTHUR_SIGTERM,
51 16, 17, 18, 19,
52 20, 21, 22, 23,
53 24, 25, 26, 27,
54 28, 29, 30, 31
55};
56
57static void arthur_lcall7(int nr, struct pt_regs *regs)
58{
59 struct siginfo info;
60 info.si_signo = SIGSWI;
61 info.si_errno = nr;
62 /* Bounce it to the emulator */
63 send_sig_info(SIGSWI, &info, current);
64}
65
66static struct exec_domain arthur_exec_domain = {
67 .name = "Arthur",
68 .handler = arthur_lcall7,
69 .pers_low = PER_RISCOS,
70 .pers_high = PER_RISCOS,
71 .signal_map = arthur_to_linux_signals,
72 .signal_invmap = linux_to_arthur_signals,
73 .module = THIS_MODULE,
74};
75
76/*
77 * We could do with some locking to stop Arthur being removed while
78 * processes are using it.
79 */
80
81static int __init arthur_init(void)
82{
83 return register_exec_domain(&arthur_exec_domain);
84}
85
86static void __exit arthur_exit(void)
87{
88 unregister_exec_domain(&arthur_exec_domain);
89}
90
91module_init(arthur_init);
92module_exit(arthur_exit);
93
94MODULE_LICENSE("GPL");
diff --git a/arch/arm/kernel/asm-offsets.c b/arch/arm/kernel/asm-offsets.c
index 61bb5a65eb37..871b8267d211 100644
--- a/arch/arm/kernel/asm-offsets.c
+++ b/arch/arm/kernel/asm-offsets.c
@@ -67,7 +67,6 @@ int main(void)
67 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count)); 67 DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
68 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit)); 68 DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
69 DEFINE(TI_TASK, offsetof(struct thread_info, task)); 69 DEFINE(TI_TASK, offsetof(struct thread_info, task));
70 DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
71 DEFINE(TI_CPU, offsetof(struct thread_info, cpu)); 70 DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
72 DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain)); 71 DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
73 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context)); 72 DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
index 023ac905e4c3..423663e23791 100644
--- a/arch/arm/kernel/signal.c
+++ b/arch/arm/kernel/signal.c
@@ -318,17 +318,6 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, int framesize)
318 return frame; 318 return frame;
319} 319}
320 320
321/*
322 * translate the signal
323 */
324static inline int map_sig(int sig)
325{
326 struct thread_info *thread = current_thread_info();
327 if (sig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
328 sig = thread->exec_domain->signal_invmap[sig];
329 return sig;
330}
331
332static int 321static int
333setup_return(struct pt_regs *regs, struct ksignal *ksig, 322setup_return(struct pt_regs *regs, struct ksignal *ksig,
334 unsigned long __user *rc, void __user *frame) 323 unsigned long __user *rc, void __user *frame)
@@ -412,7 +401,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
412 } 401 }
413 } 402 }
414 403
415 regs->ARM_r0 = map_sig(ksig->sig); 404 regs->ARM_r0 = ksig->sig;
416 regs->ARM_sp = (unsigned long)frame; 405 regs->ARM_sp = (unsigned long)frame;
417 regs->ARM_lr = retcode; 406 regs->ARM_lr = retcode;
418 regs->ARM_pc = handler; 407 regs->ARM_pc = handler;
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c
index 788e23fe64d8..3dce1a342030 100644
--- a/arch/arm/kernel/traps.c
+++ b/arch/arm/kernel/traps.c
@@ -505,12 +505,10 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason)
505 505
506static int bad_syscall(int n, struct pt_regs *regs) 506static int bad_syscall(int n, struct pt_regs *regs)
507{ 507{
508 struct thread_info *thread = current_thread_info();
509 siginfo_t info; 508 siginfo_t info;
510 509
511 if ((current->personality & PER_MASK) != PER_LINUX && 510 if ((current->personality & PER_MASK) != PER_LINUX) {
512 thread->exec_domain->handler) { 511 send_sig(SIGSEGV, current, 1);
513 thread->exec_domain->handler(n, regs);
514 return regs->ARM_r0; 512 return regs->ARM_r0;
515 } 513 }
516 514