Path: blob/master/arch/sparc/include/asm/current.h
17372 views
/* include/asm/current.h1*2* Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation3* Copyright (C) 2002 Pete Zaitcev ([email protected])4* Copyright (C) 2007 David S. Miller ([email protected])5*6* Derived from "include/asm-s390/current.h" by7* Martin Schwidefsky ([email protected])8* Derived from "include/asm-i386/current.h"9*/10#ifndef _SPARC_CURRENT_H11#define _SPARC_CURRENT_H1213#include <linux/thread_info.h>1415#ifdef CONFIG_SPARC6416register struct task_struct *current asm("g4");17#endif1819#ifdef CONFIG_SPARC3220/* We might want to consider using %g4 like sparc64 to shave a few cycles.21*22* Two stage process (inline + #define) for type-checking.23* We also obfuscate get_current() to check if anyone used that by mistake.24*/25struct task_struct;26static inline struct task_struct *__get_current(void)27{28return current_thread_info()->task;29}30#define current __get_current()31#endif3233#endif /* !(_SPARC_CURRENT_H) */343536