1 diff -Nur linux-2.6.15.1/include/asm-mips/libgcc.h linux-2.6.15.1-openwrt/include/asm-mips/libgcc.h
2 --- linux-2.6.15.1/include/asm-mips/libgcc.h 1970-01-01 01:00:00.000000000 +0100
3 +++ linux-2.6.15.1-openwrt/include/asm-mips/libgcc.h 2006-01-20 10:32:28.000000000 +0100
5 +#ifndef __ASM_LIBGCC_H
6 +#define __ASM_LIBGCC_H
8 +#define ARCH_NEEDS_ashldi3
9 +#define ARCH_NEEDS_ashrdi3
10 +#define ARCH_NEEDS_lshrdi3
12 +#endif /* __ASM_LIBGCC_H */
13 diff -Nur linux-2.6.15.1/include/linux/libgcc.h linux-2.6.15.1-openwrt/include/linux/libgcc.h
14 --- linux-2.6.15.1/include/linux/libgcc.h 1970-01-01 01:00:00.000000000 +0100
15 +++ linux-2.6.15.1-openwrt/include/linux/libgcc.h 2006-01-20 10:33:38.000000000 +0100
17 +#ifndef __LINUX_LIBGCC_H
18 +#define __LINUX_LIBGCC_H
20 +#include <asm/byteorder.h>
21 +#include <asm/libgcc.h>
23 +typedef long long DWtype;
25 +typedef unsigned int UWtype;
26 +typedef int word_type __attribute__ ((mode (__word__)));
28 +#define BITS_PER_UNIT 8
34 +#elif defined(__LITTLE_ENDIAN)
48 +#endif /* __LINUX_LIBGCC_H */
49 diff -Nur linux-2.6.15.1/lib/ashldi3.c linux-2.6.15.1-openwrt/lib/ashldi3.c
50 --- linux-2.6.15.1/lib/ashldi3.c 1970-01-01 01:00:00.000000000 +0100
51 +++ linux-2.6.15.1-openwrt/lib/ashldi3.c 2006-01-20 10:38:41.000000000 +0100
53 +#include <linux/libgcc.h>
54 +#include <linux/module.h>
56 +#ifdef ARCH_NEEDS_ashldi3
58 +DWtype __ashldi3(DWtype u, word_type b)
67 + bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
71 + w.s.high = (UWtype) uu.s.low << -bm;
73 + const UWtype carries = (UWtype) uu.s.low >> bm;
75 + w.s.low = (UWtype) uu.s.low << b;
76 + w.s.high = ((UWtype) uu.s.high << b) | carries;
82 +EXPORT_SYMBOL(__ashldi3);
84 +#endif /* ARCH_NEEDS_ashldi3 */
85 diff -Nur linux-2.6.15.1/lib/ashrdi3.c linux-2.6.15.1-openwrt/lib/ashrdi3.c
86 --- linux-2.6.15.1/lib/ashrdi3.c 1970-01-01 01:00:00.000000000 +0100
87 +++ linux-2.6.15.1-openwrt/lib/ashrdi3.c 2006-01-20 10:39:29.000000000 +0100
89 +#include <linux/libgcc.h>
90 +#include <linux/module.h>
92 +/* Unless shift functions are defined with full ANSI prototypes,
93 + parameter b will be promoted to int if word_type is smaller than an int. */
94 +#ifdef ARCH_NEEDS_ashrdi3
96 +DWtype __ashrdi3(DWtype u, word_type b)
105 + bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
108 + /* w.s.high = 1..1 or 0..0 */
110 + uu.s.high >> (sizeof(Wtype) * BITS_PER_UNIT - 1);
111 + w.s.low = uu.s.high >> -bm;
113 + const UWtype carries = (UWtype) uu.s.high << bm;
115 + w.s.high = uu.s.high >> b;
116 + w.s.low = ((UWtype) uu.s.low >> b) | carries;
122 +EXPORT_SYMBOL(__ashrdi3);
124 +#endif /* ARCH_NEEDS_ashrdi3 */
125 diff -Nur linux-2.6.15.1/lib/lshrdi3.c linux-2.6.15.1-openwrt/lib/lshrdi3.c
126 --- linux-2.6.15.1/lib/lshrdi3.c 1970-01-01 01:00:00.000000000 +0100
127 +++ linux-2.6.15.1-openwrt/lib/lshrdi3.c 2006-01-20 10:40:10.000000000 +0100
129 +#include <linux/libgcc.h>
130 +#include <linux/module.h>
132 +/* Unless shift functions are defined with full ANSI prototypes,
133 + parameter b will be promoted to int if word_type is smaller than an int. */
134 +#ifdef ARCH_NEEDS_lshrdi3
136 +DWtype __lshrdi3(DWtype u, word_type b)
145 + bm = (sizeof(Wtype) * BITS_PER_UNIT) - b;
149 + w.s.low = (UWtype) uu.s.high >> -bm;
151 + const UWtype carries = (UWtype) uu.s.high << bm;
153 + w.s.high = (UWtype) uu.s.high >> b;
154 + w.s.low = ((UWtype) uu.s.low >> b) | carries;
160 +EXPORT_SYMBOL(__lshrdi3);
162 +#endif /* ARCH_NEEDS_lshrdi3 */
163 diff -Nur linux-2.6.15.1/lib/Makefile linux-2.6.15.1-openwrt/lib/Makefile
164 --- linux-2.6.15.1/lib/Makefile 2006-01-15 07:16:02.000000000 +0100
165 +++ linux-2.6.15.1-openwrt/lib/Makefile 2006-01-20 10:34:19.000000000 +0100
169 lib-y += kobject.o kref.o kobject_uevent.o klist.o
170 +lib-y += ashldi3.o ashrdi3.o lshrdi3.o
172 obj-y += sort.o parser.o halfmd4.o