mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01:00
hoitaja: Create habitat on startup.
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
#include <sandbox/types.h>
|
#include <sandbox/types.h>
|
||||||
#include <util/string.h>
|
#include <util/string.h>
|
||||||
|
|
||||||
|
#include <nova/syscalls.h>
|
||||||
|
|
||||||
/** Hoitaja includes **/
|
/** Hoitaja includes **/
|
||||||
#include "load_controller.h"
|
#include "load_controller.h"
|
||||||
#include "cell_controller.h"
|
#include "cell_controller.h"
|
||||||
@@ -48,6 +50,7 @@ class Hoitaja::Core_allocator
|
|||||||
Core_allocator(Genode::Affinity::Space &affinity_space, ::Sandbox::Prio_levels prio_levels) : _affinity_space(affinity_space), _prio_levels(prio_levels), _resource_coeff(0.0)
|
Core_allocator(Genode::Affinity::Space &affinity_space, ::Sandbox::Prio_levels prio_levels) : _affinity_space(affinity_space), _prio_levels(prio_levels), _resource_coeff(0.0)
|
||||||
{
|
{
|
||||||
Genode::log("Created core allocator for ", affinity_space.total(), " cores and ", prio_levels.value, " priorities.");
|
Genode::log("Created core allocator for ", affinity_space.total(), " cores and ", prio_levels.value, " priorities.");
|
||||||
|
Nova::create_habitat(0, affinity_space.total());
|
||||||
}
|
}
|
||||||
|
|
||||||
Genode::Affinity::Location allocate_cores_for_cell(Genode::Xml_node const &start_node)
|
Genode::Affinity::Location allocate_cores_for_cell(Genode::Xml_node const &start_node)
|
||||||
@@ -102,9 +105,9 @@ class Hoitaja::Core_allocator
|
|||||||
*xpos = location.xpos();
|
*xpos = location.xpos();
|
||||||
// TODO: Update affinity of existing sessions for cell
|
// TODO: Update affinity of existing sessions for cell
|
||||||
// TODO: Send yield request to cell
|
// TODO: Send yield request to cell
|
||||||
//log("Need to reclaim ", cores_to_reclaim, " cores from ", cell.name());
|
|
||||||
|
|
||||||
if (cores_to_reclaim > 0) {
|
if (cores_to_reclaim > 0) {
|
||||||
|
log("Need to reclaim ", cores_to_reclaim, " cores from ", cell.name());
|
||||||
cell.shrink_cores(location);
|
cell.shrink_cores(location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user