From 8f1597e959a3cfeae8f5cfae26890710f9092443 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 19 Sep 2012 13:08:13 -0400 Subject: mn10300: switch to generic sys_execve() Signed-off-by: Al Viro --- arch/mn10300/include/asm/ptrace.h | 1 + arch/mn10300/include/asm/unistd.h | 1 + 2 files changed, 2 insertions(+) (limited to 'arch/mn10300/include') diff --git a/arch/mn10300/include/asm/ptrace.h b/arch/mn10300/include/asm/ptrace.h index 44251b974f1d..08ac856c053e 100644 --- a/arch/mn10300/include/asm/ptrace.h +++ b/arch/mn10300/include/asm/ptrace.h @@ -86,6 +86,7 @@ struct pt_regs { #define user_mode(regs) (((regs)->epsw & EPSW_nSL) == EPSW_nSL) #define instruction_pointer(regs) ((regs)->pc) #define user_stack_pointer(regs) ((regs)->sp) +#define current_pt_regs() current_frame() #define arch_has_single_step() (1) diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h index 866eb14749d7..a965de47b2bd 100644 --- a/arch/mn10300/include/asm/unistd.h +++ b/arch/mn10300/include/asm/unistd.h @@ -382,6 +382,7 @@ #define __ARCH_WANT_SYS_SIGPROCMASK #define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGSUSPEND +#define __ARCH_WANT_SYS_EXECVE /* * "Conditional" syscalls -- cgit v1.2.3 From 6e75421014cd02cc66298d35c4667e493da78914 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 19 Sep 2012 13:18:20 -0400 Subject: mn10300: switch to generic kernel_execve() Signed-off-by: Al Viro --- arch/mn10300/include/asm/frame.inc | 2 +- arch/mn10300/include/asm/processor.h | 13 +++---------- arch/mn10300/include/asm/unistd.h | 1 + 3 files changed, 5 insertions(+), 11 deletions(-) (limited to 'arch/mn10300/include') diff --git a/arch/mn10300/include/asm/frame.inc b/arch/mn10300/include/asm/frame.inc index 2ee58e3eb6b3..1c3eb4fda958 100644 --- a/arch/mn10300/include/asm/frame.inc +++ b/arch/mn10300/include/asm/frame.inc @@ -61,7 +61,7 @@ ############################################################################### .macro RESTORE_ALL # peel back the stack to the calling frame - # - this permits execve() to discard extra frames due to kernel syscalls + # - we need that when returning from interrupts to kernel mode GET_THREAD_INFO a0 mov (TI_frame,a0),fp mov fp,sp diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h index 247928c9f549..0b844a254067 100644 --- a/arch/mn10300/include/asm/processor.h +++ b/arch/mn10300/include/asm/processor.h @@ -119,20 +119,13 @@ struct thread_struct { /* * do necessary setup to start up a newly executed thread - * - need to discard the frame stacked by the kernel thread invoking the execve - * syscall (see RESTORE_ALL macro) */ static inline void start_thread(struct pt_regs *regs, unsigned long new_pc, unsigned long new_sp) { - struct thread_info *ti = current_thread_info(); - struct pt_regs *frame0; - - frame0 = thread_info_to_uregs(ti); - frame0->epsw = EPSW_nSL | EPSW_IE | EPSW_IM; - frame0->pc = new_pc; - frame0->sp = new_sp; - ti->frame = frame0; + regs->epsw = EPSW_nSL | EPSW_IE | EPSW_IM; + regs->pc = new_pc; + regs->sp = new_sp; } diff --git a/arch/mn10300/include/asm/unistd.h b/arch/mn10300/include/asm/unistd.h index a965de47b2bd..044c770adbb6 100644 --- a/arch/mn10300/include/asm/unistd.h +++ b/arch/mn10300/include/asm/unistd.h @@ -383,6 +383,7 @@ #define __ARCH_WANT_SYS_RT_SIGACTION #define __ARCH_WANT_SYS_RT_SIGSUSPEND #define __ARCH_WANT_SYS_EXECVE +#define __ARCH_WANT_KERNEL_EXECVE /* * "Conditional" syscalls -- cgit v1.2.3 From 61b7fbc3f4ebdcfd34f9438adfab8df936a19e33 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 22 Sep 2012 18:18:23 -0400 Subject: mn10300: convert to generic kernel_thread() Signed-off-by: Al Viro --- arch/mn10300/include/asm/processor.h | 5 ----- 1 file changed, 5 deletions(-) (limited to 'arch/mn10300/include') diff --git a/arch/mn10300/include/asm/processor.h b/arch/mn10300/include/asm/processor.h index 0b844a254067..8b80b19d0c8a 100644 --- a/arch/mn10300/include/asm/processor.h +++ b/arch/mn10300/include/asm/processor.h @@ -132,11 +132,6 @@ static inline void start_thread(struct pt_regs *regs, /* Free all resources held by a thread. */ extern void release_thread(struct task_struct *); -/* - * create a kernel thread without removing it from tasklists - */ -extern int kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); - /* * Return saved PC of a blocked thread. */ -- cgit v1.2.3 From 8af4efac26e1805c76144ad44118157239308d35 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 1 Jun 2012 14:21:16 -0400 Subject: bury _TIF_RESTORE_SIGMASK never used... Signed-off-by: Al Viro --- arch/mn10300/include/asm/thread_info.h | 1 - 1 file changed, 1 deletion(-) (limited to 'arch/mn10300/include') diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h index ac519bbd42ff..224b4262486d 100644 --- a/arch/mn10300/include/asm/thread_info.h +++ b/arch/mn10300/include/asm/thread_info.h @@ -160,7 +160,6 @@ void arch_release_thread_info(struct thread_info *ti); #define _TIF_SIGPENDING +(1 << TIF_SIGPENDING) #define _TIF_NEED_RESCHED +(1 << TIF_NEED_RESCHED) #define _TIF_SINGLESTEP +(1 << TIF_SINGLESTEP) -#define _TIF_RESTORE_SIGMASK +(1 << TIF_RESTORE_SIGMASK) #define _TIF_POLLING_NRFLAG +(1 << TIF_POLLING_NRFLAG) #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ -- cgit v1.2.3 From 16a8016372c42c7628eb4a39d75386a461e8c5d0 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Fri, 1 Jun 2012 14:22:01 -0400 Subject: sanitize tsk_is_polling() Make default just return 0. The current default (checking TIF_POLLING_NRFLAG) is taken to architectures that need it; ones that don't do polling in their idle threads don't need to defined TIF_POLLING_NRFLAG at all. ia64 defined both TS_POLLING (used by its tsk_is_polling()) and TIF_POLLING_NRFLAG (not used at all). Killed the latter... Signed-off-by: Al Viro --- arch/mn10300/include/asm/thread_info.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'arch/mn10300/include') diff --git a/arch/mn10300/include/asm/thread_info.h b/arch/mn10300/include/asm/thread_info.h index 224b4262486d..f90062b0622d 100644 --- a/arch/mn10300/include/asm/thread_info.h +++ b/arch/mn10300/include/asm/thread_info.h @@ -165,6 +165,8 @@ void arch_release_thread_info(struct thread_info *ti); #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */ #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */ +#define tsk_is_polling(t) test_tsk_thread_flag(t, TIF_POLLING_NRFLAG) + #endif /* __KERNEL__ */ #endif /* _ASM_THREAD_INFO_H */ -- cgit v1.2.3