base: introduce caching attributes (fix #1184)

On ARM it's relevant to not only distinguish between ordinary cached memory
and write-combined one, but also having non-cached memory too. To insert the
appropriated page table entries e.g.: in the base-hw kernel, we need to preserve
the information about the kind of memory from allocation until the pager
resolves a page fault. Therefore, this commit introduces a new Cache_attribute
type, and replaces the write_combined boolean with the new type where necessary.
This commit is contained in:
Stefan Kalkowski
2014-06-19 16:37:31 +02:00
committed by Norman Feske
parent 9580954d81
commit 786fe805da
60 changed files with 216 additions and 160 deletions

View File

@@ -62,7 +62,7 @@ namespace Allocator {
typedef Genode::Allocator_avl Allocator_avl;
addr_t _base; /* virt. base address */
bool _cached; /* non-/cached RAM */
Cache_attribute _cached; /* non-/cached RAM */
Ram_dataspace_capability _ds_cap[ELEMENTS]; /* dataspaces to put in VM */
addr_t _ds_phys[ELEMENTS]; /* physical bases of dataspaces */
int _index = 0; /* current index in ds_cap */
@@ -107,7 +107,7 @@ namespace Allocator {
public:
Backend_alloc(bool cached)
Backend_alloc(Cache_attribute cached)
: Rm_connection(0, VM_SIZE), _cached(cached),
_range(Genode::env()->heap())
{
@@ -195,7 +195,7 @@ namespace Allocator {
public:
Fap(bool cached)
: _back_allocator(cached) { }
: _back_allocator(cached ? CACHED : UNCACHED) { }
void *alloc(size_t size, int align = 0)
{