From: Alan Cox Date: Sat, 30 May 2015 18:36:15 +0000 (+0100) Subject: msx2: correct for new style IRQ handling X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=c88bce9076e914f38fb53d32154a3ba1672db41f;p=FUZIX.git msx2: correct for new style IRQ handling Untested - needs the Makefiles fixing for the fact bootrom.bin has no rule to create it --- diff --git a/Kernel/platform-msx2/msx2.s b/Kernel/platform-msx2/msx2.s index a1326d78..a0446ddb 100644 --- a/Kernel/platform-msx2/msx2.s +++ b/Kernel/platform-msx2/msx2.s @@ -19,7 +19,7 @@ .globl enaslt .globl _mapslot_bank1 .globl _mapslot_bank2 - .globl _kernel_flag + .globl _need_resched ; video driver .globl _vtinit @@ -61,16 +61,6 @@ ; ----------------------------------------------------------------------------- .area _COMMONMEM -trapmsg: .ascii "Trapdoor: SP=" - .db 0 -trapmsg2: .ascii ", PC=" - .db 0 -tm_user_sp: .dw 0 - -tm_stack: - .db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 -tm_stack_top: - ; Ideally return to any debugger/monitor _trap_monitor: di @@ -82,8 +72,8 @@ _trap_reboot: di halt -_kernel_flag: - .db 1 +_need_resched: + .db 0 ; ----------------------------------------------------------------------------- ; KERNEL MEMORY BANK (below 0xF000, only accessible when the kernel is mapped) diff --git a/Kernel/platform-msx2/tricks.s b/Kernel/platform-msx2/tricks.s index 61bf111f..8ff22a35 100644 --- a/Kernel/platform-msx2/tricks.s +++ b/Kernel/platform-msx2/tricks.s @@ -8,7 +8,6 @@ .globl _getproc .globl _trap_monitor .globl trap_illegal - .globl _inint .globl _switchout .globl _switchin .globl _doexec @@ -52,10 +51,6 @@ _switchout: push iy ld (U_DATA__U_SP), sp ; this is where the SP is restored in _switchin - ; set inint to false - xor a - ld (_inint), a - ; find another process to run (may select this one again) call _getproc @@ -113,9 +108,9 @@ _switchin: pop hl ; return code ; enable interrupts, if the ISR isn't already running - ld a, (_inint) + ld a, (U_DATA__U_ININTERRUPT) or a - ret z ; in ISR, leave interrupts off + ret nz ; in ISR, leave interrupts off ei ret ; return with interrupts on