> I said this without looking up the example you cited. > I agree now, the example is incorrect; and yes, file a bug > report at oreilly!
Ok, I will. > I think, from memory, that elsewhere in the book Rubini does > say that readl()... are for the PCI bus, but cross-arch issues > are only addressed in certain sections. I didn't find anything that specifically mentioned their use was for the PCI bus only. The endianness swapping features of the pci_config_xxx functions are clearly stated, but not the readl/writel. And of course the example I refer to clearly uses those functions on the PCI bus incorrectly. But its still a great book. > I always find out exactly what these macros do on the arch > I am using, then I know where I stand. I find LXR (Google it if > you don't know it) good for browsing the source of vanilla > kernels. After finding out how and where it is done, I then > double check the relevant files of the actual kernel I am using. > > ppc implementations of readl, writel, cpu_to_le32 use the byte- > reversed load/store word instructions. Ahh, very good advice. I think I read about LXR in one of Freescale's app notes on porting Linux. I'll go take a look on Google. Thanks Dave