This is the mail archive of the ecos-patches@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: dp83816 ethernet: support reading MAC address from EEPROM


> -// 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.

        Andrew


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]