[HAL] Reset the stack pointer to the stack frame when calling second-entry interrupt...
authorThomas Faber <thomas.faber@reactos.org>
Fri, 13 Apr 2018 06:48:57 +0000 (08:48 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Fri, 13 Apr 2018 07:04:52 +0000 (09:04 +0200)
commitfc9bc9390d1b6548acc21922546711042483e5b8
treeb9cc7e824a5051b289561cfc4018c213cd224b5a
parentbb03da981cf476686b05884bdcef3f507f3b88f8
[HAL] Reset the stack pointer to the stack frame when calling second-entry interrupt handlers. CORE-14449

Because we can encounter pending interrupts repeatedly,
HalpEndSoftwareInterrupt and HalEndSystemInterrupt already clean up the stack
space for their arguments (done for CORE-11123/CORE-14076).
However these functions are called from C functions such as KiInterruptDispatch
and HalpDispatchInterrupt2[ndEntry]. These callers also use up stack space,
and it is unknown how much.
To fix this, we simply reset the stack pointer to the location of the trap
frame, which is where it points during a first-level dispatch. This cleans
up the stack usage of any callers higher up, and is okay because a return
will happen through the trap frame anyway.

Dedicated to Pierre.
hal/halx86/up/pic.S