]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
blackfin: Autogenerate offsets in struct thread_info
authorRichard Weinberger <richard@nod.at>
Fri, 3 Apr 2015 16:56:16 +0000 (18:56 +0200)
committerRichard Weinberger <richard@nod.at>
Sun, 12 Apr 2015 18:58:24 +0000 (20:58 +0200)
Maintaining offsets by hand is no fun.

Signed-off-by: Richard Weinberger <richard@nod.at>
arch/blackfin/include/asm/thread_info.h
arch/blackfin/kernel/asm-offsets.c
arch/blackfin/kernel/traps.c

index 57c3a8bd583d46d34d2169637fbf4b9a838af172..962be3fb3ee1e2f82ae35cfd05c8ffc43c7c93e0 100644 (file)
@@ -75,15 +75,6 @@ static inline struct thread_info *current_thread_info(void)
 
 #endif                         /* __ASSEMBLY__ */
 
-/*
- * Offsets in thread_info structure, used in assembly code
- */
-#define TI_TASK                0
-#define TI_EXECDOMAIN  4
-#define TI_FLAGS       8
-#define TI_CPU         12
-#define TI_PREEMPT     16
-
 /*
  * thread information flag bit numbers
  */
index 37fcae95021615d6f5fb08aca571dac2973a0be0..486560aea050e760d82ff8b481ac7698e122eebd 100644 (file)
@@ -42,6 +42,12 @@ int main(void)
        DEFINE(THREAD_PC, offsetof(struct thread_struct, pc));
        DEFINE(KERNEL_STACK_SIZE, THREAD_SIZE);
 
+       /* offsets in thread_info struct */
+       OFFSET(TI_TASK, thread_info, task);
+       OFFSET(TI_FLAGS, thread_info, flags);
+       OFFSET(TI_CPU, thread_info, cpu);
+       OFFSET(TI_PREEMPT, thread_info, preempt_count);
+
        /* offsets into the pt_regs */
        DEFINE(PT_ORIG_R0, offsetof(struct pt_regs, orig_r0));
        DEFINE(PT_ORIG_P0, offsetof(struct pt_regs, orig_p0));
index de5c2c3ebd9b36ec8cd0faa9afc257a5704c4dfd..1ed85ddadc0d25135cf6bf494f1934ae52874f85 100644 (file)
@@ -18,6 +18,7 @@
 #include <asm/fixed_code.h>
 #include <asm/pseudo_instructions.h>
 #include <asm/pda.h>
+#include <asm/asm-offsets.h>
 
 #ifdef CONFIG_KGDB
 # include <linux/kgdb.h>