kernel: add pre-emption signal checks to assembly paths
authorAlan Cox <alan@linux.intel.com>
Fri, 30 Mar 2018 21:58:06 +0000 (22:58 +0100)
committerAlan Cox <alan@linux.intel.com>
Fri, 30 Mar 2018 21:58:06 +0000 (22:58 +0100)
With these in place we appear to be good except for some kind of net
breakage that needs resolving.

Kernel/lowlevel-65c816.s
Kernel/lowlevel-6809.s
Kernel/lowlevel-68hc11.s
Kernel/lowlevel-z80-banked.s
Kernel/lowlevel-z80.s

index 210a06b..397fa32 100644 (file)
@@ -44,6 +44,7 @@
        .import _inint
        .import _platform_monitor
        .import _platform_switchout
+       .import _chksigs
 
        .import push0
        .import incaxy
@@ -626,6 +627,10 @@ ret_to_user:
        lda     #1
        sta     U_DATA__U_INSYS
        ;
+       ;       Check for signals (the kstack is sane at this point)
+       ;
+       jsr     _chksigs
+       ;
        ;       Mark outselves as idle
        ;
        ldx     U_DATA__U_PTAB
index d32759a..6ca0547 100644 (file)
@@ -305,6 +305,8 @@ in_kernel:
            ; Pre emption occurs on the task stack. Conceptually its a
            ; not quite a syscall
            lds #kstack_top
+           jsr _chksigs                ; check signal state
+           ;
            ldx U_DATA__U_PTAB
            ; Move to ready state
            lda #P_READY
index 91a52b5..0183815 100644 (file)
@@ -147,10 +147,11 @@ interrupt_handler:
        ldd istack_switched_sp
        std U_DATA__U_SYSCALL_SP
        lds #kstack_top
+       jsr chksigs
        ldx U_DATA__U_PTAB
        ldab #P_READY
        stab P_TAB__P_STATUS_OFFSET,x
-       jsr switchout
+       jsr platform_switchout
        jsr map_process_always
        ; caller will switch back to stack in X
        ldx U_DATA__U_SYSCALL_SP
index c2ae3b5..c7d7d44 100644 (file)
@@ -522,7 +522,6 @@ preemption:
 
        ;
 intret2:call map_kernel
-
        ;
        ; Semantically we are doing a null syscall for pre-empt. We need
        ; to record ourselves as in a syscall so we can't be recursively
@@ -530,6 +529,13 @@ intret2:call map_kernel
        ;
        ld a, #1
        ld (U_DATA__U_INSYS), a
+       ;
+       ; Check for signals
+       ;
+       push af
+       call chksigs
+       pop af
+
        ;
        ; Process status is offset 0
        ;
index a583a55..d78b850 100644 (file)
@@ -541,7 +541,6 @@ preemption:
 
        ;
 intret2:call map_kernel
-
        ;
        ; Semantically we are doing a null syscall for pre-empt. We need
        ; to record ourselves as in a syscall so we can't be recursively
@@ -550,6 +549,10 @@ intret2:call map_kernel
        ld a, #1
        ld (U_DATA__U_INSYS), a
        ;
+       ; Check for signals
+       ;
+       call _chksigs
+       ;
        ; Process status is offset 0
        ;
        ld hl, (U_DATA__U_PTAB)