From 4eec4480aabc5a537ebb532a3514043d19d7115b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Sat, 30 Jun 2018 23:10:12 +0100 Subject: [PATCH] lowlevel-z80: Fix a tiny hole in the reti handling What's not documented properly in the manual is that reti behaves like retn in IFF1/2 handling not like ret. --- Kernel/lowlevel-z80-banked.s | 3 ++- Kernel/lowlevel-z80.s | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Kernel/lowlevel-z80-banked.s b/Kernel/lowlevel-z80-banked.s index c774e35c..6e438a78 100644 --- a/Kernel/lowlevel-z80-banked.s +++ b/Kernel/lowlevel-z80-banked.s @@ -521,7 +521,8 @@ preemption: ; hence the need to reti ; -intret2:call map_kernel +intret2:di + call map_kernel ; ; Semantically we are doing a null syscall for pre-empt. We need ; to record ourselves as in a syscall so we can't be recursively diff --git a/Kernel/lowlevel-z80.s b/Kernel/lowlevel-z80.s index d78b8507..00961798 100644 --- a/Kernel/lowlevel-z80.s +++ b/Kernel/lowlevel-z80.s @@ -149,7 +149,7 @@ unix_syscall_entry: push af ex af, af' exx - push bc ; FIXME we don't I tihnk need to save bc/de/hl + push bc ; FIXME we don't I think need to save bc/de/hl push de ; as they are compiler caller save push hl exx @@ -531,7 +531,7 @@ preemption: ; and the controllers have seen the ; reti M1 cycle. However we still ; have DI set - + di ; see undocumented Z80 notes on RETI ; ; We are now on the syscall stack (which is fine, we don't ; pre-empt mid syscall so therefore it is free. We will now -- 2.34.1