Commit ef334a20d84f52407a8a2afd02ddeaecbef0ad3d

Authored by Srikar Dronamraju
Committed by Ingo Molnar
1 parent 51e7dc7011

x86: Move is_ia32_task to asm/thread_info.h from asm/compat.h

is_ia32_task() is useful even in !CONFIG_COMPAT cases - utrace will
use it for example. Hence move it to a more generic file: asm/thread_info.h

Also now is_ia32_task() returns true if CONFIG_X86_32 is defined.

Signed-off-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Cc: Jim Keniston <jkenisto@linux.vnet.ibm.com>
Cc: Linux-mm <linux-mm@kvack.org>
Cc: Oleg Nesterov <oleg@redhat.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20120313140303.17134.1401.sendpatchset@srdronam.in.ibm.com
[ Performed minor cleanup ]
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 2 changed files with 12 additions and 9 deletions Side-by-side Diff

arch/x86/include/asm/compat.h
... ... @@ -235,15 +235,6 @@
235 235 return (void __user *)round_down(sp - len, 16);
236 236 }
237 237  
238   -static inline bool is_ia32_task(void)
239   -{
240   -#ifdef CONFIG_IA32_EMULATION
241   - if (current_thread_info()->status & TS_COMPAT)
242   - return true;
243   -#endif
244   - return false;
245   -}
246   -
247 238 static inline bool is_x32_task(void)
248 239 {
249 240 #ifdef CONFIG_X86_X32_ABI
arch/x86/include/asm/thread_info.h
... ... @@ -266,6 +266,18 @@
266 266 ti->status |= TS_RESTORE_SIGMASK;
267 267 set_bit(TIF_SIGPENDING, (unsigned long *)&ti->flags);
268 268 }
  269 +
  270 +static inline bool is_ia32_task(void)
  271 +{
  272 +#ifdef CONFIG_X86_32
  273 + return true;
  274 +#endif
  275 +#ifdef CONFIG_IA32_EMULATION
  276 + if (current_thread_info()->status & TS_COMPAT)
  277 + return true;
  278 +#endif
  279 + return false;
  280 +}
269 281 #endif /* !__ASSEMBLY__ */
270 282  
271 283 #ifndef __ASSEMBLY__