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: RealTek 8139 driver, 2. revision


Michael Anburaj wrote:
Hi Eric,

Just curious :-)

Line number 1173 of if_8139.c <revision 3>:


#ifdef CYGPKG_DEVS_ETH_RLTK_8139_SOFTWARE_CACHE_COHERENCY HAL_DCACHE_INVALIDATE(&rltk8139_info->rx_ring[rx_pos], sizeof(cyg_uint32)); #endif

/*
* The 8139 prepends each packet with a 32 bit packet header that
* contains a 16 bit length and 16 bit status field, in little-endian
* byte order.
*/
header = HAL_LE32TOC(*((volatile cyg_uint32 *)CYGARC_UNCACHED_ADDRESS(&rltk8139_info->rx_ring[rx_pos])));




Here,
1st line of code:
Invalidates the Dcache line for ?header? info <so that, if someone reads it later on; A Dcache line fill will occur & then read out from the Dcache>.


2nd line of code:
Reads the ?header? info directly from the memory & not the cache. So, even if Dcache line invalidate (1st line of code) is not there; this would work fine. Am I right?

On platforms were CYGARC_UNCACHED_ADDRESS is supported, you are right. In this case, defining CYGPKG_DEVS_ETH_RLTK_8139_SOFTWARE_CACHE_COHERENCY is silly and will most likely hurt performance. However, on my platform, CYGARC_UNCACHED_ADDRESS does nothing (it just returns the value passed in unchanged). Now, I could conditionalize the CYGARC macro and only use it if software cache coherency is not selected, but it didn't seem worth the trouble to do this.

So, is the 1st line (Dcache line invalidate) intended to solve cache coherency problem for later access to header info. from the Dcache. Or am I missing something here?

Yes you are, see above. -- -------------------------------------------------------------------- | Eric Doenges | DynaPel Laboratories GmbH | | Tel: +49 89 962428 23 | Fraunhoferstrasse 9/2 | | Fax: +49 89 962428 90 | D - 85737 Ismaning, Germany | --------------------------------------------------------------------


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