Warn about the use of deprecated env() function

This patch enables warnings if one of the deprecate functions that rely
in the implicit use of the global Genode::env() accessor are called.

For the time being, some places within the base framework continue
to rely on the global function while omitting the warning by calling
'env_deprecated' instead of 'env'.

Issue #1987
This commit is contained in:
Norman Feske
2017-01-09 15:18:49 +01:00
parent 4c7ab07480
commit a7f40b24ca
80 changed files with 360 additions and 178 deletions

View File

@ -107,7 +107,7 @@ class Genode::Region_map_mmap : public Region_map, public Dataspace
{
/* detach sub RM session when destructed */
if (_sub_rm && _is_attached())
env()->rm_session()->detach((void *)_base);
env_deprecated()->rm_session()->detach((void *)_base);
}

View File

@ -180,7 +180,7 @@ namespace Genode {
Socket_pair server_socket_pair()
{
Linux_native_cpu_client native_cpu(env()->cpu_session()->native_cpu());
Linux_native_cpu_client native_cpu(env_deprecated()->cpu_session()->native_cpu());
Socket_pair socket_pair;

View File

@ -86,11 +86,11 @@ void Thread::_init_platform_thread(size_t weight, Type type)
{
/* if no cpu session is given, use it from the environment */
if (!_cpu_session)
_cpu_session = env()->cpu_session();
_cpu_session = env_deprecated()->cpu_session();
/* for normal threads create an object at the CPU session */
if (type == NORMAL) {
_thread_cap = _cpu_session->create_thread(env()->pd_session_cap(),
_thread_cap = _cpu_session->create_thread(env_deprecated()->pd_session_cap(),
_stack->name().string(),
Affinity::Location(),
Weight());
@ -98,7 +98,7 @@ void Thread::_init_platform_thread(size_t weight, Type type)
}
/* adjust initial object state for main threads */
native_thread().futex_counter = main_thread_futex_counter;
_thread_cap = env()->parent()->main_thread_cap();
_thread_cap = env_deprecated()->parent()->main_thread_cap();
}