/[linux-patches]/genpatches-2.6/trunk/2.6.14/1434_15.4_cmpxchg-inline.patch
Gentoo

Contents of /genpatches-2.6/trunk/2.6.14/1434_15.4_cmpxchg-inline.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 328 - (show annotations) (download) (as text)
Tue Mar 14 13:34:17 2006 UTC (14 years, 8 months ago) by johnm
File MIME type: text/x-diff
File size: 1835 byte(s)
2.6.14-11, rebase against local tree
1 From stable-bounces@linux.kernel.org Tue Feb 7 22:31:44 2006
2 Date: Wed, 8 Feb 2006 07:24:17 +0100
3 From: Norbert Tretkowski <norbert@tretkowski.de>
4 To: stable@kernel.org
5 Cc:
6 Subject: [alpha] __cmpxchg() must really always be inlined
7
8 From: Steve Langasek <vorlon@debian.org>
9
10 With the latest 2.6.15 kernel builds for alpha on Debian, we ran into a
11 problem with undefined references to __cmpxchg_called_with_bad_pointer() in
12 a couple of kernel modules (xfs.ko and drm.ko; see
13 http://bugs.debian.org/347556).
14
15 It looks like people have been trying to out-clever each other wrt the
16 definition of "inline" on this architecture :), with the result that
17 __cmpxchg(), which must be inlined so the compiler can see its argument is
18 const, is not guaranteed to be inlined. Indeed, it was not being inlined
19 when building with -Os.
20
21 The attached patch fixes the issue by adding an
22 __attribute__((always_inline)) explicitly to the definition of __cmpxchg()
23 instead of relying on redefines of "inline" elsewhere to make this happen.
24
25 Cc: Richard Henderson <rth@twiddle.net>
26 Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
27 Signed-off-by: Andrew Morton <akpm@osdl.org>
28 Signed-off-by: Linus Torvalds <torvalds@osdl.org>
29 Signed-off-by: Chris Wright <chrisw@sous-sol.org>
30 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
31 ---
32
33 include/asm-alpha/system.h | 2 +-
34 1 files changed, 1 insertion(+), 1 deletion(-)
35
36 --- linux-2.6.15.3.orig/include/asm-alpha/system.h
37 +++ linux-2.6.15.3/include/asm-alpha/system.h
38 @@ -562,7 +562,7 @@ __cmpxchg_u64(volatile long *m, unsigned
39 if something tries to do an invalid cmpxchg(). */
40 extern void __cmpxchg_called_with_bad_pointer(void);
41
42 -static inline unsigned long
43 +static __always_inline unsigned long
44 __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
45 {
46 switch (size) {

  ViewVC Help
Powered by ViewVC 1.1.20