From: Alan Cox Date: Sat, 30 May 2015 12:43:44 +0000 (+0100) Subject: nc100: update to use new style IRQ handling X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=e34f5bfd9d7a92eb29f25baeee0cebecaf944461;p=FUZIX.git nc100: update to use new style IRQ handling --- diff --git a/Kernel/platform-nc100/nc100.s b/Kernel/platform-nc100/nc100.s index 8b32d06d..876b3738 100644 --- a/Kernel/platform-nc100/nc100.s +++ b/Kernel/platform-nc100/nc100.s @@ -14,7 +14,6 @@ .globl map_process_always .globl map_save .globl map_restore - .globl _kernel_flag ; for the PCMCIA disc driver .globl _rd_memcpy @@ -242,12 +241,6 @@ map_save: map_savearea: .db 0,0,0,0 -; -; has to live in common -; -_kernel_flag: - .db 1 - ; outchar: Wait for UART TX idle, then print the char in A ; destroys: AF outchar: diff --git a/Kernel/platform-nc100/tricks.s b/Kernel/platform-nc100/tricks.s index 004f53e0..ff1ba23f 100644 --- a/Kernel/platform-nc100/tricks.s +++ b/Kernel/platform-nc100/tricks.s @@ -8,7 +8,6 @@ .globl _getproc .globl _trap_monitor .globl trap_illegal - .globl _inint .globl _switchout .globl _switchin .globl _doexec @@ -18,6 +17,7 @@ .globl interrupt_handler .globl map_kernel .globl _ramtop + .globl _need_resched ; imported debug symbols .globl outstring, outde, outhl, outbc, outnewline, outchar, outcharhex @@ -32,6 +32,8 @@ ; here _ramtop: .dw 0 +_need_resched: + .db 0 ; Switchout switches out the current process, finds another that is READY, ; possibly the same process, and switches it in. When a process is @@ -54,10 +56,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 @@ -112,9 +110,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