mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 04:18:39 +08: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:
commit
fa2e5c073a
@ -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>
|
||||
|
@ -40,7 +40,6 @@ typedef struct {
|
||||
*/
|
||||
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 */
|
||||
@ -55,7 +54,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, \
|
||||
|
@ -321,8 +321,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
|
||||
/* TODO what is the current->exec_domain stuff and invmap ? */
|
||||
|
||||
/* Set up registers for signal handler */
|
||||
|
||||
/* What we enter NOW */
|
||||
|
@ -287,8 +287,6 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs)
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
/* TODO: what is the current->exec_domain stuff and invmap ? */
|
||||
|
||||
err |= __put_user(&frame->info, &frame->pinfo);
|
||||
err |= __put_user(&frame->uc, &frame->puc);
|
||||
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
|
||||
|
@ -28,7 +28,6 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
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; /* current CPU */
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
@ -50,7 +49,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, \
|
||||
|
@ -31,7 +31,6 @@
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -59,7 +58,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, \
|
||||
|
@ -34,7 +34,6 @@ void foo(void)
|
||||
{
|
||||
/* offsets into the thread_info structure */
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_STATUS, thread_info, status);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
|
@ -174,20 +174,14 @@ static inline void __user *get_sigframe(struct ksignal *ksig,
|
||||
static int setup_frame(struct ksignal *ksig, sigset_t *set)
|
||||
{
|
||||
struct sigframe __user *frame;
|
||||
int rsig, sig = ksig->sig;
|
||||
int sig = ksig->sig;
|
||||
|
||||
frame = get_sigframe(ksig, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
rsig = sig;
|
||||
if (sig < 32 &&
|
||||
__current_thread_info->exec_domain &&
|
||||
__current_thread_info->exec_domain->signal_invmap)
|
||||
rsig = __current_thread_info->exec_domain->signal_invmap[sig];
|
||||
|
||||
if (__put_user(rsig, &frame->sig) < 0)
|
||||
if (__put_user(sig, &frame->sig) < 0)
|
||||
return -EFAULT;
|
||||
|
||||
if (setup_sigcontext(&frame->sc, set->sig[0]))
|
||||
@ -253,20 +247,14 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set)
|
||||
static int setup_rt_frame(struct ksignal *ksig, sigset_t *set)
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
int rsig, sig = ksig->sig;
|
||||
int sig = ksig->sig;
|
||||
|
||||
frame = get_sigframe(ksig, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
rsig = sig;
|
||||
if (sig < 32 &&
|
||||
__current_thread_info->exec_domain &&
|
||||
__current_thread_info->exec_domain->signal_invmap)
|
||||
rsig = __current_thread_info->exec_domain->signal_invmap[sig];
|
||||
|
||||
if (__put_user(rsig, &frame->sig) ||
|
||||
if (__put_user(sig, &frame->sig) ||
|
||||
__put_user(&frame->info, &frame->pinfo) ||
|
||||
__put_user(&frame->uc, &frame->puc))
|
||||
return -EFAULT;
|
||||
|
@ -47,7 +47,6 @@ typedef struct {
|
||||
|
||||
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; /* current cpu */
|
||||
int preempt_count; /* 0=>preemptible,<0=>BUG */
|
||||
@ -77,7 +76,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = 1, \
|
||||
|
@ -20,7 +20,6 @@
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* XXX not really needed, except for dup_task_struct() */
|
||||
struct exec_domain *exec_domain;/* execution domain */
|
||||
__u32 flags; /* thread_info flags (see TIF_*) */
|
||||
__u32 cpu; /* current CPU */
|
||||
__u32 last_cpu; /* Last CPU thread ran on */
|
||||
@ -40,7 +39,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
|
@ -692,31 +692,6 @@ int arch_remove_memory(u64 start, u64 size)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Even when CONFIG_IA32_SUPPORT is not enabled it is
|
||||
* useful to have the Linux/x86 domain registered to
|
||||
* avoid an attempted module load when emulators call
|
||||
* personality(PER_LINUX32). This saves several milliseconds
|
||||
* on each such call.
|
||||
*/
|
||||
static struct exec_domain ia32_exec_domain;
|
||||
|
||||
static int __init
|
||||
per_linux32_init(void)
|
||||
{
|
||||
ia32_exec_domain.name = "Linux/x86";
|
||||
ia32_exec_domain.handler = NULL;
|
||||
ia32_exec_domain.pers_low = PER_LINUX32;
|
||||
ia32_exec_domain.pers_high = PER_LINUX32;
|
||||
ia32_exec_domain.signal_map = default_exec_domain.signal_map;
|
||||
ia32_exec_domain.signal_invmap = default_exec_domain.signal_invmap;
|
||||
register_exec_domain(&ia32_exec_domain);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
__initcall(per_linux32_init);
|
||||
|
||||
/**
|
||||
* show_mem - give short summary of memory stats
|
||||
*
|
||||
|
1
arch/m32r/include/asm/asm-offsets.h
Normal file
1
arch/m32r/include/asm/asm-offsets.h
Normal file
@ -0,0 +1 @@
|
||||
#include <generated/asm-offsets.h>
|
@ -24,7 +24,6 @@
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -38,18 +37,7 @@ struct thread_info {
|
||||
__u8 supervisor_stack[0];
|
||||
};
|
||||
|
||||
#else /* !__ASSEMBLY__ */
|
||||
|
||||
/* offsets into the thread_info struct for assembly code access */
|
||||
#define TI_TASK 0x00000000
|
||||
#define TI_EXEC_DOMAIN 0x00000004
|
||||
#define TI_FLAGS 0x00000008
|
||||
#define TI_STATUS 0x0000000C
|
||||
#define TI_CPU 0x00000010
|
||||
#define TI_PRE_COUNT 0x00000014
|
||||
#define TI_ADDR_LIMIT 0x00000018
|
||||
|
||||
#endif
|
||||
#endif /* !__ASSEMBLY__ */
|
||||
|
||||
#define THREAD_SIZE (PAGE_SIZE << 1)
|
||||
#define THREAD_SIZE_ORDER 1
|
||||
@ -61,7 +49,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, \
|
||||
|
@ -1 +1,14 @@
|
||||
/* Dummy asm-offsets.c file. Required by kbuild and ready to be used - hint! */
|
||||
#include <linux/thread_info.h>
|
||||
#include <linux/kbuild.h>
|
||||
|
||||
int foo(void)
|
||||
{
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_STATUS, thread_info, status);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
|
||||
OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -65,6 +65,7 @@
|
||||
#include <asm/page.h>
|
||||
#include <asm/m32r.h>
|
||||
#include <asm/mmu_context.h>
|
||||
#include <asm/asm-offsets.h>
|
||||
|
||||
#if !defined(CONFIG_MMU)
|
||||
#define sys_madvise sys_ni_syscall
|
||||
|
@ -172,20 +172,14 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
int err = 0;
|
||||
int signal, sig = ksig->sig;
|
||||
int sig = ksig->sig;
|
||||
|
||||
frame = get_sigframe(ksig, regs->spu, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
err |= __put_user(signal, &frame->sig);
|
||||
err |= __put_user(sig, &frame->sig);
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
|
||||
@ -209,7 +203,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
|
||||
/* Set up registers for signal handler */
|
||||
regs->spu = (unsigned long)frame;
|
||||
regs->r0 = signal; /* Arg for signal handler */
|
||||
regs->r0 = sig; /* Arg for signal handler */
|
||||
regs->r1 = (unsigned long)&frame->info;
|
||||
regs->r2 = (unsigned long)&frame->uc;
|
||||
regs->bpc = (unsigned long)ksig->ka.sa.sa_handler;
|
||||
|
@ -26,7 +26,6 @@
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
unsigned long flags;
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
mm_segment_t addr_limit; /* thread address space */
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
__u32 cpu; /* should always be 0 on m68k */
|
||||
@ -37,7 +36,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, \
|
||||
}
|
||||
|
@ -863,12 +863,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
if (fsize)
|
||||
err |= copy_to_user (frame + 1, regs + 1, fsize);
|
||||
|
||||
err |= __put_user((current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig),
|
||||
&frame->sig);
|
||||
err |= __put_user(sig, &frame->sig);
|
||||
|
||||
err |= __put_user(regs->vector, &frame->code);
|
||||
err |= __put_user(&frame->sc, &frame->psc);
|
||||
@ -948,12 +943,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
if (fsize)
|
||||
err |= copy_to_user (&frame->uc.uc_extra, regs + 1, fsize);
|
||||
|
||||
err |= __put_user((current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig),
|
||||
&frame->sig);
|
||||
err |= __put_user(sig, &frame->sig);
|
||||
err |= __put_user(&frame->info, &frame->pinfo);
|
||||
err |= __put_user(&frame->uc, &frame->puc);
|
||||
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
|
||||
|
@ -28,7 +28,6 @@
|
||||
/* This must be 8 byte aligned so we can ensure stack alignment. */
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
u32 cpu; /* current CPU */
|
||||
@ -68,7 +67,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, \
|
||||
|
@ -132,7 +132,6 @@ void irq_ctx_init(int cpu)
|
||||
|
||||
irqctx = (union irq_ctx *) &hardirq_stack[cpu * THREAD_SIZE];
|
||||
irqctx->tinfo.task = NULL;
|
||||
irqctx->tinfo.exec_domain = NULL;
|
||||
irqctx->tinfo.cpu = cpu;
|
||||
irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
|
||||
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
|
||||
@ -141,7 +140,6 @@ void irq_ctx_init(int cpu)
|
||||
|
||||
irqctx = (union irq_ctx *) &softirq_stack[cpu * THREAD_SIZE];
|
||||
irqctx->tinfo.task = NULL;
|
||||
irqctx->tinfo.exec_domain = NULL;
|
||||
irqctx->tinfo.cpu = cpu;
|
||||
irqctx->tinfo.preempt_count = 0;
|
||||
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
|
||||
|
@ -65,7 +65,6 @@ typedef struct {
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -81,7 +80,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, \
|
||||
|
@ -158,7 +158,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
unsigned long signal;
|
||||
unsigned long address = 0;
|
||||
#ifdef CONFIG_MMU
|
||||
pmd_t *pmdp;
|
||||
@ -170,12 +169,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: (unsigned long)sig;
|
||||
|
||||
if (ksig->ka.sa.sa_flags & SA_SIGINFO)
|
||||
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
|
||||
|
||||
@ -230,7 +223,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
regs->r1 = (unsigned long) frame;
|
||||
|
||||
/* Signal handler args: */
|
||||
regs->r5 = signal; /* arg 0: signum */
|
||||
regs->r5 = sig; /* arg 0: signum */
|
||||
regs->r6 = (unsigned long) &frame->info; /* arg 1: siginfo */
|
||||
regs->r7 = (unsigned long) &frame->uc; /* arg2: ucontext */
|
||||
/* Offset to handle microblaze rtid r14, 0 */
|
||||
|
@ -23,7 +23,6 @@
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long tp_value; /* thread pointer */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -44,7 +43,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = _TIF_FIXADE, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
|
@ -92,7 +92,6 @@ void output_thread_info_defines(void)
|
||||
{
|
||||
COMMENT("MIPS thread_info offsets.");
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_TP_VALUE, thread_info, tp_value);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
|
@ -40,7 +40,6 @@ typedef struct {
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
struct pt_regs *frame; /* current exception frame */
|
||||
unsigned long flags; /* low level flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -74,7 +73,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, \
|
||||
|
@ -22,7 +22,6 @@ void foo(void)
|
||||
BLANK();
|
||||
|
||||
OFFSET(TI_task, thread_info, task);
|
||||
OFFSET(TI_exec_domain, thread_info, exec_domain);
|
||||
OFFSET(TI_frame, thread_info, frame);
|
||||
OFFSET(TI_flags, thread_info, flags);
|
||||
OFFSET(TI_cpu, thread_info, cpu);
|
||||
@ -85,7 +84,6 @@ void foo(void)
|
||||
DEFINE(SIGCHLD_asm, SIGCHLD);
|
||||
BLANK();
|
||||
|
||||
OFFSET(EXEC_DOMAIN_handler, exec_domain, handler);
|
||||
OFFSET(RT_SIGFRAME_sigcontext, rt_sigframe, uc.uc_mcontext);
|
||||
|
||||
DEFINE(PAGE_SIZE_asm, PAGE_SIZE);
|
||||
|
@ -202,20 +202,14 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
struct sigframe __user *frame;
|
||||
int rsig, sig = ksig->sig;
|
||||
int sig = ksig->sig;
|
||||
|
||||
frame = get_sigframe(ksig, regs, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
rsig = sig;
|
||||
if (sig < 32 &&
|
||||
current_thread_info()->exec_domain &&
|
||||
current_thread_info()->exec_domain->signal_invmap)
|
||||
rsig = current_thread_info()->exec_domain->signal_invmap[sig];
|
||||
|
||||
if (__put_user(rsig, &frame->sig) < 0 ||
|
||||
if (__put_user(sig, &frame->sig) < 0 ||
|
||||
__put_user(&frame->sc, &frame->psc) < 0)
|
||||
return -EFAULT;
|
||||
|
||||
@ -270,20 +264,14 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
int rsig, sig = ksig->sig;
|
||||
int sig = ksig->sig;
|
||||
|
||||
frame = get_sigframe(ksig, regs, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
rsig = sig;
|
||||
if (sig < 32 &&
|
||||
current_thread_info()->exec_domain &&
|
||||
current_thread_info()->exec_domain->signal_invmap)
|
||||
rsig = current_thread_info()->exec_domain->signal_invmap[sig];
|
||||
|
||||
if (__put_user(rsig, &frame->sig) ||
|
||||
if (__put_user(sig, &frame->sig) ||
|
||||
__put_user(&frame->info, &frame->pinfo) ||
|
||||
__put_user(&frame->uc, &frame->puc) ||
|
||||
copy_siginfo_to_user(&frame->info, &ksig->info))
|
||||
|
@ -39,7 +39,6 @@ typedef struct {
|
||||
*/
|
||||
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; /* current CPU */
|
||||
int preempt_count; /* 0 => preemptable,<0 => BUG */
|
||||
@ -58,7 +57,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, \
|
||||
|
@ -48,7 +48,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 */
|
||||
__u32 cpu; /* current CPU */
|
||||
__s32 preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
@ -73,7 +72,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = 1, \
|
||||
|
@ -193,8 +193,6 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
if (err)
|
||||
return -EFAULT;
|
||||
|
||||
/* TODO what is the current->exec_domain stuff and invmap ? */
|
||||
|
||||
/* Set up registers for signal handler */
|
||||
regs->pc = (unsigned long)ksig->ka.sa.sa_handler; /* what we enter NOW */
|
||||
regs->gpr[9] = (unsigned long)return_ip; /* what we enter LATER */
|
||||
|
@ -9,7 +9,6 @@
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain;/* execution domain */
|
||||
unsigned long flags; /* thread_info flags (see TIF_*) */
|
||||
mm_segment_t addr_limit; /* user-level address space limit */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -19,7 +18,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
|
@ -242,7 +242,6 @@ int main(void)
|
||||
DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN));
|
||||
BLANK();
|
||||
DEFINE(TI_TASK, offsetof(struct thread_info, task));
|
||||
DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
|
||||
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
|
||||
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
|
||||
DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit));
|
||||
|
@ -39,7 +39,6 @@
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
int cpu; /* cpu we're on */
|
||||
int preempt_count; /* 0 => preemptable,
|
||||
<0 => BUG */
|
||||
@ -55,7 +54,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
.flags = 0, \
|
||||
|
@ -29,7 +29,6 @@
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long sys_call_table; /* System call table address */
|
||||
unsigned int cpu; /* current CPU */
|
||||
@ -46,7 +45,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, \
|
||||
|
@ -34,7 +34,6 @@ int main(void)
|
||||
DEFINE(__THREAD_per_paid, offsetof(struct task_struct, thread.per_event.paid));
|
||||
BLANK();
|
||||
DEFINE(__TI_task, offsetof(struct thread_info, task));
|
||||
DEFINE(__TI_domain, offsetof(struct thread_info, exec_domain));
|
||||
DEFINE(__TI_flags, offsetof(struct thread_info, flags));
|
||||
DEFINE(__TI_sysc_table, offsetof(struct thread_info, sys_call_table));
|
||||
DEFINE(__TI_cpu, offsetof(struct thread_info, cpu));
|
||||
|
@ -370,16 +370,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
|
||||
return (void __user *)((sp - frame_size) & -8ul);
|
||||
}
|
||||
|
||||
static inline int map_signal(int sig)
|
||||
{
|
||||
if (current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32)
|
||||
return current_thread_info()->exec_domain->signal_invmap[sig];
|
||||
else
|
||||
return sig;
|
||||
}
|
||||
|
||||
static int setup_frame32(struct ksignal *ksig, sigset_t *set,
|
||||
struct pt_regs *regs)
|
||||
{
|
||||
@ -449,7 +439,7 @@ static int setup_frame32(struct ksignal *ksig, sigset_t *set,
|
||||
(regs->psw.mask & ~PSW_MASK_ASC);
|
||||
regs->psw.addr = (__force __u64) ksig->ka.sa.sa_handler;
|
||||
|
||||
regs->gprs[2] = map_signal(sig);
|
||||
regs->gprs[2] = sig;
|
||||
regs->gprs[3] = (__force __u64) &frame->sc;
|
||||
|
||||
/* We forgot to include these in the sigcontext.
|
||||
@ -532,7 +522,7 @@ static int setup_rt_frame32(struct ksignal *ksig, sigset_t *set,
|
||||
(regs->psw.mask & ~PSW_MASK_ASC);
|
||||
regs->psw.addr = (__u64 __force) ksig->ka.sa.sa_handler;
|
||||
|
||||
regs->gprs[2] = map_signal(ksig->sig);
|
||||
regs->gprs[2] = ksig->sig;
|
||||
regs->gprs[3] = (__force __u64) &frame->info;
|
||||
regs->gprs[4] = (__force __u64) &frame->uc;
|
||||
regs->gprs[5] = task_thread_info(current)->last_break;
|
||||
|
@ -301,16 +301,6 @@ get_sigframe(struct k_sigaction *ka, struct pt_regs * regs, size_t frame_size)
|
||||
return (void __user *)((sp - frame_size) & -8ul);
|
||||
}
|
||||
|
||||
static inline int map_signal(int sig)
|
||||
{
|
||||
if (current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32)
|
||||
return current_thread_info()->exec_domain->signal_invmap[sig];
|
||||
else
|
||||
return sig;
|
||||
}
|
||||
|
||||
static int setup_frame(int sig, struct k_sigaction *ka,
|
||||
sigset_t *set, struct pt_regs * regs)
|
||||
{
|
||||
@ -378,7 +368,7 @@ static int setup_frame(int sig, struct k_sigaction *ka,
|
||||
(regs->psw.mask & ~PSW_MASK_ASC);
|
||||
regs->psw.addr = (unsigned long) ka->sa.sa_handler | PSW_ADDR_AMODE;
|
||||
|
||||
regs->gprs[2] = map_signal(sig);
|
||||
regs->gprs[2] = sig;
|
||||
regs->gprs[3] = (unsigned long) &frame->sc;
|
||||
|
||||
/* We forgot to include these in the sigcontext.
|
||||
@ -458,7 +448,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
(regs->psw.mask & ~PSW_MASK_ASC);
|
||||
regs->psw.addr = (unsigned long) ksig->ka.sa.sa_handler | PSW_ADDR_AMODE;
|
||||
|
||||
regs->gprs[2] = map_signal(ksig->sig);
|
||||
regs->gprs[2] = ksig->sig;
|
||||
regs->gprs[3] = (unsigned long) &frame->info;
|
||||
regs->gprs[4] = (unsigned long) &frame->uc;
|
||||
regs->gprs[5] = task_thread_info(current)->last_break;
|
||||
|
@ -28,7 +28,6 @@
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long tp_value; /* thread pointer */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -53,7 +52,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = 1, \
|
||||
.addr_limit = KERNEL_DS, \
|
||||
|
@ -100,7 +100,6 @@ void output_thread_info_defines(void)
|
||||
{
|
||||
COMMENT("SCORE thread_info offsets.");
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_EXEC_DOMAIN, thread_info, exec_domain);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_TP_VALUE, thread_info, tp_value);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
|
@ -27,7 +27,6 @@
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
__u32 status; /* thread synchronous flags */
|
||||
__u32 cpu;
|
||||
@ -56,7 +55,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.status = 0, \
|
||||
.cpu = 0, \
|
||||
|
@ -21,7 +21,6 @@ int main(void)
|
||||
{
|
||||
/* offsets into the thread_info struct */
|
||||
DEFINE(TI_TASK, offsetof(struct thread_info, task));
|
||||
DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain));
|
||||
DEFINE(TI_FLAGS, offsetof(struct thread_info, flags));
|
||||
DEFINE(TI_CPU, offsetof(struct thread_info, cpu));
|
||||
DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count));
|
||||
|
@ -124,7 +124,6 @@ void irq_ctx_init(int cpu)
|
||||
|
||||
irqctx = (union irq_ctx *)&hardirq_stack[cpu * THREAD_SIZE];
|
||||
irqctx->tinfo.task = NULL;
|
||||
irqctx->tinfo.exec_domain = NULL;
|
||||
irqctx->tinfo.cpu = cpu;
|
||||
irqctx->tinfo.preempt_count = HARDIRQ_OFFSET;
|
||||
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
|
||||
@ -133,7 +132,6 @@ void irq_ctx_init(int cpu)
|
||||
|
||||
irqctx = (union irq_ctx *)&softirq_stack[cpu * THREAD_SIZE];
|
||||
irqctx->tinfo.task = NULL;
|
||||
irqctx->tinfo.exec_domain = NULL;
|
||||
irqctx->tinfo.cpu = cpu;
|
||||
irqctx->tinfo.preempt_count = 0;
|
||||
irqctx->tinfo.addr_limit = MAKE_MM_SEG(0);
|
||||
|
@ -267,19 +267,12 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
{
|
||||
struct sigframe __user *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
int signal;
|
||||
|
||||
frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
|
||||
|
||||
if (_NSIG_WORDS > 1)
|
||||
@ -313,7 +306,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
|
||||
/* Set up registers for signal handler */
|
||||
regs->regs[15] = (unsigned long) frame;
|
||||
regs->regs[4] = signal; /* Arg for signal handler */
|
||||
regs->regs[4] = sig; /* Arg for signal handler */
|
||||
regs->regs[5] = 0;
|
||||
regs->regs[6] = (unsigned long) &frame->sc;
|
||||
|
||||
@ -340,19 +333,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
int signal;
|
||||
|
||||
frame = get_sigframe(&ksig->ka, regs->regs[15], sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
|
||||
|
||||
/* Create the ucontext. */
|
||||
@ -390,7 +376,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
|
||||
/* Set up registers for signal handler */
|
||||
regs->regs[15] = (unsigned long) frame;
|
||||
regs->regs[4] = signal; /* Arg for signal handler */
|
||||
regs->regs[4] = sig; /* Arg for signal handler */
|
||||
regs->regs[5] = (unsigned long) &frame->info;
|
||||
regs->regs[6] = (unsigned long) &frame->uc;
|
||||
|
||||
|
@ -385,12 +385,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
err |= setup_sigcontext(&frame->sc, regs, set->sig[0]);
|
||||
|
||||
/* 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
|
||||
* All edited pointers are subject to NEFF.
|
||||
*/
|
||||
regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
|
||||
regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
|
||||
regs->regs[REG_ARG1] = sig; /* Arg for signal handler */
|
||||
|
||||
/* FIXME:
|
||||
The glibc profiling support for SH-5 needs to be passed a sigcontext
|
||||
@ -459,7 +453,7 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs
|
||||
|
||||
/* Broken %016Lx */
|
||||
pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n",
|
||||
signal, current->comm, current->pid, frame,
|
||||
sig, current->comm, current->pid, frame,
|
||||
regs->pc >> 32, regs->pc & 0xffffffff,
|
||||
DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff);
|
||||
|
||||
@ -471,19 +465,12 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
|
||||
{
|
||||
struct rt_sigframe __user *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
int signal;
|
||||
|
||||
frame = get_sigframe(&ksig->ka, regs->regs[REG_SP], sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
return -EFAULT;
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
err |= __put_user(&frame->info, &frame->pinfo);
|
||||
err |= __put_user(&frame->uc, &frame->puc);
|
||||
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
|
||||
@ -540,13 +527,13 @@ static int setup_rt_frame(struct ksignal *kig, sigset_t *set,
|
||||
* All edited pointers are subject to NEFF.
|
||||
*/
|
||||
regs->regs[REG_SP] = neff_sign_extend((unsigned long)frame);
|
||||
regs->regs[REG_ARG1] = signal; /* Arg for signal handler */
|
||||
regs->regs[REG_ARG1] = sig; /* Arg for signal handler */
|
||||
regs->regs[REG_ARG2] = (unsigned long long)(unsigned long)(signed long)&frame->info;
|
||||
regs->regs[REG_ARG3] = (unsigned long long)(unsigned long)(signed long)&frame->uc.uc_mcontext;
|
||||
regs->pc = neff_sign_extend((unsigned long)ksig->ka.sa.sa_handler);
|
||||
|
||||
pr_debug("SIG deliver (#%d,%s:%d): sp=%p pc=%08Lx%08Lx link=%08Lx%08Lx\n",
|
||||
signal, current->comm, current->pid, frame,
|
||||
sig, current->comm, current->pid, frame,
|
||||
regs->pc >> 32, regs->pc & 0xffffffff,
|
||||
DEREF_REG_PR >> 32, DEREF_REG_PR & 0xffffffff);
|
||||
|
||||
|
@ -27,7 +27,6 @@
|
||||
struct thread_info {
|
||||
unsigned long uwinmask;
|
||||
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,
|
||||
@ -35,6 +34,8 @@ struct thread_info {
|
||||
int softirq_count;
|
||||
int hardirq_count;
|
||||
|
||||
u32 __unused;
|
||||
|
||||
/* Context switch saved kernel state. */
|
||||
unsigned long ksp; /* ... ksp __attribute__ ((aligned (8))); */
|
||||
unsigned long kpc;
|
||||
@ -56,7 +57,6 @@ struct thread_info {
|
||||
{ \
|
||||
.uwinmask = 0, \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
@ -85,12 +85,11 @@ register struct thread_info *current_thread_info_reg asm("g6");
|
||||
*/
|
||||
#define TI_UWINMASK 0x00 /* uwinmask */
|
||||
#define TI_TASK 0x04
|
||||
#define TI_EXECDOMAIN 0x08 /* exec_domain */
|
||||
#define TI_FLAGS 0x0c
|
||||
#define TI_CPU 0x10
|
||||
#define TI_PREEMPT 0x14 /* preempt_count */
|
||||
#define TI_SOFTIRQ 0x18 /* softirq_count */
|
||||
#define TI_HARDIRQ 0x1c /* hardirq_count */
|
||||
#define TI_FLAGS 0x08
|
||||
#define TI_CPU 0x0c
|
||||
#define TI_PREEMPT 0x10 /* preempt_count */
|
||||
#define TI_SOFTIRQ 0x14 /* softirq_count */
|
||||
#define TI_HARDIRQ 0x18 /* hardirq_count */
|
||||
#define TI_KSP 0x20 /* ksp */
|
||||
#define TI_KPC 0x24 /* kpc (ldd'ed with kpc) */
|
||||
#define TI_KPSR 0x28 /* kpsr */
|
||||
|
@ -31,7 +31,6 @@
|
||||
#include <asm/types.h>
|
||||
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
|
||||
struct thread_info {
|
||||
/* D$ line 1 */
|
||||
@ -44,7 +43,6 @@ struct thread_info {
|
||||
/* D$ line 2 */
|
||||
unsigned long fault_address;
|
||||
struct pt_regs *kregs;
|
||||
struct exec_domain *exec_domain;
|
||||
int preempt_count; /* 0 => preemptable, <0 => BUG */
|
||||
__u8 new_child;
|
||||
__u8 current_ds;
|
||||
@ -80,18 +78,17 @@ struct thread_info {
|
||||
#define TI_KSP 0x00000018
|
||||
#define TI_FAULT_ADDR 0x00000020
|
||||
#define TI_KREGS 0x00000028
|
||||
#define TI_EXEC_DOMAIN 0x00000030
|
||||
#define TI_PRE_COUNT 0x00000038
|
||||
#define TI_NEW_CHILD 0x0000003c
|
||||
#define TI_CURRENT_DS 0x0000003d
|
||||
#define TI_CPU 0x0000003e
|
||||
#define TI_UTRAPS 0x00000040
|
||||
#define TI_REG_WINDOW 0x00000048
|
||||
#define TI_RWIN_SPTRS 0x000003c8
|
||||
#define TI_GSR 0x00000400
|
||||
#define TI_XFSR 0x00000438
|
||||
#define TI_KUNA_REGS 0x00000470
|
||||
#define TI_KUNA_INSN 0x00000478
|
||||
#define TI_PRE_COUNT 0x00000030
|
||||
#define TI_NEW_CHILD 0x00000034
|
||||
#define TI_CURRENT_DS 0x00000035
|
||||
#define TI_CPU 0x00000036
|
||||
#define TI_UTRAPS 0x00000038
|
||||
#define TI_REG_WINDOW 0x00000040
|
||||
#define TI_RWIN_SPTRS 0x000003c0
|
||||
#define TI_GSR 0x000003f8
|
||||
#define TI_XFSR 0x00000430
|
||||
#define TI_KUNA_REGS 0x00000468
|
||||
#define TI_KUNA_INSN 0x00000470
|
||||
#define TI_FPREGS 0x00000480
|
||||
|
||||
/* We embed this in the uppermost byte of thread_info->flags */
|
||||
@ -119,7 +116,6 @@ struct thread_info {
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.current_ds = ASI_P, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.preempt_count = INIT_PREEMPT_COUNT, \
|
||||
}
|
||||
|
||||
|
@ -433,7 +433,6 @@ void trap_init(void)
|
||||
/* Force linker to barf if mismatched */
|
||||
if (TI_UWINMASK != offsetof(struct thread_info, uwinmask) ||
|
||||
TI_TASK != offsetof(struct thread_info, task) ||
|
||||
TI_EXECDOMAIN != offsetof(struct thread_info, exec_domain) ||
|
||||
TI_FLAGS != offsetof(struct thread_info, flags) ||
|
||||
TI_CPU != offsetof(struct thread_info, cpu) ||
|
||||
TI_PREEMPT != offsetof(struct thread_info, preempt_count) ||
|
||||
|
@ -2691,8 +2691,6 @@ void __init trap_init(void)
|
||||
fault_address) ||
|
||||
TI_KREGS != offsetof(struct thread_info, kregs) ||
|
||||
TI_UTRAPS != offsetof(struct thread_info, utraps) ||
|
||||
TI_EXEC_DOMAIN != offsetof(struct thread_info,
|
||||
exec_domain) ||
|
||||
TI_REG_WINDOW != offsetof(struct thread_info,
|
||||
reg_window) ||
|
||||
TI_RWIN_SPTRS != offsetof(struct thread_info,
|
||||
|
@ -26,7 +26,6 @@
|
||||
*/
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
__u32 homecache_cpu; /* CPU we are homecached on */
|
||||
@ -51,7 +50,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, \
|
||||
|
@ -196,19 +196,12 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
unsigned long restorer;
|
||||
struct compat_rt_sigframe __user *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
int usig;
|
||||
|
||||
frame = compat_get_sigframe(&ksig->ka, regs, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
goto err;
|
||||
|
||||
usig = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
/* Always write at least the signal number for the stack backtracer. */
|
||||
if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
|
||||
/* At sigreturn time, restore the callee-save registers too. */
|
||||
@ -243,7 +236,7 @@ int compat_setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
|
||||
regs->sp = ptr_to_compat_reg(frame);
|
||||
regs->lr = restorer;
|
||||
regs->regs[0] = (unsigned long) usig;
|
||||
regs->regs[0] = (unsigned long) sig;
|
||||
regs->regs[1] = ptr_to_compat_reg(&frame->info);
|
||||
regs->regs[2] = ptr_to_compat_reg(&frame->uc);
|
||||
regs->flags |= PT_FLAGS_CALLER_SAVES;
|
||||
|
@ -151,19 +151,12 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
unsigned long restorer;
|
||||
struct rt_sigframe __user *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
int usig;
|
||||
|
||||
frame = get_sigframe(&ksig->ka, regs, sizeof(*frame));
|
||||
|
||||
if (!access_ok(VERIFY_WRITE, frame, sizeof(*frame)))
|
||||
goto err;
|
||||
|
||||
usig = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
/* Always write at least the signal number for the stack backtracer. */
|
||||
if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
|
||||
/* At sigreturn time, restore the callee-save registers too. */
|
||||
@ -198,7 +191,7 @@ static int setup_rt_frame(struct ksignal *ksig, sigset_t *set,
|
||||
regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
|
||||
regs->sp = (unsigned long) frame;
|
||||
regs->lr = restorer;
|
||||
regs->regs[0] = (unsigned long) usig;
|
||||
regs->regs[0] = (unsigned long) sig;
|
||||
regs->regs[1] = (unsigned long) &frame->info;
|
||||
regs->regs[2] = (unsigned long) &frame->uc;
|
||||
regs->flags |= PT_FLAGS_CALLER_SAVES;
|
||||
|
@ -14,7 +14,6 @@
|
||||
|
||||
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; /* current CPU */
|
||||
int preempt_count; /* 0 => preemptable,
|
||||
@ -28,7 +27,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, \
|
||||
|
@ -24,7 +24,6 @@
|
||||
#ifndef __ASSEMBLY__
|
||||
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
|
||||
#include <asm/types.h>
|
||||
|
||||
@ -71,7 +70,6 @@ struct thread_info {
|
||||
/* <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 */
|
||||
struct cpu_context_save cpu_context; /* cpu context */
|
||||
__u32 syscall; /* syscall number */
|
||||
@ -84,7 +82,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, \
|
||||
|
@ -42,7 +42,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_SAVE, offsetof(struct thread_info, cpu_context));
|
||||
DEFINE(TI_USED_CP, offsetof(struct thread_info, used_cp));
|
||||
|
@ -329,13 +329,6 @@ static void handle_signal(struct ksignal *ksig, struct pt_regs *regs,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
@ -46,13 +46,11 @@
|
||||
*/
|
||||
#ifndef __ASSEMBLY__
|
||||
struct task_struct;
|
||||
struct exec_domain;
|
||||
#include <asm/processor.h>
|
||||
#include <linux/atomic.h>
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
__u32 flags; /* low level flags */
|
||||
__u32 status; /* thread synchronous flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -66,7 +64,6 @@ struct thread_info {
|
||||
#define INIT_THREAD_INFO(tsk) \
|
||||
{ \
|
||||
.task = &tsk, \
|
||||
.exec_domain = &default_exec_domain, \
|
||||
.flags = 0, \
|
||||
.cpu = 0, \
|
||||
.saved_preempt_count = INIT_PREEMPT_COUNT, \
|
||||
|
@ -593,24 +593,10 @@ badframe:
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* OK, we're invoking a handler:
|
||||
*/
|
||||
static int signr_convert(int sig)
|
||||
{
|
||||
#ifdef CONFIG_X86_32
|
||||
struct thread_info *info = current_thread_info();
|
||||
|
||||
if (info->exec_domain && info->exec_domain->signal_invmap && sig < 32)
|
||||
return info->exec_domain->signal_invmap[sig];
|
||||
#endif /* CONFIG_X86_32 */
|
||||
return sig;
|
||||
}
|
||||
|
||||
static int
|
||||
setup_rt_frame(struct ksignal *ksig, struct pt_regs *regs)
|
||||
{
|
||||
int usig = signr_convert(ksig->sig);
|
||||
int usig = ksig->sig;
|
||||
sigset_t *set = sigmask_to_save();
|
||||
compat_sigset_t *cset = (compat_sigset_t *) set;
|
||||
|
||||
|
@ -549,13 +549,6 @@ int setup_signal_stack_si(unsigned long stack_top, struct ksignal *ksig,
|
||||
if (err)
|
||||
return err;
|
||||
|
||||
/* Set up registers for signal handler */
|
||||
{
|
||||
struct exec_domain *ed = current_thread_info()->exec_domain;
|
||||
if (unlikely(ed && ed->signal_invmap && sig < 32))
|
||||
sig = ed->signal_invmap[sig];
|
||||
}
|
||||
|
||||
PT_REGS_SP(regs) = (unsigned long) frame;
|
||||
PT_REGS_DI(regs) = sig;
|
||||
/* In case the signal handler was declared without prototypes */
|
||||
|
@ -44,7 +44,6 @@ typedef struct xtregs_coprocessor {
|
||||
|
||||
struct thread_info {
|
||||
struct task_struct *task; /* main task structure */
|
||||
struct exec_domain *exec_domain; /* execution domain */
|
||||
unsigned long flags; /* low level flags */
|
||||
unsigned long status; /* thread-synchronous flags */
|
||||
__u32 cpu; /* current CPU */
|
||||
@ -61,17 +60,6 @@ struct thread_info {
|
||||
xtregs_user_t xtregs_user;
|
||||
};
|
||||
|
||||
#else /* !__ASSEMBLY__ */
|
||||
|
||||
/* offsets into the thread_info struct for assembly code access */
|
||||
#define TI_TASK 0x00000000
|
||||
#define TI_EXEC_DOMAIN 0x00000004
|
||||
#define TI_FLAGS 0x00000008
|
||||
#define TI_STATUS 0x0000000C
|
||||
#define TI_CPU 0x00000010
|
||||
#define TI_PRE_COUNT 0x00000014
|
||||
#define TI_ADDR_LIMIT 0x00000018
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
@ -83,7 +71,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, \
|
||||
|
@ -77,6 +77,14 @@ int main(void)
|
||||
DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack));
|
||||
DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct));
|
||||
|
||||
/* offsets in thread_info struct */
|
||||
OFFSET(TI_TASK, thread_info, task);
|
||||
OFFSET(TI_FLAGS, thread_info, flags);
|
||||
OFFSET(TI_STSTUS, thread_info, status);
|
||||
OFFSET(TI_CPU, thread_info, cpu);
|
||||
OFFSET(TI_PRE_COUNT, thread_info, preempt_count);
|
||||
OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit);
|
||||
|
||||
/* struct thread_info (offset from start_struct) */
|
||||
DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra));
|
||||
DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp));
|
||||
|
@ -336,7 +336,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
{
|
||||
struct rt_sigframe *frame;
|
||||
int err = 0, sig = ksig->sig;
|
||||
int signal;
|
||||
unsigned long sp, ra, tp;
|
||||
|
||||
sp = regs->areg[1];
|
||||
@ -354,12 +353,6 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
return -EFAULT;
|
||||
}
|
||||
|
||||
signal = current_thread_info()->exec_domain
|
||||
&& current_thread_info()->exec_domain->signal_invmap
|
||||
&& sig < 32
|
||||
? current_thread_info()->exec_domain->signal_invmap[sig]
|
||||
: sig;
|
||||
|
||||
if (ksig->ka.sa.sa_flags & SA_SIGINFO) {
|
||||
err |= copy_siginfo_to_user(&frame->info, &ksig->info);
|
||||
}
|
||||
@ -400,14 +393,14 @@ static int setup_frame(struct ksignal *ksig, sigset_t *set,
|
||||
* Note: PS.CALLINC is set to one by start_thread
|
||||
*/
|
||||
regs->areg[4] = (((unsigned long) ra) & 0x3fffffff) | 0x40000000;
|
||||
regs->areg[6] = (unsigned long) signal;
|
||||
regs->areg[6] = (unsigned long) sig;
|
||||
regs->areg[7] = (unsigned long) &frame->info;
|
||||
regs->areg[8] = (unsigned long) &frame->uc;
|
||||
regs->threadptr = tp;
|
||||
|
||||
#if DEBUG_SIG
|
||||
printk("SIG rt deliver (%s:%d): signal=%d sp=%p pc=%08x\n",
|
||||
current->comm, current->pid, signal, frame, regs->pc);
|
||||
current->comm, current->pid, sig, frame, regs->pc);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
|
@ -3,52 +3,14 @@
|
||||
|
||||
#include <uapi/linux/personality.h>
|
||||
|
||||
|
||||
/*
|
||||
* Handling of different ABIs (personalities).
|
||||
*/
|
||||
|
||||
struct exec_domain;
|
||||
struct pt_regs;
|
||||
|
||||
extern int register_exec_domain(struct exec_domain *);
|
||||
extern int unregister_exec_domain(struct exec_domain *);
|
||||
extern int __set_personality(unsigned int);
|
||||
|
||||
|
||||
/*
|
||||
* Description of an execution domain.
|
||||
*
|
||||
* The first two members are refernced from assembly source
|
||||
* and should stay where they are unless explicitly needed.
|
||||
*/
|
||||
typedef void (*handler_t)(int, struct pt_regs *);
|
||||
|
||||
struct exec_domain {
|
||||
const char *name; /* name of the execdomain */
|
||||
handler_t handler; /* handler for syscalls */
|
||||
unsigned char pers_low; /* lowest personality */
|
||||
unsigned char pers_high; /* highest personality */
|
||||
unsigned long *signal_map; /* signal mapping */
|
||||
unsigned long *signal_invmap; /* reverse signal mapping */
|
||||
struct map_segment *err_map; /* error mapping */
|
||||
struct map_segment *socktype_map; /* socket type mapping */
|
||||
struct map_segment *sockopt_map; /* socket option mapping */
|
||||
struct map_segment *af_map; /* address family mapping */
|
||||
struct module *module; /* module context of the ed. */
|
||||
struct exec_domain *next; /* linked list (internal) */
|
||||
};
|
||||
|
||||
/*
|
||||
* Return the base personality without flags.
|
||||
*/
|
||||
#define personality(pers) (pers & PER_MASK)
|
||||
|
||||
|
||||
/*
|
||||
* Change personality of the currently running process.
|
||||
*/
|
||||
#define set_personality(pers) \
|
||||
((current->personality == (pers)) ? 0 : __set_personality(pers))
|
||||
#define set_personality(pers) (current->personality = (pers))
|
||||
|
||||
#endif /* _LINUX_PERSONALITY_H */
|
||||
|
@ -125,7 +125,6 @@ struct sched_attr {
|
||||
u64 sched_period;
|
||||
};
|
||||
|
||||
struct exec_domain;
|
||||
struct futex_pi_state;
|
||||
struct robust_list_head;
|
||||
struct bio_list;
|
||||
@ -2311,11 +2310,6 @@ extern void set_curr_task(int cpu, struct task_struct *p);
|
||||
|
||||
void yield(void);
|
||||
|
||||
/*
|
||||
* The default (Linux) execution domain.
|
||||
*/
|
||||
extern struct exec_domain default_exec_domain;
|
||||
|
||||
union thread_union {
|
||||
struct thread_info thread_info;
|
||||
unsigned long stack[THREAD_SIZE/sizeof(long)];
|
||||
|
@ -20,145 +20,10 @@
|
||||
#include <linux/types.h>
|
||||
#include <linux/fs_struct.h>
|
||||
|
||||
|
||||
static void default_handler(int, struct pt_regs *);
|
||||
|
||||
static struct exec_domain *exec_domains = &default_exec_domain;
|
||||
static DEFINE_RWLOCK(exec_domains_lock);
|
||||
|
||||
|
||||
static unsigned long ident_map[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
|
||||
};
|
||||
|
||||
struct exec_domain default_exec_domain = {
|
||||
.name = "Linux", /* name */
|
||||
.handler = default_handler, /* lcall7 causes a seg fault. */
|
||||
.pers_low = 0, /* PER_LINUX personality. */
|
||||
.pers_high = 0, /* PER_LINUX personality. */
|
||||
.signal_map = ident_map, /* Identity map signals. */
|
||||
.signal_invmap = ident_map, /* - both ways. */
|
||||
};
|
||||
|
||||
|
||||
static void
|
||||
default_handler(int segment, struct pt_regs *regp)
|
||||
{
|
||||
set_personality(0);
|
||||
|
||||
if (current_thread_info()->exec_domain->handler != default_handler)
|
||||
current_thread_info()->exec_domain->handler(segment, regp);
|
||||
else
|
||||
send_sig(SIGSEGV, current, 1);
|
||||
}
|
||||
|
||||
static struct exec_domain *
|
||||
lookup_exec_domain(unsigned int personality)
|
||||
{
|
||||
unsigned int pers = personality(personality);
|
||||
struct exec_domain *ep;
|
||||
|
||||
read_lock(&exec_domains_lock);
|
||||
for (ep = exec_domains; ep; ep = ep->next) {
|
||||
if (pers >= ep->pers_low && pers <= ep->pers_high)
|
||||
if (try_module_get(ep->module))
|
||||
goto out;
|
||||
}
|
||||
|
||||
#ifdef CONFIG_MODULES
|
||||
read_unlock(&exec_domains_lock);
|
||||
request_module("personality-%d", pers);
|
||||
read_lock(&exec_domains_lock);
|
||||
|
||||
for (ep = exec_domains; ep; ep = ep->next) {
|
||||
if (pers >= ep->pers_low && pers <= ep->pers_high)
|
||||
if (try_module_get(ep->module))
|
||||
goto out;
|
||||
}
|
||||
#endif
|
||||
|
||||
ep = &default_exec_domain;
|
||||
out:
|
||||
read_unlock(&exec_domains_lock);
|
||||
return ep;
|
||||
}
|
||||
|
||||
int
|
||||
register_exec_domain(struct exec_domain *ep)
|
||||
{
|
||||
struct exec_domain *tmp;
|
||||
int err = -EBUSY;
|
||||
|
||||
if (ep == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
if (ep->next != NULL)
|
||||
return -EBUSY;
|
||||
|
||||
write_lock(&exec_domains_lock);
|
||||
for (tmp = exec_domains; tmp; tmp = tmp->next) {
|
||||
if (tmp == ep)
|
||||
goto out;
|
||||
}
|
||||
|
||||
ep->next = exec_domains;
|
||||
exec_domains = ep;
|
||||
err = 0;
|
||||
|
||||
out:
|
||||
write_unlock(&exec_domains_lock);
|
||||
return err;
|
||||
}
|
||||
EXPORT_SYMBOL(register_exec_domain);
|
||||
|
||||
int
|
||||
unregister_exec_domain(struct exec_domain *ep)
|
||||
{
|
||||
struct exec_domain **epp;
|
||||
|
||||
epp = &exec_domains;
|
||||
write_lock(&exec_domains_lock);
|
||||
for (epp = &exec_domains; *epp; epp = &(*epp)->next) {
|
||||
if (ep == *epp)
|
||||
goto unregister;
|
||||
}
|
||||
write_unlock(&exec_domains_lock);
|
||||
return -EINVAL;
|
||||
|
||||
unregister:
|
||||
*epp = ep->next;
|
||||
ep->next = NULL;
|
||||
write_unlock(&exec_domains_lock);
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(unregister_exec_domain);
|
||||
|
||||
int __set_personality(unsigned int personality)
|
||||
{
|
||||
struct exec_domain *oep = current_thread_info()->exec_domain;
|
||||
|
||||
current_thread_info()->exec_domain = lookup_exec_domain(personality);
|
||||
current->personality = personality;
|
||||
module_put(oep->module);
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(__set_personality);
|
||||
|
||||
#ifdef CONFIG_PROC_FS
|
||||
static int execdomains_proc_show(struct seq_file *m, void *v)
|
||||
{
|
||||
struct exec_domain *ep;
|
||||
|
||||
read_lock(&exec_domains_lock);
|
||||
for (ep = exec_domains; ep; ep = ep->next)
|
||||
seq_printf(m, "%d-%d\t%-16s\t[%s]\n",
|
||||
ep->pers_low, ep->pers_high, ep->name,
|
||||
module_name(ep->module));
|
||||
read_unlock(&exec_domains_lock);
|
||||
seq_puts(m, "0-0\tLinux \t[kernel]\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -756,8 +756,6 @@ void do_exit(long code)
|
||||
|
||||
cgroup_exit(tsk);
|
||||
|
||||
module_put(task_thread_info(tsk)->exec_domain->module);
|
||||
|
||||
/*
|
||||
* FIXME: do that only when needed, using sched_exit tracepoint
|
||||
*/
|
||||
|
@ -1279,9 +1279,6 @@ static struct task_struct *copy_process(unsigned long clone_flags,
|
||||
if (nr_threads >= max_threads)
|
||||
goto bad_fork_cleanup_count;
|
||||
|
||||
if (!try_module_get(task_thread_info(p)->exec_domain->module))
|
||||
goto bad_fork_cleanup_count;
|
||||
|
||||
delayacct_tsk_init(p); /* Must remain after dup_task_struct() */
|
||||
p->flags &= ~(PF_SUPERPRIV | PF_WQ_WORKER);
|
||||
p->flags |= PF_FORKNOEXEC;
|
||||
@ -1590,7 +1587,6 @@ bad_fork_cleanup_threadgroup_lock:
|
||||
if (clone_flags & CLONE_THREAD)
|
||||
threadgroup_change_end(current);
|
||||
delayacct_tsk_free(p);
|
||||
module_put(task_thread_info(p)->exec_domain->module);
|
||||
bad_fork_cleanup_count:
|
||||
atomic_dec(&p->cred->user->processes);
|
||||
exit_creds(p);
|
||||
|
Loading…
Reference in New Issue
Block a user