Skip to content

Commit 731fd4b

Browse files
Ivan Kokshayskygregkh
authored andcommitted
alpha: replace hardcoded stack offsets with autogenerated ones
commit 77b823fa619f97d16409ca37ad4f7936e28c5f83 upstream. 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]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c986a5f commit 731fd4b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

arch/alpha/kernel/asm-offsets.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ void foo(void)
3232
DEFINE(CRED_EGID, offsetof(struct cred, egid));
3333
BLANK();
3434

35+
DEFINE(SP_OFF, offsetof(struct pt_regs, ps));
3536
DEFINE(SIZEOF_PT_REGS, sizeof(struct pt_regs));
37+
DEFINE(SWITCH_STACK_SIZE, sizeof(struct switch_stack));
3638
DEFINE(PT_PTRACED, PT_PTRACED);
3739
DEFINE(CLONE_VM, CLONE_VM);
3840
DEFINE(CLONE_UNTRACED, CLONE_UNTRACED);

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 320
21-
2218
.macro CFI_START_OSF_FRAME func
2319
.align 4
2420
.globl \func

0 commit comments

Comments
 (0)