base: setup parent upgrade mechanism eagerly

Fix #2447
This commit is contained in:
Stefan Kalkowski
2017-06-13 13:18:11 +02:00
committed by Christian Helmuth
parent 06b25a9082
commit 6f8dc9054a
10 changed files with 59 additions and 116 deletions

View File

@ -65,9 +65,7 @@ class Genode::Local_parent : public Expanding_parent_client
* promote requests to non-local
* services
*/
Local_parent(Parent_capability parent_cap,
Emergency_ram_reserve &,
Allocator &);
Local_parent(Parent_capability parent_cap, Allocator &);
};
#endif /* _INCLUDE__BASE__INTERNAL__LOCAL_PARENT_H_ */

View File

@ -101,8 +101,7 @@ class Genode::Platform_env_base : public Env_deprecated
/**
* 'Platform_env' used by all processes except for core
*/
class Genode::Platform_env : public Platform_env_base,
public Expanding_parent_client::Emergency_ram_reserve
class Genode::Platform_env : public Platform_env_base
{
private:
@ -113,14 +112,6 @@ class Genode::Platform_env : public Platform_env_base,
Heap _heap;
/*
* Emergency RAM reserve
*
* See the comment of '_fallback_sig_cap()' in 'env/env.cc'.
*/
constexpr static size_t _emergency_ram_size() { return 8*1024; }
Ram_dataspace_capability _emergency_ram_ds;
/**
* Attach stack area to local address space (for non-hybrid components)
*/
@ -139,13 +130,6 @@ class Genode::Platform_env : public Platform_env_base,
~Platform_env() { _parent().exit(0); }
/*************************************
** Emergency_ram_reserve interface **
*************************************/
void release() { ram_session()->free(_emergency_ram_ds); }
/******************************
** Env_deprecated interface **
******************************/

View File

@ -101,10 +101,9 @@ Parent::Close_result Local_parent::close(Client::Id id)
Local_parent::Local_parent(Parent_capability parent_cap,
Emergency_ram_reserve &reserve,
Allocator &alloc)
:
Expanding_parent_client(parent_cap, reserve), _alloc(alloc)
Expanding_parent_client(parent_cap), _alloc(alloc)
{ }
@ -148,7 +147,7 @@ static Parent_capability obtain_parent_cap()
Local_parent &Platform_env::_parent()
{
static Local_parent local_parent(obtain_parent_cap(), *this, _heap);
static Local_parent local_parent(obtain_parent_cap(), _heap);
return local_parent;
}
@ -157,8 +156,7 @@ Platform_env::Platform_env()
:
Platform_env_base(static_cap_cast<Cpu_session>(_parent().session_cap(Parent::Env::cpu())),
static_cap_cast<Pd_session> (_parent().session_cap(Parent::Env::pd()))),
_heap(Platform_env_base::ram_session(), Platform_env_base::rm_session()),
_emergency_ram_ds(ram_session()->alloc(_emergency_ram_size()))
_heap(Platform_env_base::ram_session(), Platform_env_base::rm_session())
{
_attach_stack_area();