From: NIIBE Y. <gn...@m1...> - 2002-03-19 07:26:31
|
I forgot to send this here and commit to the repository. Here's follow up to 2.5.4. Also includes move of joystick driver to drivers/input/. 2002-03-09 NIIBE Yutaka <gn...@m1...> * arch/sh/mm/cache-sh4.c (flush_cache_range): New auto variable mm. * arch/sh/kernel/process.c (get_wchan): Follow the API change of thread_saved_pc. * include/asm-sh/thread_info.h (cpu): Added the member, not meaningful though (SuperH doesn't support SMP). * include/asm-sh/semaphore.h: Include <linux/wait.h>. * include/asm-sh/processor.h (thread_saved_pc): Make it a macro, so that we don't need the implementation of struct task. Fixed, thread is not a pointer. * arch/sh/config.in: joystick driver is now under drivers/input. * arch/sh/kernel/entry.S (flags, work, syscall_trace): Removed. (k_current): Removed. (work_pending): Use _TIF_NEED_RESCHED. (work_resched): Use GET_THREAD_INFO and _TIF_WORK_MASK. (work_notifysig): Use _TIF_SIGPENDING. (resume_userspace): Use GET_THREAD_INFO and _TIF_WORK_MASK. (system_call): Use GET_THREAD_INFO and _TIF_SYSCALL_TRACE. (system_exit): Use GET_THREAD_INFO and _TIF_ALLWORK_MASK. (system_trace_entry): Use _TIF_SYSCALL_TRACE. * include/asm-sh/thread_info.h (_TIF_WORK_MASK, _TIF_ALLWORK_MASK): Change the value to 8-bit. Index: arch/sh/config.in =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/config.in,v retrieving revision 1.4 diff -u -3 -p -r1.4 config.in --- arch/sh/config.in 25 Jan 2002 02:07:59 -0000 1.4 +++ arch/sh/config.in 19 Mar 2002 07:20:55 -0000 @@ -259,7 +259,7 @@ fi endmenu # -# input before char - char/joystick depends on it. As does USB. +# input - input/joystick depends on it. As does USB. # source drivers/input/Config.in @@ -308,7 +308,7 @@ if [ "$CONFIG_SH_DREAMCAST" = "y" -a "$C endmenu fi -source drivers/char/joystick/Config.in +source drivers/input/joystick/Config.in if [ "$CONFIG_PARPORT" != "n" ]; then dep_tristate 'Parallel printer support' CONFIG_PRINTER $CONFIG_PARPORT Index: arch/sh/kernel/entry.S =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/entry.S,v retrieving revision 1.4 diff -u -3 -p -r1.4 entry.S --- arch/sh/kernel/entry.S 1 Mar 2002 01:55:10 -0000 1.4 +++ arch/sh/kernel/entry.S 19 Mar 2002 07:20:55 -0000 @@ -13,6 +13,7 @@ #include <linux/sys.h> #include <linux/linkage.h> #include <linux/config.h> +#include <asm/thread_info.h> ! NOTE: @@ -51,13 +52,6 @@ * */ -/* - * These are offsets into the task-struct. - */ -flags = 4 -work = 8 -syscall_trace = work+1 - ENOSYS = 38 EINVAL = 22 @@ -97,11 +91,10 @@ SYSCALL_NR = (16*4+6*4) #define k3 r3 #define k4 r4 -#define current r7 /* r7_bank1 */ +#define k_ex_code r2_bank /* r2_bank1 */ #define g_imask r6 /* r6_bank1 */ -#define k_current r7_bank /* r7_bank1 */ #define k_g_imask r6_bank /* r6_bank1 */ -#define k_ex_code r2_bank /* r2_bank1 */ +#define current r7 /* r7_bank1 */ /* * Kernel mode register usage: @@ -112,7 +105,7 @@ SYSCALL_NR = (16*4+6*4) * k4 scratch * k5 reserved * k6 Global Interrupt Mask (0--15 << 4) - * k7 CURRENT (pointer to current task) + * k7 CURRENT_THREAD_INFO (pointer to current thread info) */ ! @@ -291,15 +284,8 @@ ENTRY(ret_from_fork) .align 2 work_pending: - ! r1: current->work -#ifdef __LITTLE_ENDIAN__ -#else - swap.w r1, r0 - swap.b r0, r0 -#endif - and #0xff,r0 - ! r0: current->work.need_resched - tst r0, r0 + ! r0: current_thread_info->flags + tst #_TIF_NEED_RESCHED, r0 bt work_notifysig .align 2 @@ -312,30 +298,22 @@ work_resched: or #0xf0, r0 ldc r0, sr ! - stc k_current, r1 - mov.l @(work,r1), r1 - mov.l 2f, r0 - and r1, r0 - tst r0, r0 + GET_THREAD_INFO(r1) + add #TI_FLAGS, r1 + mov.l @r1, r0 ! current_thread_info->flags + tst #_TIF_WORK_MASK, r0 bt restore_all bra work_pending nop .align 2 work_notifysig: - ! r1: current->work -#ifdef __LITTLE_ENDIAN__ - swap.w r1, r0 -#else - swap.b r0, r0 -#endif - and #0xff,r0 - ! r0: current->work.sigpending - tst r0, r0 + ! r0: current_thread_info->flags + tst #_TIF_SIGPENDING, r0 bt restore_all mov r15, r4 mov #0, r5 - mov.l 3f, r1 + mov.l 2f, r1 mova restore_all, r0 jmp @r1 lds r0, pr @@ -346,24 +324,17 @@ ENTRY(resume_userspace) or #0xf0, r0 ldc r0, sr ! - stc k_current, r1 - mov.l @(work,r1), r1 ! current->work - mov.l 2f, r0 - and r1, r0 - tst r0, r0 + GET_THREAD_INFO(r1) + add #TI_FLAGS, r1 + mov.l @r1, r0 ! current_thread_info->flags + tst #_TIF_WORK_MASK, r0 bf work_pending bra restore_all nop .align 2 1: .long SYMBOL_NAME(schedule) -2: ! ignore syscall trace counter -#ifdef __LITTLE_ENDIAN__ - .long 0xffff00ff -#else - .long 0xff00ffff -#endif -3: +2: .long SYMBOL_NAME(do_signal) /* @@ -420,10 +391,11 @@ system_call: bt syscall_badsys ! ! Good syscall number - stc k_current, r11 - add #syscall_trace, r11 - mov.b @r11, r10 - tst r10, r10 + GET_THREAD_INFO(r11) + add #TI_FLAGS, r11 + mov.l @r11, r10 + mov #_TIF_SYSCALL_TRACE, r11 + tst r11, r10 bf syscall_trace_entry ! syscall_call: @@ -440,9 +412,10 @@ syscall_exit: or #0xf0, r0 ldc r0, sr ! - stc k_current, r1 - mov.l @(work,r1), r1 ! current->work - tst r1, r1 + GET_THREAD_INFO(r1) + add #TI_FLAGS, r1 + mov.l @r1, r0 ! current_thread_info->flags + tst #_TIF_ALLWORK_MASK, r0 bf syscall_exit_work restore_all: mov.l @r15+, r0 @@ -536,15 +509,8 @@ syscall_trace_entry: .align 2 syscall_exit_work: - ! r1: current->work -#ifdef __LITTLE_ENDIAN__ - swap.b r1, r0 -#else - swap.w r1, r0 -#endif - and #0xff,r0 - ! r0: current->work.syscall_trace - tst r0, r0 + ! r0: current_thread_info->flags + tst #_TIF_SYSCALL_TRACE, r0 bt work_pending STI() ! XXX setup arguments... Index: arch/sh/kernel/process.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/kernel/process.c,v retrieving revision 1.5 diff -u -3 -p -r1.5 process.c --- arch/sh/kernel/process.c 6 Mar 2002 23:04:52 -0000 1.5 +++ arch/sh/kernel/process.c 19 Mar 2002 07:20:55 -0000 @@ -347,7 +347,7 @@ unsigned long get_wchan(struct task_stru /* * The same comment as on the Alpha applies here, too ... */ - pc = thread_saved_pc(&p->thread); + pc = thread_saved_pc(p); if (pc >= (unsigned long) interruptible_sleep_on && pc < (unsigned long) add_timer) { schedule_frame = ((unsigned long *)(long)p->thread.sp)[1]; return (unsigned long)((unsigned long *)schedule_frame)[1]; Index: arch/sh/mm/cache-sh4.c =================================================================== RCS file: /cvsroot/linuxsh/linux/arch/sh/mm/cache-sh4.c,v retrieving revision 1.3 diff -u -3 -p -r1.3 cache-sh4.c --- arch/sh/mm/cache-sh4.c 1 Mar 2002 07:47:11 -0000 1.3 +++ arch/sh/mm/cache-sh4.c 19 Mar 2002 07:20:55 -0000 @@ -322,6 +322,7 @@ void flush_cache_range(struct vm_area_st unsigned long end) { unsigned long flags; + struct mm_struct *mm = vma->vm_mm; if (mm->context == 0) return; Index: include/asm-sh/processor.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/processor.h,v retrieving revision 1.3 diff -u -3 -p -r1.3 processor.h --- include/asm-sh/processor.h 6 Mar 2002 23:04:52 -0000 1.3 +++ include/asm-sh/processor.h 19 Mar 2002 07:20:55 -0000 @@ -204,10 +204,7 @@ extern void save_fpu(struct task_struct /* * Return saved PC of a blocked thread. */ -static __inline__ unsigned long thread_saved_pc(struct task_struct *tsk) -{ - return tsk->thread->pc; -} +#define thread_saved_pc(tsk) (tsk->thread.pc) extern unsigned long get_wchan(struct task_struct *p); Index: include/asm-sh/semaphore.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/semaphore.h,v retrieving revision 1.1.1.1 diff -u -3 -p -r1.1.1.1 semaphore.h --- include/asm-sh/semaphore.h 15 Oct 2001 20:45:11 -0000 1.1.1.1 +++ include/asm-sh/semaphore.h 19 Mar 2002 07:20:55 -0000 @@ -15,6 +15,7 @@ #include <linux/spinlock.h> #include <linux/rwsem.h> +#include <linux/wait.h> #include <asm/system.h> #include <asm/atomic.h> Index: include/asm-sh/thread_info.h =================================================================== RCS file: /cvsroot/linuxsh/linux/include/asm-sh/thread_info.h,v retrieving revision 1.1 diff -u -3 -p -r1.1 thread_info.h --- include/asm-sh/thread_info.h 6 Mar 2002 23:04:52 -0000 1.1 +++ include/asm-sh/thread_info.h 19 Mar 2002 07:20:55 -0000 @@ -29,6 +29,7 @@ struct thread_info { __u32 flags; /* low level flags */ __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ + __u32 cpu; __u8 supervisor_stack[0]; }; @@ -102,8 +103,8 @@ static inline struct thread_info *curren #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG) #define _TIF_USERSPACE (1<<TIF_USERSPACE) -#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 _TIF_WORK_MASK 0x000000FE /* work to do on interrupt/exception return */ +#define _TIF_ALLWORK_MASK 0x000000FF /* work to do on any return to u-space */ #endif /* __KERNEL__ */ |