(19/22) task_thread_info - part 3/4
Subsystems (2)
PATCH 1/1 (19/22) task_thread_info - part 3/4
a) in smp_lock.h #include of sched.h and spinlock.h moved under #ifdef CONFIG_LOCK_KERNEL.
b) interrupt.h now explicitly pulls sched.h (not via smp_lock.h from hardirq.h as it used to)
c) in two more places we need changes to compensate for (a) - one place in arch/sparc needs string.h now and hardirq.h needs forward declaration of task_struct and direct include of thread_info.h.
d) thread_info-related helpers in sched.h and thread_info.h put under ifndef __HAVE_THREAD_FUNCTIONS. Obviously safe.
Signed-off-by Al Viro <[email protected]>
----
arch/sparc/lib/bitext.c +1 -0
@@ -10,6 +10,7 @@*/ #include <linux/smp_lock.h> +#include <linux/string.h> #include <linux/bitops.h> #include <asm/bitext.h>
include/linux/hardirq.h +3 -0
@@ -4,6 +4,7 @@#include <linux/config.h> #include <linux/preempt.h> #include <linux/smp_lock.h> +#include <linux/thread_info.h> #include <asm/hardirq.h> #include <asm/system.h>
@@ -90,6 +91,8 @@#define nmi_enter () irq_enter()#define nmi_exit () sub_preempt_count(HARDIRQ_OFFSET) +struct task_struct ; +#ifndef CONFIG_VIRT_CPU_ACCOUNTING static inline void account_user_vtime (struct task_struct *tsk) {
include/linux/interrupt.h +1 -0
@@ -12,6 +12,7 @@#include <asm/atomic.h> #include <asm/ptrace.h> #include <asm/system.h> +#include <linux/sched.h> /* * For 2.4.x compatibility, 2.4.x can use
include/linux/sched.h +4 -0
@@ -1136,6 +1136,8 @@spin_unlock (&p->alloc_lock); } +#ifndef __HAVE_THREAD_FUNCTIONS +#define task_thread_info (task) (task)->thread_infostatic inline void setup_thread_info (struct task_struct *p,struct thread_info *ti)
@@ -1176,6 +1178,8 @@ return test_ti_thread_flag(task_thread_info(tsk), flag); } +#endif +static inline void set_tsk_need_resched (struct task_struct *tsk) {set_tsk_thread_flag (tsk,TIF_NEED_RESCHED );
include/linux/smp_lock.h +1 -2
@@ -2,11 +2,10 @@#define __LINUX_SMPLOCK_H#include <linux/config.h> +#ifdef CONFIG_LOCK_KERNEL #include <linux/sched.h> #include <linux/spinlock.h> -#ifdef CONFIG_LOCK_KERNEL -#define kernel_locked () (current->lock_depth >= 0) extern int __lockfunc __reacquire_kernel_lock(void);
include/linux/thread_info.h +2 -0
@@ -22,6 +22,7 @@#ifdef __KERNEL__ +#ifndef __HAVE_THREAD_FUNCTIONS/* * flag set/clear/test wrappers * - pass TIF_xxxx constants to these functions
@@ -88,5 +89,6 @@ }#endif +#endif #endif /* _LINUX_THREAD_INFO_H */