Skip to content

Commit

Permalink
[PATCH] ARM: 2769/1: cpu_init() stack setup fix
Browse files Browse the repository at this point in the history
Patch from Catalin Marinas

The compiler allocates r14 for the stk variable in the __asm__ directive.
This is a shadowed register and gets changed when the mode is changed,
causing random values in the SP register. The patch adds a clobber for
the r14 register.

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
  • Loading branch information
Catalin Marinas authored and Russell King committed Jun 29, 2005
1 parent 9ec3c75 commit aaaa3f9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ void cpu_init(void)
"I" (offsetof(struct stack, abt[0])),
"I" (PSR_F_BIT | PSR_I_BIT | UND_MODE),
"I" (offsetof(struct stack, und[0])),
"I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE));
"I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
: "r14");
}

static struct machine_desc * __init setup_machine(unsigned int nr)
Expand Down

0 comments on commit aaaa3f9

Please sign in to comment.