tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: RFC: New bus_space routine: bus_space_sync



On Thu, Jan 19, 2012 at 11:32:46AM -0800, Matt Thomas wrote:
> 
> On Jan 19, 2012, at 11:28 AM, Manuel Bouyer wrote:
> 
> > On Thu, Jan 19, 2012 at 10:59:01AM -0800, Matt Thomas wrote:
> >> 
> >> For prefetchable regions (like framebuffers) mapped by bus_space_map, 
> >> there is a need to able force the contents out of the cache back into 
> >> memory (especially when the cache is a writeback cache).
> >> 
> >> There is no MI way to do this with the bus_space framework so I'm 
> >> proposing we add a:
> >> 
> >>    void bus_space_sync(bus_space_tag_t bst,
> >>            bus_space_handle_t bsh,
> >>            bus_size_t offset,
> >>            bus_size_t length,
> >>            int ops);
> >> 
> >> where ops is one of:
> >> 
> >> #define    BUS_SPACE_SYNC_WB       1 // defined by MD
> >> #define    BUS_SPACE_SYNC_WBINV    2 // defined by MD
> >> 
> >> One caveat is that though a BUS_SPACE_SYNC_WB was requested, a platform 
> >> can perform BUS_SPACE_SYNC_WBINV instead.  If the platform can't support 
> >> just writeback, it is allowed to silently do a writeback-invalidate 
> >> instead.
> > 
> > 
> > Isn't this what bus_space_barrier(BUS_SPACE_BARRIER_SYNC) is for ?
> 
> No.  bus_space_barrier controls memory (load/store) ordering and deals with a 
> completely diffeent problem.

I'm not sure:
           BUS_SPACE_BARRIER_SYNC                Force all memory operations
                                                 and any pending exceptions to
                                                 be completed before any
                                                 instructions after the bar-
                                                 rier may be issued.

"memory operations to be completed" isn't clearly defined, but I think
it's not very usefull if this doesn't include having data written back in
main memory.

-- 
Manuel Bouyer <bouyer%antioche.eu.org@localhost>
     NetBSD: 26 ans d'experience feront toujours la difference
--


Home | Main Index | Thread Index | Old Index