xref: /OK3568_Linux_fs/kernel/arch/microblaze/include/asm/current.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: GPL-2.0 */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * Copyright (C) 2008-2009 Michal Simek <monstr@monstr.eu>
4*4882a593Smuzhiyun  * Copyright (C) 2008-2009 PetaLogix
5*4882a593Smuzhiyun  * Copyright (C) 2006 Atmark Techno, Inc.
6*4882a593Smuzhiyun  */
7*4882a593Smuzhiyun 
8*4882a593Smuzhiyun #ifndef _ASM_MICROBLAZE_CURRENT_H
9*4882a593Smuzhiyun #define _ASM_MICROBLAZE_CURRENT_H
10*4882a593Smuzhiyun 
11*4882a593Smuzhiyun /*
12*4882a593Smuzhiyun  * Register used to hold the current task pointer while in the kernel.
13*4882a593Smuzhiyun  * Any `call clobbered' register without a special meaning should be OK,
14*4882a593Smuzhiyun  * but check asm/microblaze/kernel/entry.S to be sure.
15*4882a593Smuzhiyun  */
16*4882a593Smuzhiyun #define CURRENT_TASK	r31
17*4882a593Smuzhiyun # ifndef __ASSEMBLY__
18*4882a593Smuzhiyun /*
19*4882a593Smuzhiyun  * Dedicate r31 to keeping the current task pointer
20*4882a593Smuzhiyun  */
21*4882a593Smuzhiyun register struct task_struct *current asm("r31");
22*4882a593Smuzhiyun 
23*4882a593Smuzhiyun # define get_current()	current
24*4882a593Smuzhiyun # endif /* __ASSEMBLY__ */
25*4882a593Smuzhiyun 
26*4882a593Smuzhiyun #endif /* _ASM_MICROBLAZE_CURRENT_H */
27