On Thu, 2006-03-23 at 13:52 +0100, Peter Graf wrote: > Andrew Lunn wrote: > >> When I placed a sync instruction between the critical read accesses, > >> instead of eieio, our problems disappeared. (The sync instruction covers > >> reads even if memory is not marked as "guarded".) > > > > What is the overhead of a sync compaired to an eieio? Should we just > > change the barrier macro? > > The respective freescale docs let me hesitate, and I'm not PowerPC > expert enough anyway. Quote from (MPCFPE32B/AD REV2, page 8-198): > > "The functions performed by the sync instruction will normally take a > significant amount of time to complete, so indiscriminate use of this > instruction may adversely affect performance. In addition, the time > required to execute sync may vary from one execution to another. > The eieio instruction may be more appropriate than sync for many cases." >
Basically, 'sync' causes all pipelines and [bus] buffers to flush. As noted, this can be very expensive, both in the time it takes to complete as well as the [lost] time getting things going again. > The other option would be to mark the respective memory regions as > "guarded", but this involves changes on several platforms. Does 'eieio' work in your case if the space is marked guarded? -- ------------------------------------------------------------ Gary Thomas | Consulting for the MLB Associates | Embedded world ------------------------------------------------------------ -- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
