From 50b9da65f4f4b769107250b3fad091ce89b58d0d Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 13 Aug 2018 13:52:37 +0100 Subject: [PATCH] sam: more work on fork support for 32/32 --- Kernel/platform-sam/sam.s | 5 ++--- Kernel/platform-sam/tricks.s | 16 ++++++++++++---- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/Kernel/platform-sam/sam.s b/Kernel/platform-sam/sam.s index b2eec66c..a841e4bd 100644 --- a/Kernel/platform-sam/sam.s +++ b/Kernel/platform-sam/sam.s @@ -239,10 +239,9 @@ _platform_copier_l: ; Must be low and #0x60 ; preserve the colour bits or #KERNEL_HIGH out (251),a - ret + jp (ix) syscall_stash: .byte 0 ; must be low - nop rst18: _platform_doexec: out (251),a ; caller needs to handle CLUT bits @@ -302,7 +301,7 @@ _platform_copier_h: and #0x60 or #KERNEL_HIGH out (251),a - ret + jp (ix) interrupt_high: push af push de diff --git a/Kernel/platform-sam/tricks.s b/Kernel/platform-sam/tricks.s index dbe2770d..e32fa358 100644 --- a/Kernel/platform-sam/tricks.s +++ b/Kernel/platform-sam/tricks.s @@ -152,7 +152,9 @@ _dofork: ; Parent state built and in u_data + push ix call copy_process + pop ix ; Low page is undefined at this point which is ok as we are ; about to change it again @@ -209,24 +211,30 @@ _dofork: ; exx ; ld a,#kernel ; out (whatever),a -; ret +; jp (ix) ; ; There have to be two of these - one in high stubs one in low because ; the high banks will both be mapped so the low one isn't available ; +; We also have no sane stack for these so we use ix as the return. +; copy_process: ld de,#P_TAB__P_PAGE2_OFFSET add hl,de ld a,(U_DATA__U_PAGE) call map_page_low call setup_platform_copier - call _platform_copier_l + ld ix,#cp1ret + jp _platform_copier_l +cp1ret: inc hl inc hl ld a,(U_DATA__U_PAGE2) call map_page_low call setup_platform_copier - call _platform_copier_h + ld ix,#cp2ret + jp _platform_copier_h +cp2ret: ret setup_platform_copier: @@ -236,4 +244,4 @@ setup_platform_copier: ld b,d ld c,e exx - ret \ No newline at end of file + ret -- 2.34.1