mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
hoitaja: Upon starting a new child component, create a cell for it at the hypervisor.
This commit is contained in:
@@ -576,7 +576,7 @@ class Sandbox::Child : Child_policy, Routed_service::Wakeup
|
|||||||
Cap_quota cap_quota() const { return _resources.assigned_cap_quota; }
|
Cap_quota cap_quota() const { return _resources.assigned_cap_quota; }
|
||||||
Cpu_quota cpu_quota() const { return _effective_cpu_quota; }
|
Cpu_quota cpu_quota() const { return _effective_cpu_quota; }
|
||||||
|
|
||||||
void try_start()
|
virtual void try_start()
|
||||||
{
|
{
|
||||||
if (_state == State::INITIAL) {
|
if (_state == State::INITIAL) {
|
||||||
_child.initiate_env_pd_session();
|
_child.initiate_env_pd_session();
|
||||||
|
|||||||
@@ -55,8 +55,7 @@ class Hoitaja::Cell : public ::Sandbox::Child
|
|||||||
{
|
{
|
||||||
_priority = ::Sandbox::priority_from_xml(start_node, prio_levels);
|
_priority = ::Sandbox::priority_from_xml(start_node, prio_levels);
|
||||||
_priority = (_priority == 0) ? 1 : _priority;
|
_priority = (_priority == 0) ? 1 : _priority;
|
||||||
|
Genode::log("Creating new cell at Hoitaja <", name(), ">");
|
||||||
env.pd().create_cell(_priority, location);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Cell() { };
|
virtual ~Cell() { };
|
||||||
@@ -75,6 +74,12 @@ class Hoitaja::Cell : public ::Sandbox::Child
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void create_at_tukija()
|
||||||
|
{
|
||||||
|
Genode::log("Creating new cell <", name(), "> at Tukija at ", _resources.affinity.location());
|
||||||
|
_child.pd().create_cell(_priority, _resources.affinity.location());
|
||||||
|
}
|
||||||
|
|
||||||
void exit(int exit_value) override
|
void exit(int exit_value) override
|
||||||
{
|
{
|
||||||
::Sandbox::Child::exit(exit_value);
|
::Sandbox::Child::exit(exit_value);
|
||||||
@@ -82,10 +87,20 @@ class Hoitaja::Cell : public ::Sandbox::Child
|
|||||||
}
|
}
|
||||||
|
|
||||||
void shrink_cores(Genode::Affinity::Location &cores) {
|
void shrink_cores(Genode::Affinity::Location &cores) {
|
||||||
_env.pd().shrink_cell(cores);
|
if (_child.active())
|
||||||
|
_child.pd().update_cell(cores);
|
||||||
}
|
}
|
||||||
|
|
||||||
void grow_cores(Genode::Affinity::Location &cores) {
|
void grow_cores(Genode::Affinity::Location &cores) {
|
||||||
_env.pd().grow_cell(cores);
|
if (_child.active())
|
||||||
|
_child.pd().update_cell(cores);
|
||||||
|
}
|
||||||
|
|
||||||
|
void try_start() override
|
||||||
|
{
|
||||||
|
::Sandbox::Child::try_start();
|
||||||
|
while (!(_child.active()))
|
||||||
|
__builtin_ia32_pause();
|
||||||
|
create_at_tukija();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user