You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
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 ...
This commit is contained in:
@@ -18,7 +18,6 @@ struct thread_info {
|
||||
unsigned int flags; /* low level flags */
|
||||
unsigned int ieee_state; /* see fpu.h */
|
||||
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
mm_segment_t addr_limit; /* thread address space */
|
||||
unsigned cpu; /* current CPU */
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
@@ -35,7 +34,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
}
|
||||
|
||||
@@ -43,7 +43,6 @@ struct thread_info {
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
struct task_struct *task; /* main task structure */
|
||||
mm_segment_t addr_limit; /* thread address space */
|
||||
struct exec_domain *exec_domain;/* execution domain */
|
||||
__u32 cpu; /* current CPU */
|
||||
unsigned long thr_ptr; /* TLS ptr */
|
||||
};
|
||||
@@ -56,7 +55,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
|
||||
@@ -171,18 +171,6 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
|
||||
return frame;
|
||||
}
|
||||
|
||||
/*
|
||||
* translate the signal
|
||||
*/
|
||||
static inline int map_sig(int sig)
|
||||
{
|
||||
struct thread_info *thread = current_thread_info();
|
||||
if (thread->exec_domain && thread->exec_domain->signal_invmap
|
||||
&& sig < 32)
|
||||
sig = thread->exec_domain->signal_invmap[sig];
|
||||
return sig;
|
||||
}
|
||||
|
||||
static int
|
||||
setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
|
||||
{
|
||||
@@ -231,7 +219,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
|
||||
return err;
|
||||
|
||||
/* #1 arg to the user Signal handler */
|
||||
regs->r0 = map_sig(ksig->sig);
|
||||
regs->r0 = ksig->sig;
|
||||
|
||||
/* setup PC of user space signal handler */
|
||||
regs->ret = (unsigned long)ksig->ka.sa.sa_handler;
|
||||
|
||||
@@ -2133,16 +2133,6 @@ menu "Userspace binary formats"
|
||||
|
||||
source "fs/Kconfig.binfmt"
|
||||
|
||||
config ARTHUR
|
||||
tristate "RISC OS personality"
|
||||
depends on !AEABI
|
||||
help
|
||||
Say Y here to include the kernel code necessary if you want to run
|
||||
Acorn RISC OS/Arthur binaries under Linux. This code is still very
|
||||
experimental; if this sounds frightening, say N and sleep in peace.
|
||||
You can also say M here to compile this support as a module (which
|
||||
will be called arthur).
|
||||
|
||||
endmenu
|
||||
|
||||
menu "Power management options"
|
||||
|
||||
@@ -12,7 +12,6 @@ CONFIG_CPU_FREQ_GOV_PERFORMANCE=y
|
||||
CONFIG_FPE_NWFPE=y
|
||||
CONFIG_BINFMT_AOUT=m
|
||||
CONFIG_BINFMT_MISC=m
|
||||
CONFIG_ARTHUR=m
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
|
||||
#include <asm/types.h>
|
||||
#include <asm/domain.h>
|
||||
@@ -53,7 +52,6 @@ struct thread_info {
|
||||
int preempt_count; /* 0 => preemptable, <0 => bug */
|
||||
mm_segment_t addr_limit; /* address limit */
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
__u32 cpu; /* cpu */
|
||||
__u32 cpu_domain; /* cpu domain */
|
||||
struct cpu_context_save cpu_context; /* cpu context */
|
||||
@@ -73,7 +71,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
|
||||
@@ -34,7 +34,6 @@ obj-$(CONFIG_CPU_IDLE) += cpuidle.o
|
||||
obj-$(CONFIG_ISA_DMA_API) += dma.o
|
||||
obj-$(CONFIG_FIQ) += fiq.o fiqasm.o
|
||||
obj-$(CONFIG_MODULES) += armksyms.o module.o
|
||||
obj-$(CONFIG_ARTHUR) += arthur.o
|
||||
obj-$(CONFIG_ISA_DMA) += dma-isa.o
|
||||
obj-$(CONFIG_PCI) += bios32.o isa.o
|
||||
obj-$(CONFIG_ARM_CPU_SUSPEND) += sleep.o suspend.o
|
||||
|
||||
@@ -1,94 +0,0 @@
|
||||
/*
|
||||
* linux/arch/arm/kernel/arthur.c
|
||||
*
|
||||
* Copyright (C) 1998, 1999, 2000, 2001 Philip Blundell
|
||||
*
|
||||
* Arthur personality
|
||||
*/
|
||||
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version
|
||||
* 2 of the License, or (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/personality.h>
|
||||
#include <linux/stddef.h>
|
||||
#include <linux/signal.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#include <asm/ptrace.h>
|
||||
|
||||
/* Arthur doesn't have many signals, and a lot of those that it does
|
||||
have don't map easily to any Linux equivalent. Never mind. */
|
||||
|
||||
#define ARTHUR_SIGABRT 1
|
||||
#define ARTHUR_SIGFPE 2
|
||||
#define ARTHUR_SIGILL 3
|
||||
#define ARTHUR_SIGINT 4
|
||||
#define ARTHUR_SIGSEGV 5
|
||||
#define ARTHUR_SIGTERM 6
|
||||
#define ARTHUR_SIGSTAK 7
|
||||
#define ARTHUR_SIGUSR1 8
|
||||
#define ARTHUR_SIGUSR2 9
|
||||
#define ARTHUR_SIGOSERROR 10
|
||||
|
||||
static unsigned long arthur_to_linux_signals[32] = {
|
||||
0, 1, 2, 3, 4, 5, 6, 7,
|
||||
8, 9, 10, 11, 12, 13, 14, 15,
|
||||
16, 17, 18, 19, 20, 21, 22, 23,
|
||||
24, 25, 26, 27, 28, 29, 30, 31
|
||||
};
|
||||
|
||||
static unsigned long linux_to_arthur_signals[32] = {
|
||||
0, -1, ARTHUR_SIGINT, -1,
|
||||
ARTHUR_SIGILL, 5, ARTHUR_SIGABRT, 7,
|
||||
ARTHUR_SIGFPE, 9, ARTHUR_SIGUSR1, ARTHUR_SIGSEGV,
|
||||
ARTHUR_SIGUSR2, 13, 14, ARTHUR_SIGTERM,
|
||||
16, 17, 18, 19,
|
||||
20, 21, 22, 23,
|
||||
24, 25, 26, 27,
|
||||
28, 29, 30, 31
|
||||
};
|
||||
|
||||
static void arthur_lcall7(int nr, struct pt_regs *regs)
|
||||
{
|
||||
struct siginfo info;
|
||||
info.si_signo = SIGSWI;
|
||||
info.si_errno = nr;
|
||||
/* Bounce it to the emulator */
|
||||
send_sig_info(SIGSWI, &info, current);
|
||||
}
|
||||
|
||||
static struct exec_domain arthur_exec_domain = {
|
||||
.name = "Arthur",
|
||||
.handler = arthur_lcall7,
|
||||
.pers_low = PER_RISCOS,
|
||||
.pers_high = PER_RISCOS,
|
||||
.signal_map = arthur_to_linux_signals,
|
||||
.signal_invmap = linux_to_arthur_signals,
|
||||
.module = THIS_MODULE,
|
||||
};
|
||||
|
||||
/*
|
||||
* We could do with some locking to stop Arthur being removed while
|
||||
* processes are using it.
|
||||
*/
|
||||
|
||||
static int __init arthur_init(void)
|
||||
{
|
||||
return register_exec_domain(&arthur_exec_domain);
|
||||
}
|
||||
|
||||
static void __exit arthur_exit(void)
|
||||
{
|
||||
unregister_exec_domain(&arthur_exec_domain);
|
||||
}
|
||||
|
||||
module_init(arthur_init);
|
||||
module_exit(arthur_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
@@ -67,7 +67,6 @@ int main(void)
|
||||
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
|
||||
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
|
||||
DEFINE(TI_TASK, offsetof(struct thread_info, task));
|
||||
DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
|
||||
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
|
||||
DEFINE(TI_CPU_DOMAIN, offsetof(struct thread_info, cpu_domain));
|
||||
DEFINE(TI_CPU_SAVE, offsetof(struct thread_info, cpu_context));
|
||||
|
||||
@@ -318,17 +318,6 @@ get_sigframe(struct ksignal *ksig, struct pt_regs *regs, int framesize)
|
||||
return frame;
|
||||
}
|
||||
|
||||
/*
|
||||
* translate the signal
|
||||
*/
|
||||
static inline int map_sig(int sig)
|
||||
{
|
||||
struct thread_info *thread = current_thread_info();
|
||||
if (sig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
|
||||
sig = thread->exec_domain->signal_invmap[sig];
|
||||
return sig;
|
||||
}
|
||||
|
||||
static int
|
||||
setup_return(struct pt_regs *regs, struct ksignal *ksig,
|
||||
unsigned long __user *rc, void __user *frame)
|
||||
@@ -412,7 +401,7 @@ setup_return(struct pt_regs *regs, struct ksignal *ksig,
|
||||
}
|
||||
}
|
||||
|
||||
regs->ARM_r0 = map_sig(ksig->sig);
|
||||
regs->ARM_r0 = ksig->sig;
|
||||
regs->ARM_sp = (unsigned long)frame;
|
||||
regs->ARM_lr = retcode;
|
||||
regs->ARM_pc = handler;
|
||||
|
||||
@@ -505,12 +505,10 @@ asmlinkage void bad_mode(struct pt_regs *regs, int reason)
|
||||
|
||||
static int bad_syscall(int n, struct pt_regs *regs)
|
||||
{
|
||||
struct thread_info *thread = current_thread_info();
|
||||
siginfo_t info;
|
||||
|
||||
if ((current->personality & PER_MASK) != PER_LINUX &&
|
||||
thread->exec_domain->handler) {
|
||||
thread->exec_domain->handler(n, regs);
|
||||
if ((current->personality & PER_MASK) != PER_LINUX) {
|
||||
send_sig(SIGSEGV, current, 1);
|
||||
return regs->ARM_r0;
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
@@ -47,7 +46,6 @@ struct thread_info {
|
||||
unsigned long flags; /* low level flags */
|
||||
mm_segment_t addr_limit; /* address limit */
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
int preempt_count; /* 0 => preemptable, <0 => bug */
|
||||
int cpu; /* cpu */
|
||||
};
|
||||
@@ -55,7 +53,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
|
||||
@@ -38,7 +38,6 @@ int main(void)
|
||||
DEFINE(TI_PREEMPT, offsetof(struct thread_info, preempt_count));
|
||||
DEFINE(TI_ADDR_LIMIT, offsetof(struct thread_info, addr_limit));
|
||||
DEFINE(TI_TASK, offsetof(struct thread_info, task));
|
||||
DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
|
||||
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
|
||||
BLANK();
|
||||
DEFINE(THREAD_CPU_CONTEXT, offsetof(struct task_struct, thread.cpu_context));
|
||||
|
||||
@@ -287,18 +287,11 @@ static void setup_restart_syscall(struct pt_regs *regs)
|
||||
*/
|
||||
static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
|
||||
{
|
||||
struct thread_info *thread = current_thread_info();
|
||||
struct task_struct *tsk = current;
|
||||
sigset_t *oldset = sigmask_to_save();
|
||||
int usig = ksig->sig;
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* translate the signal
|
||||
*/
|
||||
if (usig < 32 && thread->exec_domain && thread->exec_domain->signal_invmap)
|
||||
usig = thread->exec_domain->signal_invmap[usig];
|
||||
|
||||
/*
|
||||
* Set up the stack frame
|
||||
*/
|
||||
|
||||
@@ -17,11 +17,9 @@
|
||||
#include <asm/types.h>
|
||||
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
__u32 cpu;
|
||||
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
@@ -36,7 +34,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
|
||||
@@ -12,7 +12,6 @@
|
||||
void foo(void)
|
||||
{
|
||||
OFFSET(TI_task, thread_info, task);
|
||||
OFFSET(TI_exec_domain, thread_info, exec_domain);
|
||||
OFFSET(TI_flags, thread_info, flags);
|
||||
OFFSET(TI_cpu, thread_info, cpu);
|
||||
OFFSET(TI_preempt_count, thread_info, preempt_count);
|
||||
|
||||
@@ -37,7 +37,6 @@ typedef unsigned long mm_segment_t;
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
int cpu; /* cpu we're on */
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
@@ -53,7 +52,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
@@ -75,15 +73,6 @@ static inline struct thread_info *current_thread_info(void)
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
/*
|
||||
* Offsets in thread_info structure, used in assembly code
|
||||
*/
|
||||
#define TI_TASK 0
|
||||
#define TI_EXECDOMAIN 4
|
||||
#define TI_FLAGS 8
|
||||
#define TI_CPU 12
|
||||
#define TI_PREEMPT 16
|
||||
|
||||
/*
|
||||
* thread information flag bit numbers
|
||||
*/
|
||||
|
||||
@@ -42,6 +42,12 @@ int main(void)
|
||||
DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
|
||||
DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
|
||||
|
||||
/* offsets in thread_info struct */
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
OFFSET(TI_PREEMPT, thread_info, preempt_count);
|
||||
|
||||
/* offsets into the pt_regs */
|
||||
DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0));
|
||||
DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
|
||||
|
||||
@@ -151,11 +151,7 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
|
||||
|
||||
frame = get_sigframe(ksig, sizeof(*frame));
|
||||
|
||||
err |= __put_user((current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& ksig->sig < 32
|
||||
? current_thread_info()->exec_domain->
|
||||
signal_invmap[ksig->sig] : ksig->sig), &frame->sig);
|
||||
err |= __put_user(ksig->sig, &frame->sig);
|
||||
|
||||
err |= __put_user(&frame->info, &frame->pinfo);
|
||||
err |= __put_user(&frame->uc, &frame->puc);
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include <asm/fixed_code.h>
|
||||
#include <asm/pseudo_instructions.h>
|
||||
#include <asm/pda.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
|
||||
#ifdef CONFIG_KGDB
|
||||
# include <linux/kgdb.h>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user