From: Alan Cox Date: Sat, 8 Dec 2018 01:20:37 +0000 (+0000) Subject: zxdiv: update tricks to use makeproc, also turn on interrupts in swap X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=f4973b697da0f00057435f7900101674d0057544;p=FUZIX.git zxdiv: update tricks to use makeproc, also turn on interrupts in swap This may be a little bit exciting - it needs a lot more testing yet --- diff --git a/Kernel/dev/zx/tricks.s b/Kernel/dev/zx/tricks.s index 7b259ace..07d70969 100644 --- a/Kernel/dev/zx/tricks.s +++ b/Kernel/dev/zx/tricks.s @@ -1,12 +1,15 @@ ; Based on the Z80 Pack banked code ; ; Should unify this somewhat with lib/banked +; +; FIXME: switch to parent first for performance ; .module tricks .globl _ptab_alloc - .globl _newproc + .globl _makeproc + .globl _udata .globl _getproc .globl _platform_monitor .globl trap_illegal @@ -23,6 +26,7 @@ .globl _swapper .globl _int_disabled .globl switch_bank + .globl _inswap ; imported debug symbols .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex @@ -122,9 +126,11 @@ _switchin: ; these ; Turn this one once we have it all sorted and debugged - ; ei - ; xor a - ; ld (_int_disabled),a + xor a + ld (_int_disabled),a + inc a + ld (_inswap),a + ei push hl ; Save push de push hl ; Arguments @@ -138,7 +144,9 @@ _switchin: pop hl ld a,#1 ld (_int_disabled),a + dec a di + ld (_inswap),a ld a, (hl) ; We should now have a page assigned not_swapped: ld hl,(U_DATA__U_PTAB) @@ -393,12 +401,14 @@ _dofork: pop bc ; Make a new process table entry, etc. - ld hl, (fork_proc_ptr) + ld hl, #_udata + ld hl, (fork_proc_ptr) push hl push af - call _newproc + call _makeproc pop af pop bc + pop bc ; runticks = 0; ld hl, #0