process: rewrite the interrupt handling logic to be sane
authorAlan Cox <alan@linux.intel.com>
Sat, 30 May 2015 02:03:49 +0000 (03:03 +0100)
committerAlan Cox <alan@linux.intel.com>
Sat, 30 May 2015 02:03:49 +0000 (03:03 +0100)
commitf37e0b3929a7d0a7501775d99087560e727f9190
tree72bc8ccac91bc3a354e1021ec0410a30543739d0
parent422eef3dfab93d4a5e9d74d1181e5468bc0d6d28
process: rewrite the interrupt handling logic to be sane

We get rid of the whole UZI inherited irq stack madness as it leaves us
with a bunch of hard/unfixable problems.

Instead
- We only need one interrupt stack (although several if the banking is easier
  still works just fine)
- We don't task switch on the IRQ stack, instead if we are going to be
  pre-empting we pull a stunt with push/reti to complete the IRQ to
  the devices and then task switch on the syscall stack and do
  signal processing

This fixes all the pre-emption related crashes and mess with map saving. We
never have to bail from an IRQ because we are already in it. Various other
bits become cleaner.

In the process also rewrite (hopefully correctly this time) the Z80 signal
return paths.

This will probably break everything except Z80 platform devices using the
bankfixed helpers.

Note: The new IRQ code breaks sdltrs. I'll upload some patches for that
when I get a bit of time. Elements of the IRQ emulation and also reti
emulation are buggy in sdltrs it seems.

FIXME:
- At least one additional di to work around bits of the trs80 bugs
  can go away
Kernel/include/kernel.h
Kernel/lib/z80fixedbank.s
Kernel/lowlevel-z80.s
Kernel/process.c