mfd: twl4030 regulator bug fixes
[linux-2.6/mini2440.git] / include / asm-mn10300 / current.h
blobca6027d83743a17e033435fff88ec43694b16db0
1 /* MN10300 Current task structure accessor
3 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
4 * Written by David Howells (dhowells@redhat.com)
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public Licence
8 * as published by the Free Software Foundation; either version
9 * 2 of the Licence, or (at your option) any later version.
11 #ifndef _ASM_CURRENT_H
12 #define _ASM_CURRENT_H
14 #include <linux/thread_info.h>
17 * dedicate E2 to keeping the current task pointer
19 #ifdef CONFIG_MN10300_CURRENT_IN_E2
21 register struct task_struct *const current asm("e2") __attribute__((used));
23 #define get_current() current
25 extern struct task_struct *__current;
27 #else
28 static inline __attribute__((const))
29 struct task_struct *get_current(void)
31 return current_thread_info()->task;
34 #define current get_current()
35 #endif
37 #endif /* _ASM_CURRENT_H */