diff options
author | Aaron Durbin <adurbin@chromium.org> | 2018-04-21 00:14:08 -0600 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2018-04-24 14:36:31 +0000 |
commit | 38fd6685e9da61daadc96a8d537e6966dfe3b219 (patch) | |
tree | a7db2a48b53ed2a5fd6e1703d64ccb432621d6a4 /src | |
parent | 7a7c70b26a9744ec7acac807c98e2aaadd7f422d (diff) | |
download | coreboot-38fd6685e9da61daadc96a8d537e6966dfe3b219.tar.gz coreboot-38fd6685e9da61daadc96a8d537e6966dfe3b219.tar.bz2 coreboot-38fd6685e9da61daadc96a8d537e6966dfe3b219.zip |
arch/x86: align stack on entry to x86_exception()
Entry points from assembly to C need to have the stacks aligned
to 16 bytes with the newer compilers. This entry point was
missed. Correct it.
BUG=b:72728953
Change-Id: Idb29daf830c05fd5543c2194690364ce31b6a22c
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/25763
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
Diffstat (limited to 'src')
-rw-r--r-- | src/arch/x86/idt.S | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/arch/x86/idt.S b/src/arch/x86/idt.S index 1878f802ede9..17ddb57fb7b9 100644 --- a/src/arch/x86/idt.S +++ b/src/arch/x86/idt.S @@ -172,9 +172,16 @@ int_hand: pushl %ecx pushl %eax - pushl %esp /* Pointer to structure on the stack */ + /* Save pointer to eregs structure */ + movl %esp, %ebp + /* Align stack to 16 bytes. */ + andl $0xfffffff0, %esp + /* Save original stack pointer while keeping stack alignment. This + value is also the eregs argument x86_exception(). */ + sub $12, %esp + pushl %ebp /* Pointer to structure on the stack */ call x86_exception - pop %eax /* Drop the pointer */ + pop %esp /* Unwind the stack alignment and argument passing. */ popl %eax popl %ecx |