[PATCH] m68k: introduce task_thread_info
new helper - task_thread_info(task). On platforms that have thread_info allocated separately (i.e. in default case) it simply returns task->thread_info. m68k wants (and for good reasons) to embed its thread_info into task_struct. So it will (in later patch) have task_thread_info() of its own. For now we just add a macro for generic case and convert existing instances of its body in core kernel to uses of new macro. Obviously safe - all normal architectures get the same preprocessor output they used to get. Signed-off-by: Al Viro <viro@parcelfarce.linux.theplanet.co.uk> Signed-off-by: Roman Zippel <zippel@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
		@@ -1437,7 +1437,7 @@ void fastcall sched_fork(task_t *p, int clone_flags)
 | 
			
		||||
#endif
 | 
			
		||||
#ifdef CONFIG_PREEMPT
 | 
			
		||||
	/* Want to start with kernel preemption disabled. */
 | 
			
		||||
	p->thread_info->preempt_count = 1;
 | 
			
		||||
	task_thread_info(p)->preempt_count = 1;
 | 
			
		||||
#endif
 | 
			
		||||
	/*
 | 
			
		||||
	 * Share the timeslice between parent and child, thus the
 | 
			
		||||
@@ -4410,9 +4410,9 @@ void __devinit init_idle(task_t *idle, int cpu)
 | 
			
		||||
 | 
			
		||||
	/* Set the preempt count _outside_ the spinlocks! */
 | 
			
		||||
#if defined(CONFIG_PREEMPT) && !defined(CONFIG_PREEMPT_BKL)
 | 
			
		||||
	idle->thread_info->preempt_count = (idle->lock_depth >= 0);
 | 
			
		||||
	task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0);
 | 
			
		||||
#else
 | 
			
		||||
	idle->thread_info->preempt_count = 0;
 | 
			
		||||
	task_thread_info(idle)->preempt_count = 0;
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user