mirror of
https://github.com/mmueller41/mxtasking.git
synced 2026-01-21 12:42:57 +01:00
Made mx::System::Environment::env a pointer since it can then be reset later.
This commit is contained in:
@@ -63,7 +63,7 @@ public:
|
||||
EpochManager(const std::uint16_t count_channels, dynamic::Allocator &allocator,
|
||||
util::maybe_atomic<bool> &is_running) noexcept
|
||||
:
|
||||
Thread(system::Environment::env, Name("EpochManager"), 8192),
|
||||
Thread(*system::Environment::env, Name("EpochManager"), 8192),
|
||||
_count_channels(count_channels), _is_running(is_running), _allocator(allocator)
|
||||
{
|
||||
}
|
||||
@@ -159,7 +159,7 @@ private:
|
||||
std::atomic<epoch_t> _global_epoch{0U};
|
||||
|
||||
// Genode Timer object, needed for waking up periodically
|
||||
Timer::Connection _timer { system::Environment::env };
|
||||
Timer::Connection _timer { *system::Environment::env };
|
||||
|
||||
// Local epochs, one for every channel.
|
||||
alignas(64) std::array<LocalEpoch, tasking::config::max_cores()> _local_epochs;
|
||||
|
||||
3
src/mx/system/environment.cpp
Normal file
3
src/mx/system/environment.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "environment.h"
|
||||
|
||||
Genode::Env* mx::system::Environment::env = nullptr;
|
||||
@@ -13,7 +13,7 @@ public:
|
||||
* @return Genode environment capability
|
||||
*
|
||||
*/
|
||||
static Genode::Env &env;
|
||||
static Genode::Env *env;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
/**
|
||||
* @return Number of available cores.
|
||||
*/
|
||||
static std::uint16_t count_cores() { return std::uint16_t(Environment::env.cpu().affinity_space().total());
|
||||
static std::uint16_t count_cores() { return std::uint16_t(Environment::env->cpu().affinity_space().total());
|
||||
}
|
||||
};
|
||||
} // namespace mx::system
|
||||
@@ -7,7 +7,7 @@
|
||||
using namespace mx::tasking::profiling;
|
||||
|
||||
ProfilingTask::ProfilingTask(mx::util::maybe_atomic<bool> &is_running, mx::tasking::Channel &channel)
|
||||
: _is_running(is_running), _channel(channel), _timer(*new Timer::Connection(system::Environment::env))
|
||||
: _is_running(is_running), _channel(channel), _timer(*new Timer::Connection(*system::Environment::env))
|
||||
{
|
||||
_idle_ranges.reserve(1 << 16);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user