113-even_more_gcc4_stuff.patch 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  1. Index: linux-2.4.35.4/arch/mips/kernel/mips_ksyms.c
  2. ===================================================================
  3. --- linux-2.4.35.4.orig/arch/mips/kernel/mips_ksyms.c
  4. +++ linux-2.4.35.4/arch/mips/kernel/mips_ksyms.c
  5. @@ -30,6 +30,10 @@
  6. #include <asm/floppy.h>
  7. #endif
  8. +asmlinkage long long __ashldi3 (long long, int);
  9. +asmlinkage long long __ashrdi3 (long long, int);
  10. +asmlinkage long long __lshrdi3 (long long, int);
  11. +asmlinkage long long __muldi3 (long long, long long);
  12. extern void *__bzero(void *__s, size_t __count);
  13. extern long __strncpy_from_user_nocheck_asm(char *__to,
  14. const char *__from, long __len);
  15. @@ -78,6 +82,13 @@ EXPORT_SYMBOL_NOVERS(__strnlen_user_noch
  16. EXPORT_SYMBOL_NOVERS(__strnlen_user_asm);
  17. +/* Compiler stuff */
  18. +EXPORT_SYMBOL_NOVERS(__ashldi3);
  19. +EXPORT_SYMBOL_NOVERS(__ashrdi3);
  20. +EXPORT_SYMBOL_NOVERS(__lshrdi3);
  21. +EXPORT_SYMBOL_NOVERS(__muldi3);
  22. +
  23. +
  24. /* Networking helper routines. */
  25. EXPORT_SYMBOL(csum_partial_copy);
  26. Index: linux-2.4.35.4/arch/mips/lib/Makefile
  27. ===================================================================
  28. --- linux-2.4.35.4.orig/arch/mips/lib/Makefile
  29. +++ linux-2.4.35.4/arch/mips/lib/Makefile
  30. @@ -9,7 +9,8 @@ L_TARGET = lib.a
  31. obj-y += csum_partial.o csum_partial_copy.o \
  32. promlib.o rtc-std.o rtc-no.o memcpy.o \
  33. memset.o watch.o strlen_user.o \
  34. - strncpy_user.o strnlen_user.o
  35. + strncpy_user.o strnlen_user.o \
  36. + ashldi3.o ashrdi3.o lshrdi3.o muldi3.o
  37. export-objs := rtc-std.o rtc-no.o
  38. Index: linux-2.4.35.4/arch/mips/lib/ashldi3.c
  39. ===================================================================
  40. --- /dev/null
  41. +++ linux-2.4.35.4/arch/mips/lib/ashldi3.c
  42. @@ -0,0 +1,62 @@
  43. +/* ashrdi3.c extracted from gcc-2.95.2/libgcc2.c which is: */
  44. +/* Copyright (C) 1989, 92-98, 1999 Free Software Foundation, Inc.
  45. +
  46. +This file is part of GNU CC.
  47. +
  48. +GNU CC is free software; you can redistribute it and/or modify
  49. +it under the terms of the GNU General Public License as published by
  50. +the Free Software Foundation; either version 2, or (at your option)
  51. +any later version.
  52. +
  53. +GNU CC is distributed in the hope that it will be useful,
  54. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  55. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  56. +GNU General Public License for more details.
  57. +
  58. +You should have received a copy of the GNU General Public License
  59. +along with GNU CC; see the file COPYING. If not, write to
  60. +the Free Software Foundation, 59 Temple Place - Suite 330,
  61. +Boston, MA 02111-1307, USA. */
  62. +
  63. +#define BITS_PER_UNIT 8
  64. +
  65. +typedef int SItype __attribute__ ((mode (SI)));
  66. +typedef unsigned int USItype __attribute__ ((mode (SI)));
  67. +typedef int DItype __attribute__ ((mode (DI)));
  68. +typedef int word_type __attribute__ ((mode (__word__)));
  69. +
  70. +struct DIstruct {SItype high, low;};
  71. +
  72. +typedef union
  73. +{
  74. + struct DIstruct s;
  75. + DItype ll;
  76. +} DIunion;
  77. +
  78. +DItype
  79. +__ashldi3 (DItype u, word_type b)
  80. +{
  81. + DIunion w;
  82. + word_type bm;
  83. + DIunion uu;
  84. +
  85. + if (b == 0)
  86. + return u;
  87. +
  88. + uu.ll = u;
  89. +
  90. + bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
  91. + if (bm <= 0)
  92. + {
  93. + w.s.low = 0;
  94. + w.s.high = (USItype)uu.s.low << -bm;
  95. + }
  96. + else
  97. + {
  98. + USItype carries = (USItype)uu.s.low >> bm;
  99. + w.s.low = (USItype)uu.s.low << b;
  100. + w.s.high = ((USItype)uu.s.high << b) | carries;
  101. + }
  102. +
  103. + return w.ll;
  104. +}
  105. Index: linux-2.4.35.4/arch/mips/lib/ashrdi3.c
  106. ===================================================================
  107. --- /dev/null
  108. +++ linux-2.4.35.4/arch/mips/lib/ashrdi3.c
  109. @@ -0,0 +1,63 @@
  110. +/* ashrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */
  111. +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  112. +
  113. +This file is part of GNU CC.
  114. +
  115. +GNU CC is free software; you can redistribute it and/or modify
  116. +it under the terms of the GNU General Public License as published by
  117. +the Free Software Foundation; either version 2, or (at your option)
  118. +any later version.
  119. +
  120. +GNU CC is distributed in the hope that it will be useful,
  121. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  122. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  123. +GNU General Public License for more details.
  124. +
  125. +You should have received a copy of the GNU General Public License
  126. +along with GNU CC; see the file COPYING. If not, write to
  127. +the Free Software Foundation, 59 Temple Place - Suite 330,
  128. +Boston, MA 02111-1307, USA. */
  129. +
  130. +#define BITS_PER_UNIT 8
  131. +
  132. +typedef int SItype __attribute__ ((mode (SI)));
  133. +typedef unsigned int USItype __attribute__ ((mode (SI)));
  134. +typedef int DItype __attribute__ ((mode (DI)));
  135. +typedef int word_type __attribute__ ((mode (__word__)));
  136. +
  137. +struct DIstruct {SItype high, low;};
  138. +
  139. +typedef union
  140. +{
  141. + struct DIstruct s;
  142. + DItype ll;
  143. +} DIunion;
  144. +
  145. +DItype
  146. +__ashrdi3 (DItype u, word_type b)
  147. +{
  148. + DIunion w;
  149. + word_type bm;
  150. + DIunion uu;
  151. +
  152. + if (b == 0)
  153. + return u;
  154. +
  155. + uu.ll = u;
  156. +
  157. + bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
  158. + if (bm <= 0)
  159. + {
  160. + /* w.s.high = 1..1 or 0..0 */
  161. + w.s.high = uu.s.high >> (sizeof (SItype) * BITS_PER_UNIT - 1);
  162. + w.s.low = uu.s.high >> -bm;
  163. + }
  164. + else
  165. + {
  166. + USItype carries = (USItype)uu.s.high << bm;
  167. + w.s.high = uu.s.high >> b;
  168. + w.s.low = ((USItype)uu.s.low >> b) | carries;
  169. + }
  170. +
  171. + return w.ll;
  172. +}
  173. Index: linux-2.4.35.4/arch/mips/lib/lshrdi3.c
  174. ===================================================================
  175. --- /dev/null
  176. +++ linux-2.4.35.4/arch/mips/lib/lshrdi3.c
  177. @@ -0,0 +1,62 @@
  178. +/* lshrdi3.c extracted from gcc-2.7.2/libgcc2.c which is: */
  179. +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  180. +
  181. +This file is part of GNU CC.
  182. +
  183. +GNU CC is free software; you can redistribute it and/or modify
  184. +it under the terms of the GNU General Public License as published by
  185. +the Free Software Foundation; either version 2, or (at your option)
  186. +any later version.
  187. +
  188. +GNU CC is distributed in the hope that it will be useful,
  189. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  190. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  191. +GNU General Public License for more details.
  192. +
  193. +You should have received a copy of the GNU General Public License
  194. +along with GNU CC; see the file COPYING. If not, write to
  195. +the Free Software Foundation, 59 Temple Place - Suite 330,
  196. +Boston, MA 02111-1307, USA. */
  197. +
  198. +#define BITS_PER_UNIT 8
  199. +
  200. +typedef int SItype __attribute__ ((mode (SI)));
  201. +typedef unsigned int USItype __attribute__ ((mode (SI)));
  202. +typedef int DItype __attribute__ ((mode (DI)));
  203. +typedef int word_type __attribute__ ((mode (__word__)));
  204. +
  205. +struct DIstruct {SItype high, low;};
  206. +
  207. +typedef union
  208. +{
  209. + struct DIstruct s;
  210. + DItype ll;
  211. +} DIunion;
  212. +
  213. +DItype
  214. +__lshrdi3 (DItype u, word_type b)
  215. +{
  216. + DIunion w;
  217. + word_type bm;
  218. + DIunion uu;
  219. +
  220. + if (b == 0)
  221. + return u;
  222. +
  223. + uu.ll = u;
  224. +
  225. + bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
  226. + if (bm <= 0)
  227. + {
  228. + w.s.high = 0;
  229. + w.s.low = (USItype)uu.s.high >> -bm;
  230. + }
  231. + else
  232. + {
  233. + USItype carries = (USItype)uu.s.high << bm;
  234. + w.s.high = (USItype)uu.s.high >> b;
  235. + w.s.low = ((USItype)uu.s.low >> b) | carries;
  236. + }
  237. +
  238. + return w.ll;
  239. +}
  240. Index: linux-2.4.35.4/arch/mips/lib/muldi3.c
  241. ===================================================================
  242. --- /dev/null
  243. +++ linux-2.4.35.4/arch/mips/lib/muldi3.c
  244. @@ -0,0 +1,63 @@
  245. +/* muldi3.c extracted from gcc-2.7.2.3/libgcc2.c and
  246. + gcc-2.7.2.3/longlong.h which is: */
  247. +/* Copyright (C) 1989, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
  248. +
  249. +This file is part of GNU CC.
  250. +
  251. +GNU CC is free software; you can redistribute it and/or modify
  252. +it under the terms of the GNU General Public License as published by
  253. +the Free Software Foundation; either version 2, or (at your option)
  254. +any later version.
  255. +
  256. +GNU CC is distributed in the hope that it will be useful,
  257. +but WITHOUT ANY WARRANTY; without even the implied warranty of
  258. +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  259. +GNU General Public License for more details.
  260. +
  261. +You should have received a copy of the GNU General Public License
  262. +along with GNU CC; see the file COPYING. If not, write to
  263. +the Free Software Foundation, 59 Temple Place - Suite 330,
  264. +Boston, MA 02111-1307, USA. */
  265. +
  266. +#define BITS_PER_UNIT 8
  267. +
  268. +#define umul_ppmm(w1, w0, u, v) \
  269. + __asm__ ("multu %2,%3" \
  270. + : "=l" ((USItype)(w0)), \
  271. + "=h" ((USItype)(w1)) \
  272. + : "d" ((USItype)(u)), \
  273. + "d" ((USItype)(v)))
  274. +
  275. +#define __umulsidi3(u, v) \
  276. + ({DIunion __w; \
  277. + umul_ppmm (__w.s.high, __w.s.low, u, v); \
  278. + __w.ll; })
  279. +
  280. +typedef int SItype __attribute__ ((mode (SI)));
  281. +typedef unsigned int USItype __attribute__ ((mode (SI)));
  282. +typedef int DItype __attribute__ ((mode (DI)));
  283. +typedef int word_type __attribute__ ((mode (__word__)));
  284. +
  285. +struct DIstruct {SItype high, low;};
  286. +
  287. +typedef union
  288. +{
  289. + struct DIstruct s;
  290. + DItype ll;
  291. +} DIunion;
  292. +
  293. +DItype
  294. +__muldi3 (DItype u, DItype v)
  295. +{
  296. + DIunion w;
  297. + DIunion uu, vv;
  298. +
  299. + uu.ll = u,
  300. + vv.ll = v;
  301. +
  302. + w.ll = __umulsidi3 (uu.s.low, vv.s.low);
  303. + w.s.high += ((USItype) uu.s.low * (USItype) vv.s.high
  304. + + (USItype) uu.s.high * (USItype) vv.s.low);
  305. +
  306. + return w.ll;
  307. +}
  308. Index: linux-2.4.35.4/fs/cifs/cifsfs.c
  309. ===================================================================
  310. --- linux-2.4.35.4.orig/fs/cifs/cifsfs.c
  311. +++ linux-2.4.35.4/fs/cifs/cifsfs.c
  312. @@ -50,8 +50,6 @@
  313. static struct quotactl_ops cifs_quotactl_ops;
  314. #endif
  315. -extern struct file_system_type cifs_fs_type;
  316. -
  317. int cifsFYI = 0;
  318. int cifsERROR = 1;
  319. int traceSMB = 0;
  320. Index: linux-2.4.35.4/include/asm-mips/uaccess.h
  321. ===================================================================
  322. --- linux-2.4.35.4.orig/include/asm-mips/uaccess.h
  323. +++ linux-2.4.35.4/include/asm-mips/uaccess.h
  324. @@ -149,7 +149,7 @@ static inline int verify_area(int type,
  325. * Returns zero on success, or -EFAULT on error.
  326. */
  327. #define put_user(x,ptr) \
  328. - __put_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
  329. + __put_user_check((x),(ptr),sizeof(*(ptr)))
  330. /*
  331. * get_user: - Get a simple variable from user space.
  332. @@ -169,7 +169,7 @@ static inline int verify_area(int type,
  333. * On error, the variable @x is set to zero.
  334. */
  335. #define get_user(x,ptr) \
  336. - __get_user_check((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
  337. + __get_user_check((x),(ptr),sizeof(*(ptr)))
  338. /*
  339. * __put_user: - Write a simple value into user space, with less checking.
  340. @@ -191,7 +191,7 @@ static inline int verify_area(int type,
  341. * Returns zero on success, or -EFAULT on error.
  342. */
  343. #define __put_user(x,ptr) \
  344. - __put_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
  345. + __put_user_nocheck((x),(ptr),sizeof(*(ptr)))
  346. /*
  347. * __get_user: - Get a simple variable from user space, with less checking.
  348. @@ -214,7 +214,7 @@ static inline int verify_area(int type,
  349. * On error, the variable @x is set to zero.
  350. */
  351. #define __get_user(x,ptr) \
  352. - __get_user_nocheck((__typeof__(*(ptr)))(x),(ptr),sizeof(*(ptr)))
  353. + __get_user_nocheck((x),(ptr),sizeof(*(ptr)))
  354. struct __large_struct { unsigned long buf[100]; };
  355. #define __m(x) (*(struct __large_struct *)(x))
  356. @@ -232,7 +232,7 @@ struct __large_struct { unsigned long bu
  357. #define __get_user_nocheck(x,ptr,size) \
  358. ({ \
  359. long __gu_err = 0; \
  360. - __typeof(*(ptr)) __gu_val = 0; \
  361. + __typeof(*(ptr)) __gu_val = (__typeof(*(ptr))) 0; \
  362. long __gu_addr; \
  363. __gu_addr = (long) (ptr); \
  364. switch (size) { \