locking, m68k: Calculate thread_info offset with asm offset
[linux-2.6.git] / arch / m68k / include / asm / thread_info_mm.h
index 6ea5c33..b6da388 100644 (file)
@@ -1,6 +1,10 @@
 #ifndef _ASM_M68K_THREAD_INFO_H
 #define _ASM_M68K_THREAD_INFO_H
 
+#ifndef ASM_OFFSETS_C
+#include <asm/asm-offsets.h>
+#endif
+#include <asm/current.h>
 #include <asm/types.h>
 #include <asm/page.h>
 
@@ -31,7 +35,12 @@ struct thread_info {
 #define init_thread_info       (init_task.thread.info)
 #define init_stack             (init_thread_union.stack)
 
-#define task_thread_info(tsk)  (&(tsk)->thread.info)
+#ifdef ASM_OFFSETS_C
+#define task_thread_info(tsk)  ((struct thread_info *) NULL)
+#else
+#define task_thread_info(tsk)  ((struct thread_info *)((char *)tsk+TASK_TINFO))
+#endif
+
 #define task_stack_page(tsk)   ((tsk)->stack)
 #define current_thread_info()  task_thread_info(current)