Skip to content

Commit 77b823f

Browse files
Ivan Kokshayskymattst88
authored andcommitted
alpha: replace hardcoded stack offsets with autogenerated ones
This allows the assembly in entry.S to automatically keep in sync with changes in the stack layout (struct pt_regs and struct switch_stack). Cc: [email protected] Tested-by: Maciej W. Rozycki <[email protected]> Tested-by: Matt Turner <[email protected]> Reviewed-by: Maciej W. Rozycki <[email protected]> Signed-off-by: Ivan Kokshaysky <[email protected]> Signed-off-by: Matt Turner <[email protected]>
1 parent 128c8f9 commit 77b823f

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

arch/alpha/kernel/asm-offsets.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,13 @@ static void __used foo(void)
1919
DEFINE(TI_STATUS, offsetof(struct thread_info, status));
2020
BLANK();
2121

22+
DEFINE(SP_OFF, offsetof(struct pt_regs, ps));
2223
DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
2324
BLANK();
2425

26+
DEFINE(SWITCH_STACK_SIZE, sizeof(struct switch_stack));
27+
BLANK();
28+
2529
DEFINE(HAE_CACHE, offsetof(struct alpha_machine_vector, hae_cache));
2630
DEFINE(HAE_REG, offsetof(struct alpha_machine_vector, hae_register));
2731
}

arch/alpha/kernel/entry.S

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,6 @@
1515
.set noat
1616
.cfi_sections .debug_frame
1717

18-
/* Stack offsets. */
19-
#define SP_OFF 184
20-
#define SWITCH_STACK_SIZE 64
21-
2218
.macro CFI_START_OSF_FRAME func
2319
.align 4
2420
.globl \func

0 commit comments

Comments
 (0)