From 4154d9829c22a395fefdc811c6d56eff4cc26eaa Mon Sep 17 00:00:00 2001 From: Will Sowerbutts Date: Sat, 27 Dec 2014 11:26:25 +0000 Subject: [PATCH] Kernel: Bug fix -- on system call, touch kernel_flag only after switching to the kernel memory bank --- Kernel/lowlevel-z80.s | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Kernel/lowlevel-z80.s b/Kernel/lowlevel-z80.s index 3088cdc2..c43c4f60 100644 --- a/Kernel/lowlevel-z80.s +++ b/Kernel/lowlevel-z80.s @@ -77,10 +77,6 @@ unix_syscall_entry: push ix push iy - ; make sure the interrupt logic knows we are in kernel mode - ld a, #1 - ld (_kernel_flag), a - ; locate function call arguments on the userspace stack ld hl, #18 ; 16 bytes machine state, plus 2 bytes return address add hl, sp @@ -103,6 +99,10 @@ unix_syscall_entry: ; map in kernel keeping common call map_kernel + ; make sure the interrupt logic knows we are in kernel mode (flag lives in kernel bank) + ld a, #1 + ld (_kernel_flag), a + ; re-enable interrupts ei -- 2.34.1