[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] Re: PCNet and Lance merge, almost there

From: Fabrice Bellard
Subject: Re: [Qemu-devel] Re: PCNet and Lance merge, almost there
Date: Thu, 24 Aug 2006 21:16:35 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.3) Gecko/20040913

Igor Kovalenko wrote:

On 8/24/06, *Blue Swirl* <address@hidden <mailto:address@hidden>> wrote:

     >- 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
     >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
     >such as sparc_iommu_memory_read() and sparc_iommu_memory_write().

    Good, that's much cleaner than the current mechanism.

     >- 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
     >and CPUs. In the pcnet case for example, the macro 'SPARC_FIX_DESC' is
     >almost surely not necessary because the device seems implicitely
     >endian (the original code lacks correct endianness conversion
    routines !).

    That's what I suspected. I'll try to make an universal version.

Do you want to preserve bitfields in structures? See comments near PACKED_FIELD() decl

Bitfields for structures in target memory should be avoided. Otherwise a new define should be added such as BITFIELDS_BIGENDIAN to define the bit fields in the right order (the Linux kernel makes such definitions so it must be reasonnably safe).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]