public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] The Alignment and Init of Ethernet Data Structures
       [not found] <539659A0.7070100@verizon.net>
@ 2014-07-04  1:35 ` Les Miklosy
  0 siblings, 0 replies; only message in thread
From: Les Miklosy @ 2014-07-04  1:35 UTC (permalink / raw)
  To: ecos-discuss



This question regards the Ethernet drivers found in the devs/eth 
directory. I found the data structure for xxx_eth_info in these header 
files: fec.h, fcc.h, quicc_eth.h, ppc405_eth.h. Moab uses the 
ppc405_eth.h while Rattler uses the fcc.h. When the data structure 
xxx_eth_info is initialized, the Moab and Rattler configurations use 
data alignment constructs (the literature calls 'compound literals')  
while fec and quicc_eth do not. An example of the data alignment 
construct for Moab is:

    // Align buffers on a cache boundary
    #define RxBUFSIZE
    CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM*CYGNUM_DEVS_ETH_POWERPC_PPC405_BUFSIZE
    #define TxBUFSIZE
    CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM*CYGNUM_DEVS_ETH_POWERPC_PPC405_BUFSIZE
    static unsigned char ppc405_eth_rxbufs[RxBUFSIZE]
    __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
    static unsigned char ppc405_eth_txbufs[TxBUFSIZE]
    __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
    static mal_bd_t
    ppc405_eth_rxbd[CYGNUM_DEVS_ETH_POWERPC_PPC405_RxNUM]
    __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));
    static mal_bd_t
    ppc405_eth_txbd[CYGNUM_DEVS_ETH_POWERPC_PPC405_TxNUM]
    __attribute__((aligned(HAL_DCACHE_LINE_SIZE)));


Why are these used in the cases of fcc and ppc405 but not for fec and 
quicc? Is the alignment necessary or recommended for new ports? What 
might be the consequences if alignment during initialization is not 
used? For other platforms are we relying on the compiler to 
rack-and-stack data structures properly on boundaries optimized by the 
compiler?

Thanks for any guidance.
Les







-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2014-07-04  1:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <539659A0.7070100@verizon.net>
2014-07-04  1:35 ` [ECOS] The Alignment and Init of Ethernet Data Structures Les Miklosy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).