From 5df95ac5eaa4703a68cdd8503f7ca423eba67888 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 10 Oct 2018 22:18:03 +0100 Subject: [PATCH] z80, banking: fix ei/di reporting for swap --- Kernel/lib/z80fixedbank-banked.s | 5 +++++ Kernel/lib/z80fixedbank-core.s | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/Kernel/lib/z80fixedbank-banked.s b/Kernel/lib/z80fixedbank-banked.s index 0d0199fe..6a6a839a 100644 --- a/Kernel/lib/z80fixedbank-banked.s +++ b/Kernel/lib/z80fixedbank-banked.s @@ -131,6 +131,8 @@ _switchin: ; #2: kernel syscall. Also protected by U_DATA__U_INSYS ; ei + xor a + ld (_int_disabled),a push hl push de push af @@ -138,6 +140,9 @@ _switchin: pop af pop de pop hl + ld a,#1 ; don't change this for an inc a. The push/pop af may + ; be eaten by the banking code! + ld (_int_disabled),a di .endif ld a, (hl) diff --git a/Kernel/lib/z80fixedbank-core.s b/Kernel/lib/z80fixedbank-core.s index 4e0f57c3..3b69222a 100644 --- a/Kernel/lib/z80fixedbank-core.s +++ b/Kernel/lib/z80fixedbank-core.s @@ -120,11 +120,15 @@ _switchin: ; #2: kernel syscall. Also protected by U_DATA__U_INSYS ; ei + xor a + ld (_int_disabled),a push hl push de call _swapper pop de pop hl + ld a,#1 + ld (_int_disabled),a di .endif ld a, (hl) -- 2.34.1