aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-11-16 06:12:56 -0500
committerDavid S. Miller <davem@davemloft.net>2008-02-09 07:17:54 -0500
commitba89f59ab825d4c9dee652ce0ca53e033a05d5ec (patch)
treec84b97ff66f2e66c7a1f7e7ce96d69ac504680d7 /include
parentcec6dc5d732c649e5f477c21c93d99eb25edae1e (diff)
[SPARC]: Merge asm-sparc{,64}/current.h
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/asm-sparc/current.h31
-rw-r--r--include/asm-sparc64/current.h9
2 files changed, 18 insertions, 22 deletions
diff --git a/include/asm-sparc/current.h b/include/asm-sparc/current.h
index 8fe7c82a5e21..8a1d9d6643b0 100644
--- a/include/asm-sparc/current.h
+++ b/include/asm-sparc/current.h
@@ -1,31 +1,34 @@
1/* 1/* include/asm-sparc/current.h
2 * include/asm-sparc/current.h
3 * 2 *
4 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation 3 * Copyright (C) 1999 IBM Deutschland Entwicklung GmbH, IBM Corporation
5 * Copyright (C) 2002 Pete Zaitcev (zaitcev@yahoo.com) 4 * Copyright (C) 2002 Pete Zaitcev (zaitcev@yahoo.com)
5 * Copyright (C) 2007 David S. Miller (davem@davemloft.net)
6 * 6 *
7 * Derived from "include/asm-s390/current.h" by 7 * Derived from "include/asm-s390/current.h" by
8 * Martin Schwidefsky (schwidefsky@de.ibm.com) 8 * Martin Schwidefsky (schwidefsky@de.ibm.com)
9 * Derived from "include/asm-i386/current.h" 9 * Derived from "include/asm-i386/current.h"
10 */ 10*/
11#ifndef _ASM_CURRENT_H 11#ifndef _SPARC_CURRENT_H
12#define _ASM_CURRENT_H 12#define _SPARC_CURRENT_H
13
14/*
15 * At the sparc64 DaveM keeps current_thread_info in %g4.
16 * We might want to consider doing the same to shave a few cycles.
17 */
18 13
19#include <linux/thread_info.h> 14#include <linux/thread_info.h>
20 15
21struct task_struct; 16#ifdef CONFIG_SPARC64
17register struct task_struct *current asm("g4");
18#endif
22 19
23/* Two stage process (inline + #define) for type-checking. */ 20#ifdef CONFIG_SPARC32
24/* We also obfuscate get_current() to check if anyone used that by mistake. */ 21/* We might want to consider using %g4 like sparc64 to shave a few cycles.
22 *
23 * Two stage process (inline + #define) for type-checking.
24 * We also obfuscate get_current() to check if anyone used that by mistake.
25 */
26struct task_struct;
25static inline struct task_struct *__get_current(void) 27static inline struct task_struct *__get_current(void)
26{ 28{
27 return current_thread_info()->task; 29 return current_thread_info()->task;
28} 30}
29#define current __get_current() 31#define current __get_current()
32#endif
30 33
31#endif /* !(_ASM_CURRENT_H) */ 34#endif /* !(_SPARC_CURRENT_H) */
diff --git a/include/asm-sparc64/current.h b/include/asm-sparc64/current.h
index 6c21e4ee2475..a7904a7f53a8 100644
--- a/include/asm-sparc64/current.h
+++ b/include/asm-sparc64/current.h
@@ -1,8 +1 @@
1#ifndef _SPARC64_CURRENT_H #include <asm-sparc/current.h>
2#define _SPARC64_CURRENT_H
3
4#include <linux/thread_info.h>
5
6register struct task_struct *current asm("g4");
7
8#endif /* !(_SPARC64_CURRENT_H) */