From: Alan Cox Date: Fri, 25 May 2018 22:26:15 +0000 (+0100) Subject: z80-fixedbank-bank: Fixups X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=b89ec233d771902479d47302402ccae61b9f05fc;p=FUZIX.git z80-fixedbank-bank: Fixups With this it all seems to work - although I do need to investigate why it did a switchout/switchin in the first place. It should have been optimized out by the switchout() smarts I think --- diff --git a/Kernel/lib/z80fixedbank-banked.s b/Kernel/lib/z80fixedbank-banked.s index f688cfbf..aa2eca0d 100644 --- a/Kernel/lib/z80fixedbank-banked.s +++ b/Kernel/lib/z80fixedbank-banked.s @@ -71,6 +71,7 @@ _platform_switchout: pop af push hl + push af call _switchin ; we should never get here @@ -84,11 +85,13 @@ swapped: .ascii "_switchin: SWAPPED" _switchin: di pop bc ; return address + pop hl ; return address part 2 pop de ; new process pointer ; ; FIXME: do we actually *need* to restore the stack ! ; push de ; restore stack + push hl ; restore stack push bc ; restore stack ; FIXME??? call map_kernel_save @@ -155,6 +158,8 @@ not_swapped: ldir exx + call map_kernel_restore + ; check u_data->u_ptab matches what we wanted ld hl, (U_DATA__U_PTAB) ; u_data->u_ptab or a ; clear carry flag @@ -179,10 +184,10 @@ skip_copyback: ; _switchout or _dofork ld sp, (U_DATA__U_SP) + pop af pop iy pop ix pop hl ; return code - pop af call map_restore_kmap