Blue Swirl wrote:
Hi,
I got PCNet working in Sun4m architecture by fixing endianness problems
and adding IOMMU hooks. There are still some endianness issues, that's
why I disabled the address matching code.
The original code could benefit from some touchup and performance tuning.
Any comments?
- A general remark : instead of using SPARC_IOMMU_TRANSLATE, you should
use new memory helpers to read or write bytes such as
pcnet_physical_memory_read() and pcnet_physical_memory_write(). The
rationale is that ultimately pci memory accesses will also use PCI
specific I/Os to handle the case where the PCI memory is not mapped
directly in the CPU address space. For the sparc iommu you should define
global helpers such as sparc_iommu_memory_read() and
sparc_iommu_memory_write().
- CPU specific #ifdefs (or CPU specific endianness macros) should be
avoided in device code unless it is really necessary. The rationale is
that ultimately there will be a single QEMU executable supporting all
machines and CPUs. In the pcnet case for example, the macro
'SPARC_FIX_DESC' is almost surely not necessary because the device seems
implicitely little endian (the original code lacks correct endianness
conversion routines !).
Regards,
Fabrice.
_______________________________________________
Qemu-devel mailing list
Qemu-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/qemu-devel