lkml.org 
[lkml]   [2002]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: Linux 2.5.40-ac1
David S. Miller wrote:
>
> How about a 64-bit system where set_bit works on 64-bit longs
> and not 32-bit ones? That is why the current code there is broken.
>

There should bit nonatomic bit ops for every byte width.

http://marc.theaimsgroup.com/?l=linux-kernel&m=99167415926343&w=2

I even sent you the patch proposal, but never got a reply.

Patch again attached, but untested.
--
Manfred
--- 2.4/include/linux/bitops.h Sat Apr 28 00:48:19 2001
+++ build-2.4/include/linux/bitops.h Tue Jun 5 19:40:43 2001
@@ -68,5 +68,27 @@

#include <asm/bitops.h>

+#ifdef __KERNEL__
+#include <linux/types.h>
+#define BUILD_SET_BIT(n) \
+static inline void __set_bit_##n(int offset, u##n *data) \
+{ \
+ data[offset/n] |= (1 << (offset%n)); \
+}
+
+#ifndef _HAVE_ARCH_SET_BIT_8
+BUILD_SET_BIT(8)
+#endif
+#ifndef _HAVE_ARCH_SET_BIT_16
+BUILD_SET_BIT(16)
+#endif
+#ifndef _HAVE_ARCH_SET_BIT_32
+BUILD_SET_BIT(32)
+#endif
+#ifndef _HAVE_ARCH_SET_BIT_64
+BUILD_SET_BIT(64)
+#endif
+#undef BUILD_SET_BIT
+#endif

#endif
\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.047 / U:0.592 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site