From 4f21df6f3d6c673d3be3d87b9812781d449d5719 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 29 Sep 2018 16:21:11 +0100 Subject: [PATCH] z80: update library code for interrupt handling change --- Kernel/lib/z80fixedbank-banked.s | 3 +++ Kernel/lib/z80fixedbank-core.s | 3 +++ Kernel/lib/z80single.s | 3 +++ 3 files changed, 9 insertions(+) diff --git a/Kernel/lib/z80fixedbank-banked.s b/Kernel/lib/z80fixedbank-banked.s index 54a7ecb6..0d0199fe 100644 --- a/Kernel/lib/z80fixedbank-banked.s +++ b/Kernel/lib/z80fixedbank-banked.s @@ -31,6 +31,8 @@ .globl map_save_kmap .globl map_restore_kmap + .globl _int_disabled + ; imported debug symbols .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex @@ -198,6 +200,7 @@ skip_copyback: ; enable interrupts, if we didn't pre-empt in an ISR ld a, (U_DATA__U_ININTERRUPT) + ld (_int_disabled),a or a ret nz ; Not an ISR, leave interrupts off ei diff --git a/Kernel/lib/z80fixedbank-core.s b/Kernel/lib/z80fixedbank-core.s index 72cdbc9b..4e0f57c3 100644 --- a/Kernel/lib/z80fixedbank-core.s +++ b/Kernel/lib/z80fixedbank-core.s @@ -24,12 +24,14 @@ .globl _need_resched .globl _nready .globl _platform_idle + .globl _int_disabled .globl map_kernel .globl map_process .globl map_process_a .globl map_process_always + ; imported debug symbols .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex @@ -181,6 +183,7 @@ skip_copyback: ; enable interrupts, if we didn't pre-empt in an ISR ld a, (U_DATA__U_ININTERRUPT) + ld (_int_disabled),a or a ret nz ; Not an ISR, leave interrupts off ei diff --git a/Kernel/lib/z80single.s b/Kernel/lib/z80single.s index ffb5136f..b42e333f 100644 --- a/Kernel/lib/z80single.s +++ b/Kernel/lib/z80single.s @@ -19,6 +19,7 @@ .globl interrupt_handler .globl _swapper .globl _swapout + .globl _int_disabled ; imported debug symbols .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex @@ -138,6 +139,8 @@ not_swapped: ; enable interrupts, if the ISR isn't already running ld a, (U_DATA__U_ININTERRUPT) + ; put th einterrupt status flag back correctly + ld (_int_disabled),a or a ret nz ; in ISR, leave interrupts off ei -- 2.34.1