diff options
Diffstat (limited to 'include/asm-mn10300/current.h')
| -rw-r--r-- | include/asm-mn10300/current.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/asm-mn10300/current.h b/include/asm-mn10300/current.h new file mode 100644 index 000000000000..ca6027d83743 --- /dev/null +++ b/include/asm-mn10300/current.h | |||
| @@ -0,0 +1,37 @@ | |||
| 1 | /* MN10300 Current task structure accessor | ||
| 2 | * | ||
| 3 | * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. | ||
| 4 | * Written by David Howells (dhowells@redhat.com) | ||
| 5 | * | ||
| 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. | ||
| 10 | */ | ||
| 11 | #ifndef _ASM_CURRENT_H | ||
| 12 | #define _ASM_CURRENT_H | ||
| 13 | |||
| 14 | #include <linux/thread_info.h> | ||
| 15 | |||
| 16 | /* | ||
| 17 | * dedicate E2 to keeping the current task pointer | ||
| 18 | */ | ||
| 19 | #ifdef CONFIG_MN10300_CURRENT_IN_E2 | ||
| 20 | |||
| 21 | register struct task_struct *const current asm("e2") __attribute__((used)); | ||
| 22 | |||
| 23 | #define get_current() current | ||
| 24 | |||
| 25 | extern struct task_struct *__current; | ||
| 26 | |||
| 27 | #else | ||
| 28 | static inline __attribute__((const)) | ||
| 29 | struct task_struct *get_current(void) | ||
| 30 | { | ||
| 31 | return current_thread_info()->task; | ||
| 32 | } | ||
| 33 | |||
| 34 | #define current get_current() | ||
| 35 | #endif | ||
| 36 | |||
| 37 | #endif /* _ASM_CURRENT_H */ | ||
