lkml.org 
[lkml]   [2002]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: PowerPC Linux and PCI
David S. Miller writes:

> From: James L Peterson <peterson@austin.ibm.com>
> Date: Fri, 19 Apr 2002 16:37:03 -0500
>
> if (pci_read_config_dword(temp, PCI_VENDOR_ID, &l))
> return NULL;
> ....
> memcpy(dev, temp, sizeof(*dev));
> dev->vendor = l & 0xffff;
> dev->device = (l >> 16) & 0xffff;
>
> It seems to me this is incorrect for a big-endian machine
> (like PowerPC). If we read the two 16-bit parts out of the
> first 32-bit part, we will end up with:
>
> pci_read_config_dword should do the byte swapping on &l for
> the caller, fix your pci_{read,write}_config_*() arch implementation.

It does, that's why it all works. :) James Peterson seems to have
missed this fact, hence his confusion.

Paul.
-
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 13:25    [W:0.351 / U:0.268 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site