Remove non-_KERNEL code path for division by zero. This will allow the
authormiod <miod@openbsd.org>
Fri, 2 Sep 2022 10:12:46 +0000 (10:12 +0000)
committermiod <miod@openbsd.org>
Fri, 2 Sep 2022 10:12:46 +0000 (10:12 +0000)
bootblocks to shrink a little.

sys/lib/libkern/arch/sh/sdivsi3.S
sys/lib/libkern/arch/sh/udivsi3.S

index 2315363..696dd04 100644 (file)
@@ -62,32 +62,5 @@ NENTRY(__sdivsi3)
         addc   r2, r0
 
 div_by_zero:
-#ifdef _KERNEL
        rts
         mov    #0, r0
-#else
-       mov.l   r14, @-r15
-       sts.l   pr, @-r15
-       mov     r15, r14
-
-       mov.l   L_raise, r1
-#ifdef PIC
-1:     bsrf    r1
-#else
-       jsr     @r1
-#endif
-        mov    #8, r4          /* delay slot.  8 <- SIGFPE. */
-       mov     #0, r0
-
-       lds.l   @r15+, pr
-       rts
-        mov.l  @r15+, r14
-
-       .align  2
-L_raise:
-#ifdef PIC
-       .long   _C_LABEL(raise)-(1b+4)
-#else
-       .long   _C_LABEL(raise)
-#endif
-#endif
index a35be6d..d6ab608 100644 (file)
@@ -76,32 +76,5 @@ NENTRY(__udivsi3)
         mov    r4, r0
 
 div_by_zero:
-#ifdef _KERNEL
        rts
         mov    #0, r0
-#else
-       mov.l   r14, @-r15
-       sts.l   pr, @-r15
-       mov     r15, r14
-
-       mov.l   L_raise, r1
-#ifdef PIC
-1:     bsrf    r1
-#else
-       jsr     @r1
-#endif
-        mov    #8, r4          /* delay slot.  8 <- SIGFPE. */
-       mov     #0, r0
-
-       lds.l   @r15+, pr
-       rts
-        mov.l  @r15+, r14
-
-       .align  2
-L_raise:
-#ifdef PIC
-       .long   _C_LABEL(raise)-(1b+4)
-#else
-       .long   _C_LABEL(raise)
-#endif
-#endif