Skip to content

Commit d4d016c

Browse files
committed
alpha: move __udiv_qrnnd library function to arch/alpha/lib/
We already had the implementation for __udiv_qrnnd (unsigned divide for multi-precision arithmetic) as part of the alpha math emulation code. But you can disable the math emulation code - even if you shouldn't - and then the MPI code that actually wants this functionality (and is needed by various crypto functions) will fail to build. So move the extended-precision divide code to be a regular library function, just like all the regular division code is. That way ie is available regardless of math-emulation. Signed-off-by: Linus Torvalds <[email protected]>
1 parent ab41f75 commit d4d016c

File tree

5 files changed

+5
-3
lines changed

5 files changed

+5
-3
lines changed

arch/alpha/include/asm/asm-prototypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,4 @@ extern void __divlu(void);
1616
extern void __remlu(void);
1717
extern void __divqu(void);
1818
extern void __remqu(void);
19+
extern unsigned long __udiv_qrnnd(unsigned long *, unsigned long, unsigned long , unsigned long);

arch/alpha/lib/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ ev6-$(CONFIG_ALPHA_EV6) := ev6-
1414
ev67-$(CONFIG_ALPHA_EV67) := ev67-
1515

1616
lib-y = __divqu.o __remqu.o __divlu.o __remlu.o \
17+
udiv-qrnnd.o \
1718
udelay.o \
1819
$(ev6-y)memset.o \
1920
$(ev6-y)memcpy.o \

arch/alpha/math-emu/qrnnd.S renamed to arch/alpha/lib/udiv-qrnnd.S

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
# along with GCC; see the file COPYING. If not, write to the
2626
# Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
2727
# MA 02111-1307, USA.
28+
#include <asm/export.h>
2829

2930
.set noreorder
3031
.set noat
@@ -161,3 +162,4 @@ $Odd:
161162
ret $31,($26),1
162163

163164
.end __udiv_qrnnd
165+
EXPORT_SYMBOL(__udiv_qrnnd)

arch/alpha/math-emu/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ ccflags-y := -w
77

88
obj-$(CONFIG_MATHEMU) += math-emu.o
99

10-
math-emu-objs := math.o qrnnd.o
10+
math-emu-objs := math.o

arch/alpha/math-emu/math.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -403,5 +403,3 @@ alpha_fp_emul_imprecise (struct pt_regs *regs, unsigned long write_mask)
403403
egress:
404404
return si_code;
405405
}
406-
407-
EXPORT_SYMBOL(__udiv_qrnnd);

0 commit comments

Comments
 (0)