On Mon, 2010-01-04 at 13:07 +0200, Michael S. Tsirkin wrote: > BTW, I think we really should think about the right way to address the > swap/noswap issue without using a preprocessor. Maybe make pci host > bridge explicitly specify whether to swap bytes? How about adding a > field in PCIHostState to make it do this?
No, this is a non issue if you get your design right. Just abstract out the reference to a device in a struct like Alex is proposing and have the host bridge specific code fill that up appropriately. I don't see why there would be any need for swapping and in any case, this should go away once the host bridge code knows how to interpret the write to whatever config access registers it exposes. Ben.