On Thu, 19 Jan 2012, 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.
Could elaborate a bit more on how you plan to use this and why bus_space_barrier() with BUS_SPACE_BARRIER_SYNC is insufficient? Yes, I know the current implementation ov bus_space_barrier() on the architecture you're using doesn't do this, but why can't it be enhanced to if you do the initial mapping with BUS_SPACE_MAP_CACHEABLE? Presumably if bus_space_sync() is passd a handle, offset, and length you're using the bus_space_{read,write}*() accessors rather than the pointer returned by bus_space_vaddr(). Also, how would this work if your machine has an I/O cache (separate from the CPU cache)? Eduardo