This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Re: dp83816 ethernet: support reading MAC address from EEPROM
- From: Andrew Lunn <andrew at lunn dot ch>
- To: Gary Thomas <gary at mlbassoc dot com>
- Cc: Andrew Lunn <andrew at lunn dot ch>, David Vrabel <dvrabel at arcom dot com>,eCos patches <ecos-patches at ecos dot sourceware dot org>
- Date: Tue, 19 Jul 2005 09:07:57 +0200
- Subject: Re: dp83816 ethernet: support reading MAC address from EEPROM
- References: <42DBC0C5.10600@arcom.com> <20050718200526.GA29741@lunn.ch> <1121717440.12697.50.camel@hermes>
On Mon, Jul 18, 2005 at 02:10:39PM -0600, Gary Thomas wrote:
> On Mon, 2005-07-18 at 22:05 +0200, Andrew Lunn wrote:
> > > -// Map a 32 bit host quantity to little endian
> > > -unsigned long
> > > -_h2le(unsigned long val)
> > > -{
> > > - unsigned long res;
> > > - unsigned long *addr = &val;
> > > - __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (res) : "r" (addr), "m" (*addr));
> > > - return res;
> > > -}
> > > -
> > > -// Map a 32 bit little endian quantity to host representation
> > > -unsigned long
> > > -_le2h(unsigned long val)
> > > -{
> > > - unsigned long res;
> > > - unsigned long *addr = &val;
> > > - __asm__ __volatile__ ("lwbrx %0,0,%1" : "=r" (res) : "r" (addr), "m" (*addr));
> > > - return res;
> > > -}
> > > -
> > > // Align buffers on a cache boundary
> > > #define RxBUFSIZE CYGNUM_DEVS_ETH_MOAB_DP83816_RxNUM*_DP83816_BUFSIZE
> > > #define TxBUFSIZE CYGNUM_DEVS_ETH_MOAB_DP83816_TxNUM*_DP83816_BUFSIZE
> >
> > How about moving this into the PPC arch HAL. It can define a
> > CYG_SWAP32 macro.
>
> That's effectively what his patches have done (use the HAL support)
The PPC HAL defaults back to the common SWAP32 Macro. What i'm
suggesting is putting this into the PPC HAL so it gets a fast assembly
language version instread of the slower generic version.
Andrew