base-linux: omit stack-area init for lx_hybrid

Fixes #2030
This commit is contained in:
Norman Feske 2016-07-06 18:10:23 +02:00
parent d0e7cc35fa
commit 57ec61fb4b
5 changed files with 51 additions and 5 deletions

View File

@ -9,4 +9,4 @@ include $(REP_DIR)/lib/mk/base.inc
LIBS += startup
SRC_CC += thread.cc thread_myself.cc thread_linux.cc
SRC_CC += capability_space.cc capability_raw.cc
SRC_CC += attach_stack_area.cc

View File

@ -118,6 +118,11 @@ class Genode::Platform_env : public Platform_env_base,
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)
*/
void _attach_stack_area();
public:
/**

View File

@ -0,0 +1,29 @@
/*
* \brief Attach stack area to local address space
* \author Norman Feske
* \date 2016-07-06
*
* This function resides in a distinct compilation unit because it is not
* used for hybrid components where the Genode::Thread API is implemented
* via POSIX threads.
*/
/*
* Copyright (C) 2016 Genode Labs GmbH
*
* This file is part of the Genode OS framework, which is distributed
* under the terms of the GNU General Public License version 2.
*/
/* base-internal includes */
#include <base/internal/platform_env.h>
using namespace Genode;
void Platform_env::_attach_stack_area()
{
_local_pd_session._address_space.attach_at(_local_pd_session._stack_area.dataspace(),
stack_area_virtual_base(),
stack_area_virtual_size());
}

View File

@ -154,10 +154,7 @@ Platform_env::Platform_env()
_heap(Platform_env_base::ram_session(), Platform_env_base::rm_session()),
_emergency_ram_ds(ram_session()->alloc(_emergency_ram_size()))
{
/* attach stack area to local address space */
_local_pd_session._address_space.attach_at(_local_pd_session._stack_area.dataspace(),
stack_area_virtual_base(),
stack_area_virtual_size());
_attach_stack_area();
env_stack_area_region_map = &_local_pd_session._stack_area;
env_stack_area_ram_session = ram_session();

View File

@ -21,6 +21,7 @@
/* base-internal includes */
#include <base/internal/native_thread.h>
#include <base/internal/globals.h>
#include <base/internal/platform_env.h>
/**
@ -525,3 +526,17 @@ Thread::~Thread()
/* inform core about the killed thread */
_cpu_session->kill_thread(_thread_cap);
}
/******************
** Platform_env **
******************/
void Platform_env::_attach_stack_area()
{
/*
* Omit attaching the stack area to the local address space for hybrid
* components. Otherwise, it may collide with the (randomized) loading
* locations of shared objects or the binary.
*/
}