aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/include/asm/thread_info.h
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-02-29 20:45:27 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-03-08 18:55:02 -0500
commitfe1952fc0afb9a2e4c79f103c08aef5d13db1873 (patch)
treeea1fc050910844e3c72d8fa576e7bf429c09d788 /arch/powerpc/include/asm/thread_info.h
parent7450f6f03e9d6dc95d2014c4cceac8adf98560e8 (diff)
powerpc: Rework runlatch code
This moves the inlines into system.h and changes the runlatch code to use the thread local flags (non-atomic) rather than the TIF flags (atomic) to keep track of the latch state. The code to turn it back on in an asynchronous interrupt is now simplified and partially inlined. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/include/asm/thread_info.h')
-rw-r--r--arch/powerpc/include/asm/thread_info.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/arch/powerpc/include/asm/thread_info.h b/arch/powerpc/include/asm/thread_info.h
index 964714940961..4a741c7efd02 100644
--- a/arch/powerpc/include/asm/thread_info.h
+++ b/arch/powerpc/include/asm/thread_info.h
@@ -110,7 +110,6 @@ static inline struct thread_info *current_thread_info(void)
110#define TIF_NOERROR 12 /* Force successful syscall return */ 110#define TIF_NOERROR 12 /* Force successful syscall return */
111#define TIF_NOTIFY_RESUME 13 /* callback before returning to user */ 111#define TIF_NOTIFY_RESUME 13 /* callback before returning to user */
112#define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */ 112#define TIF_SYSCALL_TRACEPOINT 15 /* syscall tracepoint instrumentation */
113#define TIF_RUNLATCH 16 /* Is the runlatch enabled? */
114 113
115/* as above, but as bit values */ 114/* as above, but as bit values */
116#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE) 115#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -141,11 +140,13 @@ static inline struct thread_info *current_thread_info(void)
141#define TLF_SLEEPING 1 /* suspend code enabled SLEEP mode */ 140#define TLF_SLEEPING 1 /* suspend code enabled SLEEP mode */
142#define TLF_RESTORE_SIGMASK 2 /* Restore signal mask in do_signal */ 141#define TLF_RESTORE_SIGMASK 2 /* Restore signal mask in do_signal */
143#define TLF_LAZY_MMU 3 /* tlb_batch is active */ 142#define TLF_LAZY_MMU 3 /* tlb_batch is active */
143#define TLF_RUNLATCH 4 /* Is the runlatch enabled? */
144 144
145#define _TLF_NAPPING (1 << TLF_NAPPING) 145#define _TLF_NAPPING (1 << TLF_NAPPING)
146#define _TLF_SLEEPING (1 << TLF_SLEEPING) 146#define _TLF_SLEEPING (1 << TLF_SLEEPING)
147#define _TLF_RESTORE_SIGMASK (1 << TLF_RESTORE_SIGMASK) 147#define _TLF_RESTORE_SIGMASK (1 << TLF_RESTORE_SIGMASK)
148#define _TLF_LAZY_MMU (1 << TLF_LAZY_MMU) 148#define _TLF_LAZY_MMU (1 << TLF_LAZY_MMU)
149#define _TLF_RUNLATCH (1 << TLF_RUNLATCH)
149 150
150#ifndef __ASSEMBLY__ 151#ifndef __ASSEMBLY__
151#define HAVE_SET_RESTORE_SIGMASK 1 152#define HAVE_SET_RESTORE_SIGMASK 1
@@ -156,6 +157,12 @@ static inline void set_restore_sigmask(void)
156 set_bit(TIF_SIGPENDING, &ti->flags); 157 set_bit(TIF_SIGPENDING, &ti->flags);
157} 158}
158 159
160static inline bool test_thread_local_flags(unsigned int flags)
161{
162 struct thread_info *ti = current_thread_info();
163 return (ti->local_flags & flags) != 0;
164}
165
159#ifdef CONFIG_PPC64 166#ifdef CONFIG_PPC64
160#define is_32bit_task() (test_thread_flag(TIF_32BIT)) 167#define is_32bit_task() (test_thread_flag(TIF_32BIT))
161#else 168#else