base-linux: round up RM session size to page size

Since RM sessions can be used as dataspaces and dataspace sizes are
supposed to have page granularity, RM session sizes should have page
granularity, too.

Fixes #972.
This commit is contained in:
Christian Prochaska 2013-11-12 19:55:05 +01:00 committed by Norman Feske
parent a2e405f9e9
commit ca9ae43e50
1 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,9 @@ Platform_env_base::Rm_session_mmap::_dataspace_writable(Dataspace_capability ds)
** Platform_env::Local_parent **
********************************/
static inline size_t get_page_size_log2() { return 12; }
Session_capability
Platform_env::Local_parent::session(Service_name const &service_name,
Session_args const &args,
@ -69,6 +72,9 @@ Platform_env::Local_parent::session(Service_name const &service_name,
if (size == 0)
return Expanding_parent_client::session(service_name, args, affinity);
if (size != ~0UL)
size = align_addr(size, get_page_size_log2());
Rm_session_mmap *rm = new (env()->heap())
Rm_session_mmap(true, size);