1 --- a/arch/ubicom32/Makefile
2 +++ b/arch/ubicom32/Makefile
3 @@ -60,9 +60,6 @@ cflags-$(CONFIG_UBICOM32_V4) := -march=
4 ldflags-$(CONFIG_LINKER_RELAXATION) := --relax
5 LDFLAGS_vmlinux := $(ldflags-y)
7 -GCCLIBDIR := $(dir $(shell $(CC) $(cflags-y) -print-libgcc-file-name))
8 -GCC_LIBS := $(GCCLIBDIR)/libgcc.a
10 KBUILD_CFLAGS += $(cflags-y) -ffunction-sections
11 KBUILD_AFLAGS += $(cflags-y)
13 @@ -84,7 +81,6 @@ core-y += arch/$(ARCH)/kernel/ \
14 drivers-$(CONFIG_OPROFILE) += arch/ubicom32/oprofile/
16 libs-y += arch/$(ARCH)/lib/
17 -libs-y += $(GCC_LIBS)
21 --- a/arch/ubicom32/lib/Makefile
22 +++ b/arch/ubicom32/lib/Makefile
26 lib-y := checksum.o delay.o mem_ubicom32.o
27 +lib-y += ashldi3.o ashrdi3.o divmod.o lshrdi3.o muldi3.o
29 +++ b/arch/ubicom32/lib/ashldi3.c
31 +/* ashrdi3.c extracted from gcc-2.95.2/libgcc2.c which is: */
32 +/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
34 +This file is part of GNU CC.
36 +GNU CC is free software; you can redistribute it and/or modify
37 +it under the terms of the GNU General Public License as published by
38 +the Free Software Foundation; either version 2, or (at your option)
41 +GNU CC is distributed in the hope that it will be useful,
42 +but WITHOUT ANY WARRANTY; without even the implied warranty of
43 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44 +GNU General Public License for more details.
46 +You should have received a copy of the GNU General Public License
47 +along with GNU CC; see the file COPYING. If not, write to
48 +the Free Software Foundation, 59 Temple Place - Suite 330,
49 +Boston, MA 02111-1307, USA. */
51 +#define BITS_PER_UNIT 8
53 +typedef int SItype __attribute__ ((mode (SI)));
54 +typedef unsigned int USItype __attribute__ ((mode (SI)));
55 +typedef int DItype __attribute__ ((mode (DI)));
56 +typedef int word_type __attribute__ ((mode (__word__)));
58 +struct DIstruct {SItype high, low;};
67 +__ashldi3 (DItype u, word_type b)
78 + bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
82 + w.s.high = (USItype)uu.s.low << -bm;
86 + USItype carries = (USItype)uu.s.low >> bm;
87 + w.s.low = (USItype)uu.s.low << b;
88 + w.s.high = ((USItype)uu.s.high << b) | carries;
94 +++ b/arch/ubicom32/lib/ashrdi3.c
96 +/* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */
97 +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
99 +This file is part of GNU CC.
101 +GNU CC is free software; you can redistribute it and/or modify
102 +it under the terms of the GNU General Public License as published by
103 +the Free Software Foundation; either version 2, or (at your option)
106 +GNU CC is distributed in the hope that it will be useful,
107 +but WITHOUT ANY WARRANTY; without even the implied warranty of
108 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
109 +GNU General Public License for more details.
111 +You should have received a copy of the GNU General Public License
112 +along with GNU CC; see the file COPYING. If not, write to
113 +the Free Software Foundation, 59 Temple Place - Suite 330,
114 +Boston, MA 02111-1307, USA. */
116 +#define BITS_PER_UNIT 8
118 +typedef int SItype __attribute__ ((mode (SI)));
119 +typedef unsigned int USItype __attribute__ ((mode (SI)));
120 +typedef int DItype __attribute__ ((mode (DI)));
121 +typedef int word_type __attribute__ ((mode (__word__)));
123 +struct DIstruct {SItype high, low;};
132 +__ashrdi3 (DItype u, word_type b)
143 + bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
146 + /* w.s.high = 1..1 or 0..0 */
147 + w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1);
148 + w.s.low = uu.s.high >> -bm;
152 + USItype carries = (USItype)uu.s.high << bm;
153 + w.s.high = uu.s.high >> b;
154 + w.s.low = ((USItype)uu.s.low >> b) | carries;
160 +++ b/arch/ubicom32/lib/divmod.c
163 +udivmodsi4(unsigned long num, unsigned long den, int modwanted)
165 + unsigned long bit = 1;
166 + unsigned long res = 0;
168 + while (den < num && bit && !(den & (1L<<31)))
183 + if (modwanted) return num;
188 +__udivsi3 (long a, long b)
190 + return udivmodsi4 (a, b, 0);
194 +__umodsi3 (long a, long b)
196 + return udivmodsi4 (a, b, 1);
200 +__divsi3 (long a, long b)
217 + res = udivmodsi4 (a, b, 0);
226 +__modsi3 (long a, long b)
240 + res = udivmodsi4 (a, b, 1);
248 +++ b/arch/ubicom32/lib/lshrdi3.c
250 +/* lshrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */
251 +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
253 +This file is part of GNU CC.
255 +GNU CC is free software; you can redistribute it and/or modify
256 +it under the terms of the GNU General Public License as published by
257 +the Free Software Foundation; either version 2, or (at your option)
260 +GNU CC is distributed in the hope that it will be useful,
261 +but WITHOUT ANY WARRANTY; without even the implied warranty of
262 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
263 +GNU General Public License for more details.
265 +You should have received a copy of the GNU General Public License
266 +along with GNU CC; see the file COPYING. If not, write to
267 +the Free Software Foundation, 59 Temple Place - Suite 330,
268 +Boston, MA 02111-1307, USA. */
270 +#define BITS_PER_UNIT 8
272 +typedef int SItype __attribute__ ((mode (SI)));
273 +typedef unsigned int USItype __attribute__ ((mode (SI)));
274 +typedef int DItype __attribute__ ((mode (DI)));
275 +typedef int word_type __attribute__ ((mode (__word__)));
277 +struct DIstruct {SItype high, low;};
286 +__lshrdi3 (DItype u, word_type b)
297 + bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
301 + w.s.low = (USItype)uu.s.high >> -bm;
305 + USItype carries = (USItype)uu.s.high << bm;
306 + w.s.high = (USItype)uu.s.high >> b;
307 + w.s.low = ((USItype)uu.s.low >> b) | carries;
313 +++ b/arch/ubicom32/lib/muldi3.c
315 +/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and
316 + gcc-2.7.2.3/longlong.h which is: */
317 +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
319 +This file is part of GNU CC.
321 +GNU CC is free software; you can redistribute it and/or modify
322 +it under the terms of the GNU General Public License as published by
323 +the Free Software Foundation; either version 2, or (at your option)
326 +GNU CC is distributed in the hope that it will be useful,
327 +but WITHOUT ANY WARRANTY; without even the implied warranty of
328 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
329 +GNU General Public License for more details.
331 +You should have received a copy of the GNU General Public License
332 +along with GNU CC; see the file COPYING. If not, write to
333 +the Free Software Foundation, 59 Temple Place - Suite 330,
334 +Boston, MA 02111-1307, USA. */
336 +#define UWtype USItype
337 +#define UHWtype USItype
338 +#define W_TYPE_SIZE 32
339 +#define __BITS4 (W_TYPE_SIZE / 4)
340 +#define __ll_B ((UWtype) 1 << (W_TYPE_SIZE / 2))
341 +#define __ll_lowpart(t) ((UWtype) (t) & (__ll_B - 1))
342 +#define __ll_highpart(t) ((UWtype) (t) >> (W_TYPE_SIZE / 2))
344 +#define umul_ppmm(w1, w0, u, v) \
346 + UWtype __x0, __x1, __x2, __x3; \
347 + UHWtype __ul, __vl, __uh, __vh; \
349 + __ul = __ll_lowpart (u); \
350 + __uh = __ll_highpart (u); \
351 + __vl = __ll_lowpart (v); \
352 + __vh = __ll_highpart (v); \
354 + __x0 = (UWtype) __ul * __vl; \
355 + __x1 = (UWtype) __ul * __vh; \
356 + __x2 = (UWtype) __uh * __vl; \
357 + __x3 = (UWtype) __uh * __vh; \
359 + __x1 += __ll_highpart (__x0);/* this can't give carry */ \
360 + __x1 += __x2; /* but this indeed can */ \
361 + if (__x1 < __x2) /* did we get it? */ \
362 + __x3 += __ll_B; /* yes, add it in the proper pos. */ \
364 + (w1) = __x3 + __ll_highpart (__x1); \
365 + (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \
369 +#define __umulsidi3(u, v) \
371 + umul_ppmm (__w.s.high, __w.s.low, u, v); \
374 +typedef int SItype __attribute__ ((mode (SI)));
375 +typedef unsigned int USItype __attribute__ ((mode (SI)));
376 +typedef int DItype __attribute__ ((mode (DI)));
377 +typedef int word_type __attribute__ ((mode (__word__)));
379 +struct DIstruct {SItype high, low;};
388 +__muldi3 (DItype u, DItype v)
396 + w.ll = __umulsidi3 (uu.s.low, vv.s.low);
397 + w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high
398 + + (USItype) uu.s.high * (USItype) vv.s.low);
402 --- a/arch/ubicom32/kernel/ubicom32_ksyms.c
403 +++ b/arch/ubicom32/kernel/ubicom32_ksyms.c
404 @@ -72,7 +72,6 @@ EXPORT_SYMBOL(memmove);
405 extern void __ashldi3(void);
406 extern void __ashrdi3(void);
407 extern void __divsi3(void);
408 -extern void __divdi3(void);
409 extern void __lshrdi3(void);
410 extern void __modsi3(void);
411 extern void __muldi3(void);
412 @@ -83,7 +82,6 @@ extern void __umodsi3(void);
413 EXPORT_SYMBOL(__ashldi3);
414 EXPORT_SYMBOL(__ashrdi3);
415 EXPORT_SYMBOL(__divsi3);
416 -EXPORT_SYMBOL(__divdi3);
417 EXPORT_SYMBOL(__lshrdi3);
418 EXPORT_SYMBOL(__modsi3);
419 EXPORT_SYMBOL(__muldi3);