lkml.org 
[lkml]   [2001]   [Jun]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: multicast hash incorrect on big endian archs
Manfred Spraul wrote:
>
> "David S. Miller" wrote:
> >
> > Many big-endian systems already need to provide little-endian bitops,
> > for ext2's sake for example.
> >
> > We should formalize this, with {set,clear,change,test}_le_bit which
> > technically every port has implemented in some for or another already.
> >

That could cause alignment problems.
<<< from starfire.c
{
long filter_addr;
u16 mc_filter[32] __attribute__ ((aligned(sizeof(long))));
<<<
set_bit requires word alignment, but without the __attibute__ the
compiler would only guarantee 16-bit alignment. IMHO ugly.

Should I add __set_bit_{8,16,32} into <linux/bitops.h>, overridable with
__HAVE_ARCH_SET_BIT_n?

Default implementation for the nonatomic __set_bit could be added into
<linux/bitops.h>, too.

Btw, the correct name would be __set_bit_n: the function don't guarantee
atomicity.

--
Manfred
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:54    [W:0.031 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site