Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /* include/asm/current.h
0003  *
0004  * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
0005  * Copyright (C) 2002 Pete Zaitcev (zaitcev@yahoo.com)
0006  * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
0007  *
0008  *  Derived from "include/asm-s390/current.h" by
0009  *  Martin Schwidefsky (schwidefsky@de.ibm.com)
0010  *  Derived from "include/asm-i386/current.h"
0011 */
0012 #ifndef _SPARC_CURRENT_H
0013 #define _SPARC_CURRENT_H
0014 
0015 #include <linux/thread_info.h>
0016 
0017 #ifdef CONFIG_SPARC64
0018 register struct task_struct *current asm("g4");
0019 #endif
0020 
0021 #ifdef CONFIG_SPARC32
0022 /* We might want to consider using %g4 like sparc64 to shave a few cycles.
0023  *
0024  * Two stage process (inline + #define) for type-checking.
0025  * We also obfuscate get_current() to check if anyone used that by mistake.
0026  */
0027 struct task_struct;
0028 static inline struct task_struct *__get_current(void)
0029 {
0030     return current_thread_info()->task;
0031 }
0032 #define current __get_current()
0033 #endif
0034 
0035 #endif /* !(_SPARC_CURRENT_H) */