mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
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:
parent
a2e405f9e9
commit
ca9ae43e50
6
base-linux/src/base/env/platform_env.cc
vendored
6
base-linux/src/base/env/platform_env.cc
vendored
@ -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);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user