z80, banking: fix ei/di reporting for swap
authorAlan Cox <alan@linux.intel.com>
Wed, 10 Oct 2018 21:18:03 +0000 (22:18 +0100)
committerAlan Cox <alan@linux.intel.com>
Wed, 10 Oct 2018 21:18:03 +0000 (22:18 +0100)
Kernel/lib/z80fixedbank-banked.s
Kernel/lib/z80fixedbank-core.s

index 0d0199f..6a6a839 100644 (file)
@@ -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)
index 4e0f57c..3b69222 100644 (file)
@@ -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)