Current-Users archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: BCM5809S support in bnx(4) and brgphy(4)
On Wed, 1 Dec 2010, Izumi Tsutsui wrote:
> > Also, there is a comment above saying that:
> >
> > /*
> > * The following data structures are generated from RTL code.
> > * Do not modify any values below this line.
> > */
>
> IMO all members fetched via PCI bus master should be uint32_t
> if hardware supports byte swap ops since swap is always done
> against each uint32_t.
Huh?
[...]
> Well, no need to use #if BYTE_ORDER if we use uint32_t with
> shift ops because word swap is done by hardware.
> (that's the reason why we have to swap uint16_t members by #ifdef)
What swap is done by what hardware? Most of the time any swapping is done
by a series of shift and mask instructions with the current
implementation, and swapping a 16-bit value is much less expensive than
swapping a 32-bit value.
Sigh. I really need to get off my butt and add a bunch of bus_dma
accessors (like the bus_space ones but for DMA buffers) to solve this
problem optimally across all architectures.
Eduardo
Home |
Main Index |
Thread Index |
Old Index