sam/thunked: Fix signal vector mishandling
authorAlan Cox <alan@linux.intel.com>
Sun, 18 Nov 2018 12:20:53 +0000 (12:20 +0000)
committerAlan Cox <alan@linux.intel.com>
Sun, 18 Nov 2018 12:20:53 +0000 (12:20 +0000)
Signals are now correctly delivered in my testing. This also makes the shutdown
command work properly as a result

Kernel/lowlevel-z80-thunked.s
Kernel/platform-sam/sam.s

index e4ca5b0..efe6540 100644 (file)
@@ -252,7 +252,8 @@ interrupt_sig:
        ld e,a
        xor a
        ld (_int_disabled),a
-       ld d,a
+       ld e,a
+       ld c,a
        ld (U_DATA__U_CURSIG),a
        ld hl,#U_DATA__U_SIGVEC
        add hl,de
@@ -265,6 +266,8 @@ interrupt_sig:
        ld a,d
        or e
        jr z, no_sig
+       ex de,hl
+       ld e,c
        jr intret
 
 ;
index 1be0aac..5e02691 100644 (file)
@@ -607,8 +607,9 @@ syscall_sigret:
            ld h,#0
            push hl             ; signal
            ld hl,#syscall_sighelp
-           push hl             ; vector
-           ret
+           push hl             ; vector return
+           push bc             ; actual signal vector
+           ret                 ; to handler which will return to sighelp
 syscall_sighelp:
            pop de              ; discard signal
            pop de              ; recover error info