lkml.org 
[lkml]   [2001]   [Jun]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Probable endianess problem in TLAN driver
Hi David.

On Sat, 9 Jun 2001, David S. Miller wrote:

> Adrian Cox writes:

>>> +#if defined(__powerpc__)
>>> +#define inw(addr) le32_to_cpu(inw(addr))
>>> +#define inl(addr) le32_to_cpu(inl(addr))
>>> +#define outw(val, addr) outw(cpu_to_le32(val), addr)
>>> +#define outl(val, addr) outl(cpu_to_le32(val), addr)
>>> +#endif

>> On ppc the inw, inl, outw, and outl functions already byteswap,
>> so by adding the extra byteswap you're now passing unswapped
>> data to the chip.

> Yes, and this is true for every architecture.

> All of {in,out}{b,w,l}() and {read/write}{b,w,l}() swap to/from
> bus endianness for you.

Even if that wasn't true, aren't the above all self-recursive
definitions that would prevent anything calling them from compiling?

Best wishes from Riley.

-
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:55    [W:0.050 / U:0.164 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site