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
pop af
push hl
+ push af
call _switchin
; we should never get here
_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
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
; _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