Path: blob/master/arch/mn10300/include/asm/current.h
15126 views
/* MN10300 Current task structure accessor1*2* Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.3* Written by David Howells ([email protected])4*5* This program is free software; you can redistribute it and/or6* modify it under the terms of the GNU General Public Licence7* as published by the Free Software Foundation; either version8* 2 of the Licence, or (at your option) any later version.9*/10#ifndef _ASM_CURRENT_H11#define _ASM_CURRENT_H1213#include <linux/thread_info.h>1415/*16* dedicate E2 to keeping the current task pointer17*/18#ifdef CONFIG_MN10300_CURRENT_IN_E21920register struct task_struct *const current asm("e2") __attribute__((used));2122#define get_current() current2324extern struct task_struct *__current;2526#else27static inline __attribute__((const))28struct task_struct *get_current(void)29{30return current_thread_info()->task;31}3233#define current get_current()34#endif3536#endif /* _ASM_CURRENT_H */373839