xref: /OK3568_Linux_fs/kernel/arch/m68k/include/asm/current.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun #ifndef _M68K_CURRENT_H
3*4882a593Smuzhiyun #define _M68K_CURRENT_H
4*4882a593Smuzhiyun 
5*4882a593Smuzhiyun #ifdef CONFIG_MMU
6*4882a593Smuzhiyun 
7*4882a593Smuzhiyun register struct task_struct *current __asm__("%a2");
8*4882a593Smuzhiyun 
9*4882a593Smuzhiyun #else
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun /*
12*4882a593Smuzhiyun  *	Rather than dedicate a register (as the m68k source does), we
13*4882a593Smuzhiyun  *	just keep a global,  we should probably just change it all to be
14*4882a593Smuzhiyun  *	current and lose _current_task.
15*4882a593Smuzhiyun  */
16*4882a593Smuzhiyun #include <linux/thread_info.h>
17*4882a593Smuzhiyun 
18*4882a593Smuzhiyun struct task_struct;
19*4882a593Smuzhiyun 
get_current(void)20*4882a593Smuzhiyun static inline struct task_struct *get_current(void)
21*4882a593Smuzhiyun {
22*4882a593Smuzhiyun 	return(current_thread_info()->task);
23*4882a593Smuzhiyun }
24*4882a593Smuzhiyun 
25*4882a593Smuzhiyun #define	current	get_current()
26*4882a593Smuzhiyun 
27*4882a593Smuzhiyun #endif /* CONFNIG_MMU */
28*4882a593Smuzhiyun 
29*4882a593Smuzhiyun #endif /* !(_M68K_CURRENT_H) */
30