qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 3/9] eepro100: Use PCI DMA stub functions


From: David Gibson
Subject: Re: [Qemu-devel] [PATCH 3/9] eepro100: Use PCI DMA stub functions
Date: Fri, 14 Oct 2011 13:15:08 +1100
User-agent: Mutt/1.5.21 (2010-09-15)

On Sun, Oct 02, 2011 at 01:45:28PM +0200, Michael S. Tsirkin wrote:
> On Mon, Sep 05, 2011 at 02:34:58PM +1000, David Gibson wrote:
> > From: Eduard - Gabriel Munteanu <address@hidden>
> > @@ -744,21 +713,22 @@ static void dump_statistics(EEPRO100State * s)
> >       * values which really matter.
> >       * Number of data should check configuration!!!
> >       */
> > -    cpu_physical_memory_write(s->statsaddr, &s->statistics, s->stats_size);
> > -    e100_stl_le_phys(s->statsaddr + 0, s->statistics.tx_good_frames);
> > -    e100_stl_le_phys(s->statsaddr + 36, s->statistics.rx_good_frames);
> > -    e100_stl_le_phys(s->statsaddr + 48, s->statistics.rx_resource_errors);
> > -    e100_stl_le_phys(s->statsaddr + 60, 
> > s->statistics.rx_short_frame_errors);
> > +    pci_dma_write(&s->dev, s->statsaddr,
> > +                  (uint8_t *) & s->statistics, s->stats_size);
> > +    stl_pci_dma(&s->dev, s->statsaddr + 0, s->statistics.tx_good_frames);
> > +    stl_pci_dma(&s->dev, s->statsaddr + 36, s->statistics.rx_good_frames);
> > +    stl_pci_dma(&s->dev, s->statsaddr + 48, 
> > s->statistics.rx_resource_errors);
> > +    stl_pci_dma(&s->dev, s->statsaddr + 60, 
> > s->statistics.rx_short_frame_errors);
> 
> At least old stl macros assumed an aligned address.
> Not sure it's still the case but for e100 address might
> not be aligned I think.

The new macros, being implemented in terms of cpu_physical_memory_rw()
with small lengths, do not require aligned addresses.

-- 
David Gibson                    | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au  | minimalist, thank you.  NOT _the_ _other_
                                | _way_ _around_!
http://www.ozlabs.org/~dgibson



reply via email to

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