1 diff -ruN linux-2.6.15.1/include/asm-i386/libgcc.h linux-2.6.15.1-openwrt/include/asm-i386/libgcc.h
2 --- linux-2.6.15.1/include/asm-i386/libgcc.h 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.15.1-openwrt/include/asm-i386/libgcc.h 2006-02-01 15:47:53.000000000 +0100
5 +#ifndef __ASM_LIBGCC_H
6 +#define __ASM_LIBGCC_H
8 +#undef ARCH_NEEDS_ashldi3
9 +#undef ARCH_NEEDS_ashrdi3
10 +#undef ARCH_NEEDS_lshrdi3
12 +#endif /* __ASM_LIBGCC_H */
13 diff -Nur linux-2.6.15.1/include/asm-mips/libgcc.h linux-2.6.15.1-openwrt/include/asm-mips/libgcc.h
14 --- linux-2.6.15.1/include/asm-mips/libgcc.h 1970-01-01 01:00:00.000000000 +0100
15 +++ linux-2.6.15.1-openwrt/include/asm-mips/libgcc.h 2006-01-20 10:32:28.000000000 +0100
17 +#ifndef __ASM_LIBGCC_H
18 +#define __ASM_LIBGCC_H
20 +#define ARCH_NEEDS_ashldi3
21 +#define ARCH_NEEDS_ashrdi3
22 +#define ARCH_NEEDS_lshrdi3
24 +#endif /* __ASM_LIBGCC_H */
25 diff -Nur linux-2.6.15.1/include/linux/libgcc.h linux-2.6.15.1-openwrt/include/linux/libgcc.h
26 --- linux-2.6.15.1/include/linux/libgcc.h 1970-01-01 01:00:00.000000000 +0100
27 +++ linux-2.6.15.1-openwrt/include/linux/libgcc.h 2006-01-20 10:33:38.000000000 +0100
29 +#ifndef __LINUX_LIBGCC_H
30 +#define __LINUX_LIBGCC_H
32 +#include <asm/byteorder.h>
33 +#include <asm/libgcc.h>
35 +typedef long long DWtype;
37 +typedef unsigned int UWtype;
38 +typedef int word_type __attribute__ ((mode (__word__)));
40 +#define BITS_PER_UNIT 8
46 +#elif defined(__LITTLE_ENDIAN)
60 +#endif /* __LINUX_LIBGCC_H */
61 diff -Nur linux-2.6.15.1/lib/ashldi3.c linux-2.6.15.1-openwrt/lib/ashldi3.c
62 --- linux-2.6.15.1/lib/ashldi3.c 1970-01-01 01:00:00.000000000 +0100
63 +++ linux-2.6.15.1-openwrt/lib/ashldi3.c 2006-01-20 10:38:41.000000000 +0100
65 +#include <linux/libgcc.h>
66 +#include <linux/module.h>
68 +#ifdef ARCH_NEEDS_ashldi3
70 +DWtype __ashldi3(DWtype u, word_type b)
79 + bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
83 + w.s.high = (UWtype) uu.s.low << -bm;
85 + const UWtype carries = (UWtype) uu.s.low >> bm;
87 + w.s.low = (UWtype) uu.s.low << b;
88 + w.s.high = ((UWtype) uu.s.high << b) | carries;
94 +EXPORT_SYMBOL(__ashldi3);
96 +#endif /* ARCH_NEEDS_ashldi3 */
97 diff -Nur linux-2.6.15.1/lib/ashrdi3.c linux-2.6.15.1-openwrt/lib/ashrdi3.c
98 --- linux-2.6.15.1/lib/ashrdi3.c 1970-01-01 01:00:00.000000000 +0100
99 +++ linux-2.6.15.1-openwrt/lib/ashrdi3.c 2006-01-20 10:39:29.000000000 +0100
101 +#include <linux/libgcc.h>
102 +#include <linux/module.h>
104 +/* Unless shift functions are defined with full ANSI prototypes,
105 + parameter b will be promoted to int if word_type is smaller than an int. */
106 +#ifdef ARCH_NEEDS_ashrdi3
108 +DWtype __ashrdi3(DWtype u, word_type b)
117 + bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
120 + /* w.s.high = 1..1 or 0..0 */
122 + uu.s.high >> (sizeof(Wtype) * BITS_PER_UNIT - 1);
123 + w.s.low = uu.s.high >> -bm;
125 + const UWtype carries = (UWtype) uu.s.high << bm;
127 + w.s.high = uu.s.high >> b;
128 + w.s.low = ((UWtype) uu.s.low >> b) | carries;
134 +EXPORT_SYMBOL(__ashrdi3);
136 +#endif /* ARCH_NEEDS_ashrdi3 */
137 diff -Nur linux-2.6.15.1/lib/lshrdi3.c linux-2.6.15.1-openwrt/lib/lshrdi3.c
138 --- linux-2.6.15.1/lib/lshrdi3.c 1970-01-01 01:00:00.000000000 +0100
139 +++ linux-2.6.15.1-openwrt/lib/lshrdi3.c 2006-01-20 10:40:10.000000000 +0100
141 +#include <linux/libgcc.h>
142 +#include <linux/module.h>
144 +/* Unless shift functions are defined with full ANSI prototypes,
145 + parameter b will be promoted to int if word_type is smaller than an int. */
146 +#ifdef ARCH_NEEDS_lshrdi3
148 +DWtype __lshrdi3(DWtype u, word_type b)
157 + bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
161 + w.s.low = (UWtype) uu.s.high >> -bm;
163 + const UWtype carries = (UWtype) uu.s.high << bm;
165 + w.s.high = (UWtype) uu.s.high >> b;
166 + w.s.low = ((UWtype) uu.s.low >> b) | carries;
172 +EXPORT_SYMBOL(__lshrdi3);
174 +#endif /* ARCH_NEEDS_lshrdi3 */
175 diff -Nur linux-2.6.15.1/lib/Makefile linux-2.6.15.1-openwrt/lib/Makefile
176 --- linux-2.6.15.1/lib/Makefile 2006-01-15 07:16:02.000000000 +0100
177 +++ linux-2.6.15.1-openwrt/lib/Makefile 2006-01-20 10:34:19.000000000 +0100
181 lib-y += kobject.o kref.o kobject_uevent.o klist.o
182 +lib-y += ashldi3.o ashrdi3.o lshrdi3.o
184 obj-y += sort.o parser.o halfmd4.o