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 <eduard.munte...@linux360.ro>
> > @@ -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