z80: fix a nasty bug with the full bank switching model on swapless
authorAlan Cox <alan@linux.intel.com>
Tue, 7 Aug 2018 23:10:05 +0000 (00:10 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 7 Aug 2018 23:10:05 +0000 (00:10 +0100)
commitc9465c0d879dab35e8df7754c116a9aecac17f34
treef11b31ad395fa1a13303e00e6ce5acf52e65a7fc
parent4daa47984b9fbe4c8f0b74f21fc9323aef6bf868
z80: fix a nasty bug with the full bank switching model on swapless

The swap case is ok as it always runs on the swap stack. The non swap case
restores the process kernel stack underneath the curent sp. That in itself is
fine as we have interrupts off. However we then called map_kernel which if
the current sp was above the sp of the save would corrupt the stack.

Instead restore sp first so that we push and pop data below the saved stack
content
Kernel/lib/z80fixedbank.s