From d18bfbf375cb673955eee4782936f9837abf9793 Mon Sep 17 00:00:00 2001 From: miod Date: Fri, 2 Sep 2022 10:12:46 +0000 Subject: [PATCH] Remove non-_KERNEL code path for division by zero. This will allow the bootblocks to shrink a little. --- sys/lib/libkern/arch/sh/sdivsi3.S | 27 --------------------------- sys/lib/libkern/arch/sh/udivsi3.S | 27 --------------------------- 2 files changed, 54 deletions(-) diff --git a/sys/lib/libkern/arch/sh/sdivsi3.S b/sys/lib/libkern/arch/sh/sdivsi3.S index 23153632033..696dd047d36 100644 --- a/sys/lib/libkern/arch/sh/sdivsi3.S +++ b/sys/lib/libkern/arch/sh/sdivsi3.S @@ -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 diff --git a/sys/lib/libkern/arch/sh/udivsi3.S b/sys/lib/libkern/arch/sh/udivsi3.S index a35be6d6a4d..d6ab60843b0 100644 --- a/sys/lib/libkern/arch/sh/udivsi3.S +++ b/sys/lib/libkern/arch/sh/udivsi3.S @@ -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 -- 2.20.1