diff options
author | Richard Weinberger <richard@nod.at> | 2015-04-12 12:10:36 -0400 |
---|---|---|
committer | Richard Weinberger <richard@nod.at> | 2015-04-12 15:03:29 -0400 |
commit | cb418fdb33feba951187f6e01e9f78d3cd2dacbb (patch) | |
tree | 5b41a82a0b48d5893850890e993340528d6bca83 /arch/xtensa | |
parent | 3050a35fba296196cb00e87f4a96aa7d9ed17a7b (diff) |
xtensa: Autogenerate offsets in struct thread_info
Maintaining offsets by hand is no fun.
Reported-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/xtensa')
-rw-r--r-- | arch/xtensa/include/asm/thread_info.h | 11 | ||||
-rw-r--r-- | arch/xtensa/kernel/asm-offsets.c | 8 |
2 files changed, 8 insertions, 11 deletions
diff --git a/arch/xtensa/include/asm/thread_info.h b/arch/xtensa/include/asm/thread_info.h index a9b5d3ba196c..baa1f279f59f 100644 --- a/arch/xtensa/include/asm/thread_info.h +++ b/arch/xtensa/include/asm/thread_info.h | |||
@@ -61,17 +61,6 @@ struct thread_info { | |||
61 | xtregs_user_t xtregs_user; | 61 | xtregs_user_t xtregs_user; |
62 | }; | 62 | }; |
63 | 63 | ||
64 | #else /* !__ASSEMBLY__ */ | ||
65 | |||
66 | /* offsets into the thread_info struct for assembly code access */ | ||
67 | #define TI_TASK 0x00000000 | ||
68 | #define TI_EXEC_DOMAIN 0x00000004 | ||
69 | #define TI_FLAGS 0x00000008 | ||
70 | #define TI_STATUS 0x0000000C | ||
71 | #define TI_CPU 0x00000010 | ||
72 | #define TI_PRE_COUNT 0x00000014 | ||
73 | #define TI_ADDR_LIMIT 0x00000018 | ||
74 | |||
75 | #endif | 64 | #endif |
76 | 65 | ||
77 | /* | 66 | /* |
diff --git a/arch/xtensa/kernel/asm-offsets.c b/arch/xtensa/kernel/asm-offsets.c index 1915c7c889ba..b123ace3b67c 100644 --- a/arch/xtensa/kernel/asm-offsets.c +++ b/arch/xtensa/kernel/asm-offsets.c | |||
@@ -77,6 +77,14 @@ int main(void) | |||
77 | DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack)); | 77 | DEFINE(TASK_THREAD_INFO, offsetof (struct task_struct, stack)); |
78 | DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct)); | 78 | DEFINE(TASK_STRUCT_SIZE, sizeof (struct task_struct)); |
79 | 79 | ||
80 | /* offsets in thread_info struct */ | ||
81 | OFFSET(TI_TASK, thread_info, task); | ||
82 | OFFSET(TI_FLAGS, thread_info, flags); | ||
83 | OFFSET(TI_STSTUS, thread_info, status); | ||
84 | OFFSET(TI_CPU, thread_info, cpu); | ||
85 | OFFSET(TI_PRE_COUNT, thread_info, preempt_count); | ||
86 | OFFSET(TI_ADDR_LIMIT, thread_info, addr_limit); | ||
87 | |||
80 | /* struct thread_info (offset from start_struct) */ | 88 | /* struct thread_info (offset from start_struct) */ |
81 | DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra)); | 89 | DEFINE(THREAD_RA, offsetof (struct task_struct, thread.ra)); |
82 | DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp)); | 90 | DEFINE(THREAD_SP, offsetof (struct task_struct, thread.sp)); |