Commit d24944d924d051281b276be8e5749b45785563c8
Committed by
Kyle McMartin
1 parent
e40152ee1e
Exists in
master
and in
20 other branches
parisc: Use of align_frame provides stack frame.
Any assembly constant generated with the use of align_frame includes size for a full stack frame. Signed-off-by: Carlos O'Donell <carlos@systemhalted.org> Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
Showing 1 changed file with 11 additions and 4 deletions Side-by-side Diff
arch/parisc/kernel/asm-offsets.c
... | ... | @@ -45,8 +45,12 @@ |
45 | 45 | #else |
46 | 46 | #define FRAME_SIZE 64 |
47 | 47 | #endif |
48 | +#define FRAME_ALIGN 64 | |
48 | 49 | |
49 | -#define align(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y))) | |
50 | +/* Add FRAME_SIZE to the size x and align it to y. All definitions | |
51 | + * that use align_frame will include space for a frame. | |
52 | + */ | |
53 | +#define align_frame(x,y) (((x)+FRAME_SIZE+(y)-1) - (((x)+(y)-1)%(y))) | |
50 | 54 | |
51 | 55 | int main(void) |
52 | 56 | { |
... | ... | @@ -146,7 +150,8 @@ |
146 | 150 | DEFINE(TASK_PT_IOR, offsetof(struct task_struct, thread.regs.ior)); |
147 | 151 | BLANK(); |
148 | 152 | DEFINE(TASK_SZ, sizeof(struct task_struct)); |
149 | - DEFINE(TASK_SZ_ALGN, align(sizeof(struct task_struct), 64)); | |
153 | + /* TASK_SZ_ALGN includes space for a stack frame. */ | |
154 | + DEFINE(TASK_SZ_ALGN, align_frame(sizeof(struct task_struct), FRAME_ALIGN)); | |
150 | 155 | BLANK(); |
151 | 156 | DEFINE(PT_PSW, offsetof(struct pt_regs, gr[ 0])); |
152 | 157 | DEFINE(PT_GR1, offsetof(struct pt_regs, gr[ 1])); |
... | ... | @@ -233,7 +238,8 @@ |
233 | 238 | DEFINE(PT_ISR, offsetof(struct pt_regs, isr)); |
234 | 239 | DEFINE(PT_IOR, offsetof(struct pt_regs, ior)); |
235 | 240 | DEFINE(PT_SIZE, sizeof(struct pt_regs)); |
236 | - DEFINE(PT_SZ_ALGN, align(sizeof(struct pt_regs), 64)); | |
241 | + /* PT_SZ_ALGN includes space for a stack frame. */ | |
242 | + DEFINE(PT_SZ_ALGN, align_frame(sizeof(struct pt_regs), FRAME_ALIGN)); | |
237 | 243 | BLANK(); |
238 | 244 | DEFINE(TI_TASK, offsetof(struct thread_info, task)); |
239 | 245 | DEFINE(TI_EXEC_DOMAIN, offsetof(struct thread_info, exec_domain)); |
... | ... | @@ -242,7 +248,8 @@ |
242 | 248 | DEFINE(TI_SEGMENT, offsetof(struct thread_info, addr_limit)); |
243 | 249 | DEFINE(TI_PRE_COUNT, offsetof(struct thread_info, preempt_count)); |
244 | 250 | DEFINE(THREAD_SZ, sizeof(struct thread_info)); |
245 | - DEFINE(THREAD_SZ_ALGN, align(sizeof(struct thread_info), 64)); | |
251 | + /* THREAD_SZ_ALGN includes space for a stack frame. */ | |
252 | + DEFINE(THREAD_SZ_ALGN, align_frame(sizeof(struct thread_info), FRAME_ALIGN)); | |
246 | 253 | BLANK(); |
247 | 254 | DEFINE(ICACHE_BASE, offsetof(struct pdc_cache_info, ic_base)); |
248 | 255 | DEFINE(ICACHE_STRIDE, offsetof(struct pdc_cache_info, ic_stride)); |