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

@ -84,7 +84,8 @@ class Context_area_ram_session : public Genode::Ram_session
{
public:
Genode::Ram_dataspace_capability alloc(Genode::size_t size, bool) {
Genode::Ram_dataspace_capability alloc(Genode::size_t size,
Genode::Cache_attribute) {
return Genode::Ram_dataspace_capability(); }
void free(Genode::Ram_dataspace_capability) { }

View File

@ -52,7 +52,7 @@ namespace Genode {
* Constructor
*/
Dataspace_component(size_t size, addr_t addr,
bool /* write_combined */, bool writable,
Cache_attribute, bool writable,
Dataspace_owner * owner)
: _size(size), _addr(addr), _fd(-1), _writable(writable),
_owner(owner) { }
@ -68,7 +68,7 @@ namespace Genode {
* reasons and should not be used.
*/
Dataspace_component(size_t size, addr_t core_local_addr,
addr_t phys_addr, bool write_combined,
addr_t phys_addr, Cache_attribute,
bool writable, Dataspace_owner * _owner)
:
_size(size), _addr(phys_addr), _fd(-1), _owner(_owner)

View File

@ -65,7 +65,7 @@ Rom_session_component::Rom_session_component(Rom_fs *rom_fs,
int const fd = lx_open(fname, O_RDONLY | LX_O_CLOEXEC, S_IRUSR | S_IXUSR);
_ds = Dataspace_component(fsize, 0, false, false, 0);
_ds = Dataspace_component(fsize, 0, CACHED, false, 0);
_ds.fd(fd);
_ds.fname(fname);