Richard Henderson a écrit :
On 08/23/2013 11:52 AM, Hervé Poussineau wrote:
+ uint8_t buf[4];
+ uint64_t val;
+
+ if (s->contiguous_map == 0) {
+ /* 64 KB contiguous space for IOs */
+ addr &= 0xFFFF;
+ } else {
+ /* 8 MB non-contiguous space for IOs */
+ addr = (addr & 0x1F) | ((addr & 0x007FFF000) >> 7);
+ }
+
+ address_space_read(&s->pci_io_as, addr + 0x80000000, buf, size);
+ memcpy(&val, buf, size);
+ return val;
This memcpy can't be right, especially for big-endian host.
pci_io_as is supposed to contain words/longs in little-endian mode (PCI
is always little-endian).
prep_io_ops endianness is DEVICE_LITTLE_ENDIAN, so, AFAIK, this means
that returned val should be LE.
Why should it break on big-endian hosts?
Regards,
Hervé